Skip to main content

Colorblind-safe palettes for charts

Palettes that stay readable for people with color blindness, with hex codes ready for matplotlib, ggplot2, CSS and JSON. Below them, paste your own chart colors to see which pairs merge for color-blind viewers.

Pick a palette

  • #000000
  • #E69F00
  • #56B4E9
  • #009E73
  • #F0E442
  • #0072B2
  • #D55E00
  • #CC79A7
Python / matplotlibcolors = ['#000000', '#E69F00', '#56B4E9', '#009E73', '#F0E442', '#0072B2', '#D55E00', '#CC79A7']
R / ggplot2scale_colour_manual(values = c("#000000", "#E69F00", "#56B4E9", "#009E73", "#F0E442", "#0072B2", "#D55E00", "#CC79A7"))
CSS--chart-1: #000000; --chart-2: #E69F00; --chart-3: #56B4E9; --chart-4: #009E73; --chart-5: #F0E442; --chart-6: #0072B2; --chart-7: #D55E00; --chart-8: #CC79A7;
JSON["#000000","#E69F00","#56B4E9","#009E73","#F0E442","#0072B2","#D55E00","#CC79A7"]

Paste 2 to 12 colors in any format, separated by commas or lines. A list copied from Python or R code works too.

Typical vision: closest pair ΔE 22.2 — clear

Protanopia: closest pair ΔE 17.7 — clear

Deuteranopia: closest pair ΔE 12.7 — clear

Tritanopia: closest pair ΔE 10.5 — clear

Our rule, not a standard: ΔE2000 under 6 is too close (the same color family), under 10 is easy to mix up in a small legend. The simulation models people who lack one cone type; milder color weakness varies from person to person, so label lines and bars as well.

Why the default colors fail

matplotlib’s default red and green, tab:red #D62728 and tab:green #2CA02C, differ by ΔE 71.8 for typical vision, but only 4.7 once simulated for deuteranopia, a red-green type of color blindness: the same color family. Paste them into the checker above to see it. Charts that tell red from green by color alone lose that information for these readers.

Where the palettes come from

Every value is copied from the original source, not from a blog post. Okabe–Ito is the eight-color set from Masataka Okabe and Kei Ito’s «Color Universal Design» page, read from its RGB column. viridis is matplotlib’s 256-step table by Nathaniel Smith, Stéfan van der Walt and Eric Firing, released into the public domain (CC0); n colors are picked as matplotlib picks them. ColorBrewer schemes are listed only at the sizes ColorBrewer itself marks as colorblind-safe.

This product includes color specifications and designs developed by Cynthia Brewer (http://colorbrewer.org/). ColorBrewer is distributed under the Apache License 2.0.

The checker uses the same simulation as the color blindness simulator: Viénot, Brettel and Mollon (1999) for protanopia and deuteranopia, Brettel, Viénot and Mollon (1997) for tritanopia. The difference between two colors is CIEDE2000, as in the Delta E calculator.

Colorblind-safe palettes: questions

What is the best colorblind-friendly palette for charts?
For categories, the Okabe–Ito palette of eight colors is the usual choice: it was designed to stay distinct for people with red-green color blindness and is printable. For ordered values, viridis runs from dark purple to yellow and keeps rising in lightness, so it reads even in greyscale.
What are the Okabe–Ito hex codes?
black #000000, orange #E69F00, sky blue #56B4E9, bluish green #009E73, yellow #F0E442, blue #0072B2, vermilion #D55E00, reddish purple #CC79A7. They come from the RGB values in Okabe and Ito’s Color Universal Design page.
How do I use viridis in matplotlib or ggplot2?
In matplotlib, cmap="viridis" for a continuous scale, or plt.cm.viridis(np.linspace(0, 1, n)) for n separate colors; the hex lists on this page are exactly those n colors. In ggplot2, scale_colour_viridis_d() and scale_fill_viridis_c() give the viridis scale; to fix exact colors, paste the list from this page into scale_colour_manual().
How does the checker decide that two colors are too close?
It simulates each color for protanopia, deuteranopia and tritanopia, then measures every pair with CIEDE2000, the color difference formula. Under 6 the two look like the same color family; under 10 they are easy to mix up in a small legend. These two thresholds are our rule, not a standard.
Is a palette that passes the check safe for everyone?
No. The simulation models people who lack one type of cone. Many color-blind people have a weaker cone instead, and how much it shifts colors varies. Labels on lines, patterns on bars and differences in lightness help everyone.

Sources

  1. Okabe M., Ito K. (2002, updated 2008). Color Universal Design (CUD): how to make figures and presentations that are friendly to colorblind people. Fig. 16, colorblind barrier-free color palette, RGB values 0–255. Link
  2. matplotlib, lib/matplotlib/_cm_listed.py: the viridis colormap data (256 entries), CC0. Link
  3. BIDS/colormap, colormaps.py: «New matplotlib colormaps by Nathaniel J. Smith, Stefan van der Walt, and (in the case of viridis) Eric Firing», released under CC0. Link
  4. Brewer C. A., Axis Maps. ColorBrewer 2.0: colorbrewer_schemes.js with each scheme’s colorblind-safe flag, Apache License 2.0. Link
  5. Viénot F., Brettel H., Mollon J. D. (1999). Digital video colourmaps for checking the legibility of displays by dichromats. Color Research & Application 24(4), 243–252. DOI
  6. Brettel H., Viénot F., Mollon J. D. (1997). Computerized simulation of color appearance for dichromats. Journal of the Optical Society of America A 14(10), 2647–2655. DOI
  7. Sharma G., Wu W., Dalal E. N. (2005). The CIEDE2000 color-difference formula: implementation notes, supplementary test data, and mathematical observations. Color Research & Application 30(1), 21–30. DOI