Helium314 / SCEE

OpenStreetMap surveyor app for experienced OSM contributors
GNU General Public License v3.0
138 stars 11 forks source link

Color blindness accessibility options for custom overlays #584

Open Lumikeiju opened 1 month ago

Lumikeiju commented 1 month ago

Use Case

I am unable to make use of the "Custom Overlay" functionality because I cannot distinguish between some of the colors of the circles.

upload

For example, in the image above, I am able to pick out the #B861BE-colored circles in the top left, but the #FF0000-colored and #99931E-colored circles appear indistinguishable to me.

Proposed Solution

This could be solved by any of the following:

upload

Helium314 commented 1 month ago

The custom overlay may produce similar colors in general. The coloring part would need to be re-written to somehow produce non-similar colors in all cases.

Providing the option to display a character on top of the circle to help distinguish the values.

Making anything depend on how many different values there are (be it the choice of color, or adding a number) is likely going to end up causing a lot of confusion, because only the currently displayed values can be taken into account.

mnalis commented 1 month ago

In other words, it is also possible that the people without color blindness will by chance get two colors which are visually very similar (like two very slightly different values of pink, for example).

The code currently makes a hash of the value being used as a key for a color, and then uses 6 hex-digits to create RGB color. That results in random color out of a pool of about 16 million different colors. Of course nobody can really tell the difference for 16 million colors... But the chance is that the values will be far apart that they would look different.

The advantage of that method is:


Regarding proposed solutions:

Only using colorblind-distinguishable colors by default (an already established palette could be used, or a resource like this may be helpful for developing one)

It would seem to be hard to have any fixed list of colors while preserving the feature that one tag value always results in same color, which is very important.

E.g. it might be might be possible to create a list of 256 color-blind-friendly colors and use that short hash as an index to that palette, but with just 256 values collisions are somewhat likely (i.e. two different values might get the exactly the same color, which is quite unwanted!) Then again, it might work and collisions might be rare, hard to say. :man_shrugging:

Providing the option to display a character on top of the circle to help distinguish the values.

That one has too many problems IMHO:

Allow for "hue-shifting" the overlay

Now, this one might perhaps be possible. Do you @Lumikeiju (or anyone else) have ideas how that might work?

Given that the input number is random hex number from #000000 to #ffffff (currently corresponding to RGB color), is there a way where one can programmatically detect that the suggested color to be potentially problematic, and where one could mathematically convert that number to some other number, which would be guaranteed to be more colorblind-friendly (at least for few of more popular color-blindness variants)? If so, such solution might be significantly less collision-prone (and thus better) than "256-color palette" idea above.