Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR R

color blind friendly palette r

# n - number of colors in the palette
get_palette <- function(n) {
	require(RColorBrewer)
	colors <- brewer.pal.info[brewer.pal.info$colorblind == TRUE, ]
	col_vec <- unlist(mapply(brewer.pal, colors$maxcolors, rownames(colors)))
	return(sample(col_vec, n))
}
 
PREVIOUS NEXT
Tagged: #color #blind #friendly #palette
ADD COMMENT
Topic
Name
3+8 =