Maps each colour to the colour a reader with a given form and severity of colour-vision deficiency would perceive, using the physiologically-based model of Machado, Oliveira and Fernandes (2009). The transformation is defined on linear-light RGB, so a colour is decoded from sRGB to linear RGB (the IEC 61966-2-1 transfer functions), transformed, then re-encoded.
Arguments
- colours
Character vector of colours, in any form
grDevices::col2rgb()understands.- deficiency
The deficiency to simulate:
"protan"or"deutan"(the two red-green forms) or"tritan"(blue-yellow).- severity
Severity in
[0, 1]. Zero leaves the colours unchanged and one is the full deficiency. Intermediate values interpolate the transform towards the identity, an approximation to Machado et al.'s per-severity matrices.
Details
This is the simulator behind palette_preview()'s cvd argument, behind
palette_safety(), and behind the colour-separability rows of
check_figure().
References
Machado GM, Oliveira MM, Fernandes LAF (2009). “A physiologically-based model for simulation of color vision deficiency.” IEEE Transactions on Visualization and Computer Graphics, 15(6), 1291–1298. doi:10.1109/TVCG.2009.113 .
