clr_protan | R Documentation |
Simulate color vision deficiency
clr_protan(col, severity = 1)
clr_deutan(col, severity = 1)
clr_tritan(col, severity = 1)
col |
A |
severity |
A numeric indicating the severity of the color vision defect. Must be a number between 0 and 1, where 0 means no deficiency, and 1 means complete deficiency. Defaults to 1. |
The matrices used to perform transformations have been taken as the
1.0 value in table 1 in
http://www.inf.ufrgs.br/~oliveira/pubs_files/CVD_Simulation/CVD_Simulation.html.
Values for severity
values between 0 and 1 will be linearly interpolated.
A colors
object of the same length as col
.
http://www.inf.ufrgs.br/~oliveira/pubs_files/CVD_Simulation/CVD_Simulation.html
Gustavo M. Machado, Manuel M. Oliveira, and Leandro A. F. Fernandes "A Physiologically-based Model for Simulation of Color Vision Deficiency". IEEE Transactions on Visualization and Computer Graphics. Volume 15 (2009), Number 6, November/December 2009. pp. 1291-1298.
rainbow_colors <- color(rainbow(10))
plot(clr_protan(rainbow_colors))
plot(clr_deutan(rainbow_colors))
plot(clr_tritan(rainbow_colors))
viridis_colors <- c(
"#4B0055FF", "#422C70FF", "#185086FF", "#007094FF",
"#008E98FF", "#00A890FF", "#00BE7DFF", "#6CD05EFF",
"#BBDD38FF", "#FDE333FF"
)
plot(clr_protan(viridis_colors))
plot(clr_deutan(viridis_colors))
plot(clr_tritan(viridis_colors))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.