There is a problem that some colors used by FLTK are automatically generated. That in itself isn't a problem, but it unfortunately often generates colors with insufficient contrast. And applications have no decent way of overriding this.
The core of this is that fl_contrast() is used to generate some colors. And it doesn't have a good algorithm for determining contrast (which is very hard).
Fixing fl_contrast() is a massive thing, which probably requires implementing APCA. Right now it doesn't even linearize values properly¹. So realistically more defined colors are probably needed for applications so that manually checked values can be directly added.
For us the problem has been a contrast color to FL_SELECTION_COLOR . If we use GNOME's default blue (53,132,228), or macOS blue (0, 122, 255) we get black as the contrast color. This an entirely insufficient contrast, as can be tested using this online tool:
https://www.myndex.com/APCA/
We can also see that both GNOME and macOS uses white as the contrast color in these cases.
For now the compromise seem to be the color (29, 113, 215) which is the lightest color we can use and still get white as the contrast color.
Adding a FL_SELECTION_CONTRAST_COLOR or something could be a way forward.
¹fl_color_average() also forgets to use linear values, so that probably needs to be fixed as well
— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.Message ID: <fltk/fltk/issues/370@github.com>
[ Direct Link to Message ] |