nix-colors icon indicating copy to clipboard operation
nix-colors copied to clipboard

More lib functions?

Open djacu opened this issue 2 years ago • 3 comments

Hey this is a great module and thanks for creating it!

One thing I had to do was convert hex values to comma separated RGB values so I could use them with waybar. The styling uses CSS and I needed them in RGB so I could use them with an opacity. I created several small functions to do the conversion which you can find here. Would be happy to put in a PR adding them to the lib of this module if it is desired.

djacu avatar May 20 '22 03:05 djacu

Please do!

I'm actually planning on splitting the lib into "core" and "contrib" sections. I also plan on implementing a function that can import base16 .yml schemes into nix-colors, as well as another function that can apply a nix-colors scheme to a base16 template (and output a string the person might use however they want). So these functions would constitute the core, and the app-specific ones would be contrib.

Converting between color formats is a very necessary core function, and would be greatly appreciated!

(For now, please add these to the usual function file, and I'll handle the splitting)

Misterio77 avatar May 20 '22 13:05 Misterio77

Hey, just wanted to let you (and anyone else possibly following this thread) know that loading YAML schemes is now supported :)

Rendering templates should come soonish (not a priority, I think it's already ergonomical enough without this feature, but it's a nice to have regardless)

Feel free to add any color-related functions you might be interested in upstreaming at lib/core

Misterio77 avatar Jun 10 '22 08:06 Misterio77

Awesome! And will do! I've been pondering how to add some testing to the functions I wrote and after looking through nixpkgs, I think I have an idea on how to do it.

djacu avatar Jun 10 '22 18:06 djacu

Fixed by #18

Misterio77 avatar Apr 21 '23 20:04 Misterio77