$ cd ..

$ open /brown-bag/color  色彩  brown bag .01

Color and data visualization

A free lesson on using color theory in real work: charts, dashboards, screens. It comes from my thirty years in product design. You mix the color, break the chart and fix it yourself.

Nine stations, about twenty minutes. Each one asks you to do something before it tells you anything. The switch at the top changes every color in the lesson to what another kind of vision sees. Leave it on for a while.

0:49 Under a minute on what you're about to do. Narrated by Helen, my AI assistant. Every color and number in it was computed by the lesson's own code.

The stations are things you operate, so they need JavaScript. Without it, here is what each one asks and what it is for.

01 · Light adds. Ink subtracts.

Before you touch anything, guess. Red light plus green light makes what?

A screen starts dark and adds light, so every lamp you switch on moves it toward white. Paper starts white and ink takes light away, so every ink moves it toward black. Same word, opposite machines. A palette chosen on paper isn't a palette for a screen.

02 · Hue, tint, tone, shade

Match the swatch. White makes a tint, grey makes a tone, black makes a shade. The number is how far off you are.

Four words cover most of what a palette does. A hue is the pure color. Add white and it's a tint, grey and it's a tone, black and it's a shade. Remember the walk from shade to tint. Station six uses it.

03 · The wheel, and where it stops helping

Turn the wheel and try all three harmonies. Each time, the audit checks whether those colors could label a chart.

A harmony tells you which hues sit well together. It says nothing about whether a reader can tell them apart. The audit passed some of yours and failed others, and the wheel couldn't have told you which. That's where it stops helping.

04 · What other people see

What number is in the dots? Answer first. Then set the vision switch to deuteranopia and look again.

The number didn't fade. It left. Red against green was the only thing carrying it, and for some of your readers that carries nothing. Red-green deficiency is the common kind: about 1 in 12 men and 1 in 200 women of Northern European ancestry. The switch shows the strongest form of each type. Most people have a milder one.

05 · Twelve colors, one question

Find the team I name. You're on the clock.

The twelve colors did nothing for you. Length had already ranked the bars, so you read labels. One color, spent on the one bar that mattered, did the whole job. Color isn't decoration. It's a pointer, and it only points when it's rare.

06 · Three kinds of data, three kinds of palette

Give each variable the palette that fits it. A wrong pick still draws, and shows you what it hides.

Categories get distinct hues, because nothing ranks them. An amount gets one hue walked from dark to light. An amount with a real middle, like change from zero, gets two hues that meet there. The wrong palette invents an order or hides one.

07 · How many colors is too many

Add series until the audit fails. Then turn on dashes and labels.

I used to say keep it under ten. The measurement is harsher than the rule. Hues spaced evenly around the wheel gave out at five here, in grayscale first and then without red-green vision. Past that point color can't carry identity alone. Give each series a second signal: a dash, a marker, a label at the end of the line.

08 · Your palette, audited

Paste the colors from a chart you shipped. Hex codes, separated by commas or new lines.

This is the engine from chart-color-audit, a tool I wrote so a build fails when a color change breaks a chart. The command under your verdict runs the same check on your machine. A palette that passes today can fail after one well-meant tweak, so check it where the tweak lands.

09 · Fix this dashboard

Five series, and the audit fails it. Change colors, add shape, or both, until it passes.

That was the job. Measure, change one thing, measure again. Nobody gets a palette right by looking at it, me included.


Ten principles

  1. Don't put brand colors on data. A brand palette was chosen to look like the company. Nobody chose it to be told apart.
  2. Don't use color you don't need. If position or length already says it, color is noise.
  3. Pair color with shape. Dashes, markers and direct labels still work when the color is gone.
  4. Match the palette to the data. Categorical, sequential or diverging. The data decides, not taste.
  5. Be consistent across charts. One series, one color, on every chart it appears in.
  6. Give color a meaning, and keep it. The highlight means "look here". Spend it once.
  7. Always test for color blindness. You saw why.
  8. Choose the colors yourself. A charting library's defaults were chosen for no chart in particular. Somebody has to pick, and it should be whoever is answerable for the reading.
  9. Keep the series count low. Under ten was my old rule. Fewer, when color is all that separates them.
  10. Know the conclusion before you color it. Every chart makes a point. If you can't say what the reader should do next, color won't rescue it.

Tools and reading

Where the facts come from

  • Red-green color vision defects are the most common form. Among populations with Northern European ancestry they occur in about 1 in 12 males and 1 in 200 females. Blue-yellow defects occur in fewer than 1 in 10,000 people. MedlinePlus Genetics, National Library of Medicine
  • Deuteranomaly is the most common type of red-green deficiency and is mild. Protanopia and deuteranopia leave someone unable to tell red from green at all. National Eye Institute
  • The vision switch applies the simulation matrices published by Machado, Oliveira and Fernandes in 2009, at full severity, in linear RGB. Machado, Oliveira and Fernandes, 2009
  • Graphical objects need a contrast ratio of at least 3:1 against adjacent colors. The W3C gives a graph whose lines each reach 3:1 against the background as an example. W3C, Understanding Success Criterion 1.4.11

← back to conscious_shell