stylix icon indicating copy to clipboard operation
stylix copied to clipboard

mkHslColor: create lib option

Open azikxz opened this issue 1 month ago • 1 comments

I was setting up glance and turned to stylix, there I found a module that creates hsl colors based on base0*

I thought it would be good to put this into a separate function for, say, creating services.glance.settings.pages...bookmarks.groups.*.color = mkHslColor "base0B"

pls...

azikxz avatar Nov 18 '25 13:11 azikxz

I was setting up glance and turned to stylix, there I found a module that creates hsl colors based on base0*

I thought it would be good to put this into a separate function for, say, creating services.glance.settings.pages...bookmarks.groups.*.color = mkHslColor "base0B"

Currently, global functions are exposed in config.lib.stylix, although this will eventually change. However, this rg-to-hsl.nix function is currently not externally exposed.

See commit 834a743c11d6 ("stylix: add config.lib.stylix.{mkHexColor,mkOpacityHexColor} functions (#1274)") as an example on adding public functions.

I would not mind globally interfacing this function.

Since there are also several other functions that are inlined throughout the codebase, our internal lib will eventually grow. Some functions could be upstreamed to Nixpkgs, although we should probably keep everything in-tree as a first step.

Feel free to submit a PR.

trueNAHO avatar Nov 18 '25 13:11 trueNAHO