How do you choose colors that are both accessible to colorblind viewers and analytically meaningful?
Choose the palette from the data's meaning first: sequential for ordered magnitude, diverging around a meaningful midpoint, and qualitative for unordered categories. Avoid red-green as the only cue, test contrast and color-vision simulations, and add labels, shapes, line styles, or position so color is never required to decode the chart.
How to think about it
I choose colors in two stages: first from the meaning of the data, then for accessibility and perceptual separation. I use sequential palettes for ordered magnitudes, diverging palettes around a meaningful midpoint, and qualitative palettes for unordered categories; I never make red versus green the only way to understand the chart.
Why this is more than picking “safe” colors
A palette is the set of colors used in a chart. The important question is not merely whether those colors are technically distinguishable. It is whether they communicate the right relationship between values.
Color vision deficiency, often called colorblindness, means that some cone cells in the eye are absent or respond differently to light. A commonly cited estimate is that roughly 8 percent of men and about 0.5 percent of women have some form of red-green color vision deficiency, although prevalence varies across populations. Deuteranopia and protanopia are two forms in which red and green can become difficult to distinguish. Protanopia can also make some reds appear darker.
That makes a red-green dashboard risky. A reader may see two similar olive or brownish marks where the designer sees an obvious stoplight. The problem is not a lack of intelligence or attention. The visual signal has collapsed.
The first accessibility principle is therefore to use more than hue. Luminance means the perceived lightness of a color. Differences in lightness usually survive color-vision deficiency better than small differences between hues. They also survive grayscale printing, cheap projectors, glare, and the screenshot someone pastes into a slide at 1:17 a.m.
But accessibility alone is not enough. A palette can be easy to distinguish and still tell the wrong analytical story. A rainbow palette may contain many visible hues, yet imply boundaries that do not exist. Fifteen bright category colors may technically be different, yet turn the legend into a scavenger hunt.
Match the palette to the data
I start by asking what a color is supposed to mean.
| Data meaning | Palette | Why |
|---|---|---|
| Low to high magnitude | Sequential | Lightness changes in one direction, so darker or stronger color means more |
| Values on both sides of a target | Diverging | Two color families show opposite directions, with a neutral midpoint |
| Unordered groups | Qualitative | Different hues separate categories without suggesting rank |
A sequential palette is appropriate for values such as revenue from 0 to 100 million, population density, or response time from fast to slow. It should generally move from lighter to darker, or from weaker to stronger, in a steady way. A sequential scale does not require zero to be meaningful. It requires the values to have one direction of increasing magnitude.
A diverging palette is appropriate when the midpoint has meaning: profit versus loss around zero, actual sales versus a target, or temperature anomaly above and below a baseline. It has two ordered arms and a neutral center. Blue through near-white to orange is usually safer than red through white to green.
A qualitative palette is for categories such as region, product line, or browser type. These categories have no natural low-to-high order. Using pale blue for one product and dark blue for another may accidentally suggest that one product is “more” than the other. Each category should be visually distinct, but not ranked by color intensity.
The choice of palette comes before the colorblind check. Testing a beautifully accessible qualitative palette does not rescue a chart that uses it to encode a continuous number.
A concrete example
Suppose I am building an operations dashboard showing weekly profit-margin variance from target for six stores:
| Store | Variance from target |
|---|---|
| A | -12 percentage points |
| B | -7 percentage points |
| C | -2 percentage points |
| D | +1 percentage point |
| E | +4 percentage points |
| F | +9 percentage points |
Here, zero is not merely the bottom of the scale. It means “hit the target.” Negative and positive values have different business interpretations, so I would use a diverging palette:
- Dark blue for a large negative variance.
- Pale blue for a small negative variance.
- A neutral center at zero.
- Pale orange for a small positive variance.
- Dark orange for a large positive variance.
I might use the Okabe-Ito blue #0072B2 and orange #E69F00 as the endpoints, with a light neutral midpoint. The bars would also extend below or above a clearly marked zero line, and each bar would have a numeric label such as -12 pp or +9 pp.
That gives the reader three independent clues:
- Bar position shows whether the value is below or above target.
- Lightness and hue show the size and direction of the variance.
- The label gives the exact number.
A simplified Matplotlib version could look like this:
import matplotlib.pyplot as plt
from matplotlib.colors import LinearSegmentedColormap, Normalize
stores = ["A", "B", "C", "D", "E", "F"]
variance = [-12, -7, -2, 1, 4, 9]
palette = LinearSegmentedColormap.from_list(
"target",
["#0072B2", "#F2F2F2", "#E69F00"]
)
colors = palette(Normalize(-12, 12)(variance))
plt.bar(stores, variance, color=colors, edgecolor="#333333")
plt.axhline(0, color="#333333", linewidth=1)
plt.ylabel("Profit-margin variance from target (percentage points)")
The important part is not the library call. It is the mapping: negative and positive values use opposite sides of a meaningful midpoint, while the chart’s geometry and labels continue to work if all color is removed.
If I instead used color to identify the store and bar height to show variance, I would be spending color on the less important variable. The store name already appears on the horizontal axis. Color should carry the analytical distinction the reader needs to compare.
Make the encoding survive real use
For qualitative categories, I would start with a palette such as Okabe-Ito. Its commonly used colors include blue, orange, bluish green, vermillion, and reddish purple. ColorBrewer also provides palettes with documented properties for sequential, diverging, and qualitative data. I would still inspect the actual palette rather than assume that every palette from a named collection is safe in every situation.
For continuous data, viridis and cividis are sensible starting points because their lightness changes relatively smoothly and they remain usable for many forms of color vision deficiency. The exact choice still depends on the background, the number of marks, and whether the chart is meant for a screen, print, or both.
I check four things:
Contrast against the background. A light blue line on a white background may be technically blue but practically invisible at one pixel wide. For text, WCAG AA uses a contrast ratio of at least 4.5 to 1 for normal-sized text and 3 to 1 for large text. Its non-text guidance uses 3 to 1 for meaningful graphical objects and interface components in applicable cases. These are useful floors, not a guarantee that the chart is easy to read.
Contrast between neighboring values. In a heatmap, adjacent cells need enough difference to reveal a pattern. If every low value is nearly white, the entire lower half of the distribution can disappear. A visible cell border, annotation, or carefully chosen midpoint can help.
Color-vision simulation. I view the chart with a simulator such as Color Oracle or Coblis, then inspect it in grayscale. I test the actual chart, not just a row of color swatches. Tiny points, thin lines, transparency, and overlapping marks behave differently from large rectangles.
The printed and compressed version. A chart that works on a large monitor may fail in a black-and-white PDF or a slide viewed from the back of a conference room. If removing color makes two important series indistinguishable, color was doing too much work.
Redundancy is not decorative duplication. It is fault tolerance for human perception. On a scatter plot, pair color with shape when there are only a few groups. On a line chart, use direct labels and distinct line styles. On bars, use position, value labels, or patterns where patterns will not create clutter. Position is usually easier to compare accurately than hue, so use the axis and layout to carry as much information as possible.
The trade-off and the common failure
“Colorblind-safe” is not a binary certification. A palette may work for large marks and fail for tiny points. Two colors may be distinguishable on one display and merge under a projector. A viewer may have a form of color vision deficiency that your simulator does not model. Accessibility is therefore a testing process, not a sticker placed on the chart.
There is also a hard capacity limit. If a chart has 15 unordered categories, adding 15 increasingly loud hues is not a solution. The reader has to remember 15 arbitrary color-to-category mappings, and several colors will be confused even by viewers with typical color vision. I would use small multiples, direct labels, filtering, grouping, or position instead. A qualitative palette is useful for a handful of categories, not an excuse to turn the plot into a paint sample catalogue.
Common trap: Red and green are not forbidden. They are unsafe when they are the sole signal. If a business convention requires red for a problem and green for a healthy state, add text, an icon, shape, or position, and test the result under color-vision deficiency and grayscale.
A frequent production failure is a status dashboard in which “at risk” and “healthy” are represented only by red and green. The first symptom is not usually a dramatic accessibility report. It is users asking which rows need attention, misreading screenshots, or relying on the legend instead of seeing the pattern. The fix is not simply a different pair of hues. Add words such as “At risk” and “Healthy,” use warning symbols carefully, and make the underlying values or ordering visible.
I also avoid the rainbow, or jet, colormap for continuous values. Its lightness changes unevenly, especially around yellow and green, so a smooth numerical change can look like a sharp boundary. It also creates confusing similarities for some color-deficient viewers. A monotonic sequential palette is usually more honest.
What they’ll ask next
Can I ever use red and green together?
Yes, but not as the only distinction. Use them only when the convention is valuable, then add labels, icons, shapes, or position. I would usually prefer blue and orange for a new design because it removes an avoidable source of confusion.
What would you do with 15 categories?
I would not force 15 colors into one legend. I would reduce the number of groups, show small multiples, label directly, provide filtering, or encode the categories with position and use color only for a smaller highlighted subset. The right answer depends on whether comparison across all categories is actually required.
Why is a rainbow scale a problem if it has lots of colors?
Because the visual distance between colors is not the same as the numerical distance between values. Changes in lightness can create false bands, particularly around yellow and green. A perceptually smoother sequential scale makes gradual data look gradual.
How would you validate your final chart?
I would inspect it with a color-vision simulator, in grayscale, at the smallest intended display size, and in its printed or exported form. I would check text and important marks against contrast guidance, then ask whether the chart still answers its main question when color is removed.
Say this in the interview: “I match palette type to data meaning, favor separable lightness and colorblind-safe hues, test the real chart in grayscale and simulation, and add redundant encodings so color is never the only way to understand it.”