Search code examples
rcolorsweb-deploymentcolor-blindness

How to generate 30 distinct colors that are color-blind friendly?


I know some R packages like randomcolorR and pals can generate multiple distinct colors, but I do not know if they are color blind friendly?

Is there a better way to get ~30 distinct colors that are also color-blind friendly? Or is there any table/web I can search for colors that are color-blind friendly? So that I can pick manually.

Thank you in advance.


Solution

  • Note that some sources recommend not using more than 8 colors in a colorblind-friendly palette

    Also, it is recommended to use no more than 8 different colors.

    In any case:

    Here are 2 (similar) palettes of 8 colorblind friendly colors

    enter image description here

    # The palette with grey:
    cbPalette <- c("#999999", "#E69F00", "#56B4E9", "#009E73", "#F0E442", "#0072B2", "#D55E00", "#CC79A7")
    
    # The palette with black:
    cbbPalette <- c("#000000", "#E69F00", "#56B4E9", "#009E73", "#F0E442", "#0072B2", "#D55E00", "#CC79A7")
    
    

    And here's a palette of 15 colorblind-friendly colors

    enter image description here

    pal <- c("#000000","#004949","#009292","#ff6db6","#ffb6db",
     "#490092","#006ddb","#b66dff","#6db6ff","#b6dbff",
     "#920000","#924900","#db6d00","#24ff24","#ffff6d")