@Misterio77 hi and thank you so much for the nix-colors, it’s amazing)
I was making a library to use base16 in Qtile, my main goal was to use only base16.
But sometimes there really aren’t enough colors, so I wrote a small class that receives a base16 color as input and shifts it according to HSL.
hslpicker
This is what it looks like:
This is result:
#...
from base16_colorlib import Color
from base16_colorlib import catppuccin_mocha
#...
colors = Color(**catppuccin_mocha)
#...
widgets = {
#...
'Timelabel': widget.TextBox(
background=colors.lightness(colors.scheme['base0D'], -4), # <= look this
foreground=colors.scheme['base00'],
#...
),
'Time': widget.Clock(
background=colors.scheme['base0D'], # <= look this
foreground=colors.scheme['base00'],
#...
),
#...
}
I saw some math in the nix-colors source code)
Maybe try implementing lib functions for nix-color that could allow changing colors in the configuration?
The shift is universal for all color schemes.
If, as in the example above, you need one color to be slightly darker or more saturated than another, this will work with any theme switched on the fly, etc.
For example, I rewrote the implementation from python to lua for awesomewm.
colorize
The difficulty with math is mainly in the functions for converting hex-rgb-hsl-rgb-hex, otherwise everything is elementary.
But as for Nix, unfortunately I don't know nixpkgs.lib well and can only write simple nix expressions(
I know that nix is primarily a package manager, but it is also a functional language)
@Misterio77 hi and thank you so much for the nix-colors, it’s amazing)
I was making a library to use base16 in Qtile, my main goal was to use only base16. But sometimes there really aren’t enough colors, so I wrote a small class that receives a base16 color as input and shifts it according to HSL. hslpicker
This is what it looks like:
This is result:
I saw some math in the nix-colors source code) Maybe try implementing lib functions for nix-color that could allow changing colors in the configuration?
The shift is universal for all color schemes. If, as in the example above, you need one color to be slightly darker or more saturated than another, this will work with any theme switched on the fly, etc.
For example, I rewrote the implementation from python to lua for awesomewm. colorize The difficulty with math is mainly in the functions for converting hex-rgb-hsl-rgb-hex, otherwise everything is elementary. But as for Nix, unfortunately I don't know nixpkgs.lib well and can only write simple nix expressions(
I know that nix is primarily a package manager, but it is also a functional language)