rktjmp / lush.nvim

Create Neovim themes with real-time feedback, export anywhere.
MIT License
1.44k stars 47 forks source link

.darken/.lighten and other functions of this kind aren't working #66

Closed ghost closed 2 years ago

ghost commented 2 years ago

Basically, I am creating my onedark-pro theme (available on vs-code extentions market) variant for neovim, lush.nvim parser is amazing, but for some reason the functions to darken and lighten the colors does not work.

Yes I declared the Normal before the comment section, as shown here.

Any help would be appreciated, thanks!

21-09-05_20h:41

rktjmp commented 2 years ago

You have to wrap the strings in a call to hsl/hsluv so they are the correct internal types, which have the operations attached.

Normal { bg = hsluv("#2c323c") }

The reason values aren't automatically wrapped (as might be expected) is to keep Lush somewhat agnostic to what you give it (i.e. you could drop in a CMYK library or whatever as long as tostring(v) -> #hexhex).

ghost commented 2 years ago

Thanks, the hsluv function is basically what I need (since I don't want to deal with hsl because all the colors are already in hex)