Course contents36 lessons

Crash course / Showing the result

Colour is an encoding, not decoration

Colour has exactly four jobs in a chart. Using it for anything else adds noise, and using it carelessly excludes about one in twelve of your readers.

Lesson 32 of 36 · 4 min read ·Visualization

Colour is the most abused channel in data visualization because it is the most fun. It is also the least precise: people can compare positions and lengths accurately, and colours only roughly. So colour should carry the categorical or ordinal information, and position should carry the quantity.

The four jobs#

Categorical — distinguishing identity. Discrete hues, fixed order, no implied ranking. Product categories, regions, variants.

Sequential — encoding magnitude. One hue, light to dark. Population density, revenue per cell, counts in a heatmap.

Diverging — encoding polarity around a meaningful midpoint. Two hues with a neutral grey between. Change versus last year, correlation from −1 to 1, sentiment.

Status — reserved meanings: good, warning, serious, critical. Never reused for a data series.

If your use of colour is not one of these four, it is decoration, and decoration in a chart competes with the data for attention.

Colour follows the entity, never the rank#

If "Europe" is blue in one chart it is blue in every chart. And if a filter removes two series, the survivors must keep their colours — repainting them because the list got shorter is how a reader concludes something changed when nothing did.

This means assigning colours from a fixed ordered list keyed on the entity, not iterating over whatever happens to be in the current result set.

Eight is the limit, and three for scatter#

Beyond about eight categorical colours, adjacent hues stop being reliably distinguishable — especially for readers with colour-vision deficiency. Past eight: group the tail into "Other", facet into small multiples, or use direct labels instead of colour.

Scatter plots are stricter. In a bar chart or line chart, only adjacent colours need to be told apart. In a scatter, every pair of colours appears side by side somewhere in the cloud, so all pairs must separate — and no eight-colour palette manages that. Cap scatter at three colour categories, and fold the rest.

The Chart Builder enforces both limits, which is occasionally annoying and always correct.

Colour-vision deficiency is not an edge case#

Roughly 8% of men and 0.5% of women have some form of it. Red–green confusion is the most common, which makes the default "red is bad, green is good" pairing the single worst choice available, and it is everywhere.

Two rules:

Never let colour be the only encoding. Pair it with a direct label, a shape, a position, or an icon. A legend mapping five hues to five names is colour-alone, and it fails for readers who cannot separate two of the hues.

Validate the palette instead of eyeballing it. Simulate the common deficiencies and measure the perceptual distance between every pair you will show together. This is arithmetic, not taste — the palette used across this site was chosen by running that check, not by looking at it.

Contrast against the surface#

A colour must be distinguishable from the background, not only from the other series. Pale yellow on white is invisible regardless of how well it separates from blue. Aim for at least 3:1 contrast against the chart surface for anything load-bearing; where a hue cannot reach it, compensate with visible direct labels or a table view.

This is also why a dark theme needs its own palette steps rather than an automatic inversion. The same hue at the same lightness does not work on both surfaces.

Grey is the most useful colour in the palette#

The strongest technique in practical charting: make everything grey except the thing you are talking about.

Twelve countries, one of which is the subject. Draw eleven in a light grey and one in a saturated colour. The reader's eye goes exactly where you intend, the context is still visible, and you have used one colour rather than twelve.

Legends and direct labels#

A legend forces the reader to bounce between the key and the chart, holding a colour-to-name mapping in working memory. Direct labels at the end of each line remove that work entirely.

The working compromise: a legend is always present for two or more series — it is the accessible fallback — and up to about four series are also labelled directly. Past that, direct labels collide and the legend carries it alone.

Redundant encoding#

When it matters, encode the same information twice: colour and position, colour and shape, colour and a texture fill. Redundancy costs a little visual complexity and buys robustness — for colour-blind readers, for greyscale printing, for a projector that eats the blues, and for the screenshot someone pastes into a document at 40% size.