clauswilke / colorblindr

An R package to simulate colorblindness on R figures.
MIT License
306 stars 29 forks source link

Feature request: a function that scores a specific color wrt "colorblindness perceivability" #19

Open mskyttner opened 4 years ago

mskyttner commented 4 years ago

Could the package include a function that calculates some kind of a "colorblindness accessibility score" given a color (or palette)?

The code here http://mkweb.bcgsc.ca/colorblind/code.mhtml#page-container appears to be able to calculate correction (see getcorrection fcn) to provide "variants".

Given such a score, a color that is similar (in hue?) but better wrt colorblindness perception could be found and used to improve a specific set of colors?

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