danth / stylix

System-wide colorscheming and typography for NixOS
https://stylix.danth.me/
MIT License
906 stars 105 forks source link

gtk: improvement to colors #295

Open dafitt opened 3 months ago

dafitt commented 3 months ago

Looking at the GTK4 documentation (#colors)...

GTK extends the CSS syntax with several additional ways to specify colors.

lighter(Color) produces a brighter variant of Color darker(Color) produces a darker variant of Color shade(Color, Number) changes the lightness of Color. The number ranges from 0 for black to 2 for white. alpha(Color, Number) replaces the alpha value of color with number (between 0 and 1) mix(Color1, Color2, Number) interpolates between the two colors

... i wondered if we can improve the gtk colors in this file.

Before:

@define-color blue_1 #{{base0D-hex}};
@define-color blue_2 #{{base0D-hex}};
@define-color blue_3 #{{base0D-hex}};
@define-color blue_4 #{{base0D-hex}};
@define-color blue_5 #{{base0D-hex}};

After:

@define-color blue_1 lighter(lighter(#{{base0D-hex}}));
@define-color blue_2 lighter(#{{base0D-hex}});
@define-color blue_3 #{{base0D-hex}};
@define-color blue_4 darker(#{{base0D-hex}});
@define-color blue_5 darker(darker(#{{base0D-hex}}));

But i don't know if those functions are working in the css file, if they are supported by gtk3 and if the generated colors are playing along. So that should be tested first. But if they are, we could improve the color variation.

danth commented 3 months ago

We use adw-gtk3 for consistency between GTK3 and GTK4, so it should be supported, but we should definitely check this.

The generated color schemes are sometimes a bit sub-par, but that's a separate issue. I tend to only use pre-made schemes for testing module changes.

dafitt commented 2 months ago

I understand. So feel free to close this issue if it is irrelevant.