In latest GTK 4, the only non-deprecated use of StyleContext is to set a provider for the whole screen. Since we have a finite number of monitor colors, we really don't need to generate this CSS. Instead we can just have a set number of color style classes and then assign a style class to each display widget.
Set the CSS name of display widgets
Create color-number classes with predefined styles
Tiny style stuff, make the label slightly bolder, give the widget a little rounded corner, clear icon palette to improve contrast of star icons
Add one style provider to the screen, not to each widget for each color
In latest GTK 4, the only non-deprecated use of StyleContext is to set a provider for the whole screen. Since we have a finite number of monitor colors, we really don't need to generate this CSS. Instead we can just have a set number of color style classes and then assign a style class to each display widget.