doehm / evoPalette

Evolve new colour palettes
15 stars 0 forks source link

Feature request: evolving an existing palette to make it more accessible/colorblind-friendly #1

Open mskyttner opened 4 years ago

mskyttner commented 4 years ago

Wishing for a feature to allow "descending the gradient towards color palette accessibility". It would be nice to be able to evolve an existing palette to make it easier to perceive for colorblind people. Given an existing set of profile colors such as described here: https://intra.kth.se/en/administration/kommunikation/grafiskprofil/profilfarger-1.845077, could a function be provided that evolves this palette into colors that are scored better with regards to colorblindness-perceivability?

This would be useful for increasing web content accessibility but staying close to branding/profile color palettes, tweaking these existing palettes towards something that works better for colorblind people...

Perhaps the "goodness" of a color choice could be measures in terms of how easy it can be perceived by colorblind through some metric that can be "evolved"... some code here might be relevant that determine colors that are suitable to be used for improving colorblind perception: http://mkweb.bcgsc.ca/colorblind/code.mhtml#page-container with corresponding "good" palettes: http://mkweb.bcgsc.ca/colorblind/palettes/24.color.blindness.palette.txt

Personally I'd like to use such functionality to improve this color palette: https://github.com/KTH-Library/ktheme/blob/master/R/palette.R#L42-L81

doehm commented 4 years ago

Possibly. I could see it working in a couple of ways. The colourblindness score could be given to each palette and visible to the user allowing them to make the their choice based on both colour and accessibility. Or there is an automatic selection step based on colourblindness score e.g. a palette only 'survives' if it reaches x.

I'll look into it.

mskyttner commented 4 years ago

Thanks for considering this functionality.

It would be great to have a way to automatically improve an existing palette with regards to colour-blindness accessibility, while staying close to the original set of colours that one may have to stay close to due to graphical profiles, colour branding etc that might already be in place....

Functionality that allows "evolving" an existing palette that someone wants to stay close to into a variation that gets a better colour-blindness accessibility score through the help of your R package would be quite useful in my opinion.

If one finds a good "colour-blindness accessibility metric" then this metric would be expected to give better scores to the palettes at http://mkweb.bcgsc.ca/colorblind/palettes/8.color.blindness.palette.txt - obviously - and also to the "colour-blind safe" colours at https://colorbrewer2.org (the web GUI has a checkbox for the ones which are "colour-blind safe/accessible"):

subset(RColorBrewer::brewer.pal.info, colorblind == TRUE)

Not sure how such a metric would be calculated given a specific colour (or set of colours?), perhaps it needs to be given in comparison to the corresponding "colour-blind perceivable reference color" ... not sure if there is some existing good way to measure this already but the getcorrection() function at http://mkweb.bcgsc.ca/colorblind/code.mhtml#page-container seems to do this?

Those "colour-blind" safe palettes mentioned above could perhaps be seen as a kind of a training set and metrics for those could be compared more broadly to larger set of palettes, such as for example all of those available through https://github.com/EmilHvitfeldt/paletteer (which seems to be a kind of color palette aggregator R package).