# Colorblind-safe scientific color palettes

> Colorblind-safe color palettes for scientific figures: Okabe–Ito, Paul Tol, viridis, cividis, ColorBrewer, with a live check. Copy HEX, Python, R or CSS.

URL: https://www.labcanvas.com/tools/palettes

Pick a published colour palette for your scientific figures (Okabe–Ito, Paul Tol, viridis, cividis, ColorBrewer and journal-style sets), see it on a chart as people with protanopia, deuteranopia or tritanopia would, and copy the colours as HEX codes or ready-to-paste Python (matplotlib), R (ggplot2), CSS or JSON.

## Quick answer

- **What it does:** Gives 16 published colour palettes (Okabe–Ito, Paul Tol, viridis, cividis, ColorBrewer, ggsci journal styles) checked for colour blindness, as HEX, Python, R, CSS or JSON.
- **Formula:** Colour-vision deficiency simulated with the Machado, Oliveira & Fernandes 2009 matrices in linear RGB; smallest ΔE*ab (CIELAB) ≥ 10 under protanopia and deuteranopia = colour-blind friendly.
- **Example:** Okabe–Ito’s 8 colours keep a smallest difference of ΔE*ab ≈ 17 under simulated protanopia and deuteranopia, above the threshold of 10, so the palette is labelled colour-blind friendly.

Free, in the browser, no account needed. Updated 2026-11-08.

## Features

- 16 published palettes with sources
- Live simulation of 4 colour-vision types
- Measured distinguishability (\(\Delta E\)) per palette
- Python, R, CSS, JSON and HEX output
- Contrast against white per colour

## How to use it

1. **Choose the kind of data**: Categories need a qualitative palette; ordered values need a sequential one; values around a midpoint need a diverging one.
2. **Check it**: Each palette is shown on a sample chart under normal vision, protanopia, deuteranopia, tritanopia and greyscale, with the smallest colour difference measured.
3. **Copy the codes**: Copy the HEX list or code for matplotlib, ggplot2, CSS or JSON.

## At a glance

| | |
| --- | --- |
| Palettes | 16 published palettes, each with its source |
| Checked for | Four types of colour vision, simulated with the Machado, Oliveira and Fernandes (2009) model |
| Measure | Smallest colour difference \(\Delta E^*_{ab}\) in CIELAB; about 10 or more under red–green colour blindness counts as colour-blind friendly |
| Export | Python, R, CSS, JSON or HEX |

## How it works

Each palette is checked by simulating colour-vision deficiency with the **Machado, Oliveira and Fernandes (2009)** model in linear RGB and measuring colour differences in **CIELAB** (\(\Delta E^*_{ab}\)). For categorical palettes the smallest difference between any two colours counts; for sequential and diverging palettes, the difference between neighbouring steps. A smallest difference of about 10 or more under red–green colour blindness is labelled colour-blind friendly.

## Worked example: colours for four groups, in Python, R and Prism

A bar chart with four groups (control and three treatments) that has to stay readable for colour-blind readers and in greyscale.

- **Pick a qualitative palette**, because the groups have no order: Okabe–Ito is built for colour-vision deficiency. Use blue `#0072B2`, orange `#E69F00`, bluish green `#009E73` and vermillion `#D55E00`; skip the yellow `#F0E442`, which is too light on white.
- **Check it** with the colour-blind simulation on this page, and keep the control a neutral grey if it should stand back.
- **Use it.** Python (matplotlib): `plt.rcParams["axes.prop_cycle"] = plt.cycler(color=["#0072B2", "#E69F00", "#009E73", "#D55E00"])`. R (ggplot2): `scale_fill_manual(values = c("#0072B2", "#E69F00", "#009E73", "#D55E00"))`. GraphPad Prism or Excel: paste each HEX code into the colour dialog of a data set.

For values with an order, such as concentration or time, use a sequential palette (viridis or cividis) rather than a rainbow: lightness then rises steadily, so the order survives colour blindness and greyscale printing. For values above and below a midpoint, such as fold change around 1, use a diverging palette centred on that midpoint.

## Questions

### What colours should I use for a scientific figure?

For groups without an order, a colour-blind-safe qualitative palette such as Okabe–Ito or Paul Tol’s bright set, with no more than about six to eight colours. For ordered values, a sequential palette such as viridis; for values around a midpoint, a diverging palette. Avoid red–green pairs and rainbow (jet) colour maps.

### How do I use these colours in Python, R or Prism?

Copy the HEX codes. In matplotlib set them as the colour cycle (plt.cycler(color=[…])) or pass a colour map name such as "viridis"; in ggplot2 use scale_fill_manual or scale_colour_manual; in Prism or Excel paste each HEX code into the colour picker of a data set.

### What is the best colorblind-safe palette for scientific figures?

For categories, Okabe–Ito (8 colours) and Paul Tol’s bright or muted sets are the most widely recommended. For continuous data, viridis and cividis are perceptually uniform and readable with colour blindness and in greyscale.

### Is this a color palette generator for scientific figures?

It does that job without random colours: it starts from 16 published palettes that scientists use, shows how each one looks with colour blindness and in greyscale, measures how far apart the colours stay, and generates the HEX codes and the code for matplotlib, ggplot2, CSS or JSON.

### Why avoid red and green together?

About 8 % of men and 0.5 % of women of northern European descent have red–green colour-vision deficiency, which makes red and green hard to tell apart. Use blue/orange, add labels, or vary lightness.

### Should I use rainbow (jet) colour maps?

No. Rainbow maps are not perceptually uniform, create false boundaries and fail for colour-blind readers. Viridis, cividis or magma are better choices.

### How do I use these colours in Python or R?

Choose Python or R in the “Use it” box and copy the code: it sets the matplotlib colour cycle or gives a vector for ggplot2’s scale_colour_manual.

### Are the journal-style palettes official?

No. They come from the ggsci R package, which offers palettes inspired by journal styles; journals do not require them.
