Color blindness is color vision deficiency, which means people with color blindness may be not aware of differences among colors that are obvious to the people without it. This package is designed to provide a collection of safe colors for plots such as heatmaps, pie chart, and try to find a solution for acceptable figures for all the end users.
There are lots of packages already collected lots of safe colors. I list some of them, but not limited here.
For this package, I will try to collect as much as possible safe color sets ready to use.
The tool used to simulate the color vision deficiency is called CVD simulator. I list some of packages here with CVD simulator.
To plot figures by colors of this package, there are three steps:
select correct safe color set.
plot with the color set.
check the plot by CVD simulator.
For example if we want to plot a heatmap.
library(colorBlindness) mat <- matrix(1:81, nrow = 9, ncol = 9) library(ggplot2) library(reshape2) mat1 <- melt(t(mat[9:1, ])) len <- length(Blue2DarkRed12Steps)-1 mat1$v2 <- cut(mat1$value, breaks = seq(0,ceiling(81/len)*len, length.out = len+1)) ht <- ggplot(mat1) + geom_tile(aes(x=Var1, y=Var2, fill=v2)) + scale_fill_manual(values=Blue2DarkRed12Steps) + theme_bw() # check the plot by CVD simulator cvdPlot(ht)