FLTK logo

[fltk/fltk] Not enough contrast on automatic colors (Issue #370)

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.issues  ]
 
Previous Message ]New Message | Reply ]Next Message ]

[fltk/fltk] Not enough contrast on automatic colors (Issue #370) "Pierre Ossman (Work account)" Jan 14, 2022  
 

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 ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.