Slide design·6 min read
Choropleth Color Schemes: Three Numbers Before a Palette
A color scheme is not a matter of taste. It fails in three specific, measurable ways — a sequential ramp whose lightness goes up and then down again, a set of theme swatches with no order to them, and a diverging ramp whose two arms are not equally heavy. Each one can be caught with a calculator in about a minute, before the deck ever reaches a projector.

Three tests, and only one of them is about color
Most advice about map palettes is aesthetic: pick a nice blue, avoid red and green, keep it subtle. None of it tells you whether the file in front of you is broken.
Three tests can. A sequential ramp has to be monotone in lightness and step by roughly equal amounts. A diverging ramp has to give both arms the same lightness at the same distance from the center. A qualitative set has to keep every swatch inside a narrow lightness band, so that no category looks more important than another just because it was drawn darker.
All three are numbers you can compute from the hex values already in your file. What follows is what failure looks like when measured, and the short script that fixes it.
The number is L*, and your eye is a bad instrument for it
Lightness in the CIE Lab sense runs from 0 (black) to 100 (white). It is not the brightness slider, and it is not "how bright this looks to me," because hue drags perceived lightness around with it. Pure red #FF0000 sits at L\ 53.2; pure blue #0000FF sits at L\ 32.3. Both are fully saturated, both are "bright" in the ordinary sense, and they are more than twenty points apart in the one dimension that survives a black-and-white print.
That is the reason to compute instead of eyeball: the failure is large, and it is invisible until the room lights come up. Here is the measurement, with no dependencies beyond the standard library:
def lin(c):
c /= 255
return c / 12.92 if c <= 0.04045 else ((c + 0.055) / 1.055) ** 2.4
def lightness(hex_code):
r, g, b = (lin(int(hex_code[i:i + 2], 16)) for i in (1, 3, 5))
y = 0.2126729 * r + 0.7151522 * g + 0.0721750 * b
fy = y ** (1 / 3) if y > 216 / 24389 else (841 / 108) * y + 4 / 29
return 116 * fy - 16
for h in ("#D7191C", "#FF0000", "#0000FF"):
print(h, round(lightness(h), 1))
#D7191C 45.9
#FF0000 53.2
#0000FF 32.3
Feed it all five swatches of a ramp and you have the test. Adjacent differences should be close to each other and, for a sequential ramp, all the same sign.
Failure one: the ramp turns around in the middle
Take the five-class red-to-green ramp most charting tools ship. It reads as a smooth progression of hue, which is why people trust it.
| Class | Hex | L\* | Step |
|---|---|---|---|
| 1 | #D7191C | 45.9 | — |
| 2 | #FDAE61 | 77.3 | +31.3 |
| 3 | #FFFFBF | 98.6 | +21.4 |
| 4 | #A6D96A | 81.2 | −17.5 |
| 5 | #1A9641 | 54.5 | −26.7 |
The sign flips at class 3. Lightness climbs for two classes, peaks in the middle, then falls. On a slide the middle class becomes the brightest object on the page: it reads as the maximum, and it is the median. A viewer who skips the legend walks away with the shape of the ramp instead of the shape of the data, and the map is now misleading in a way that looks perfectly professional.
Rainbow ramps are popular because hue gives you seven categories for free. Hue is also the dimension that collapses hardest under color vision deficiency and vanishes entirely in a photocopy.
Failure two: six theme colors wearing a sequence as a disguise
The second failure is more common, because it starts from convenience: the deck already has accent colors, so those become the classes.
| Swatch | Hex | L\* |
|---|---|---|
| Accent 1 | #4472C4 | 48.6 |
| Accent 2 | #ED7D31 | 64.1 |
| Accent 3 | #A5A5A5 | 67.7 |
| Accent 4 | #FFC000 | 81.3 |
| Accent 5 | #5B9BD5 | 62.1 |
| Accent 6 | #70AD47 | 64.8 |
Read the right column as a sequence: 48.6, 64.1, 67.7, 81.3, 62.1, 64.8. Four of the six land between 62.1 and 67.7 — a spread of 5.6 points, on a scale where a usable sequential step is about 13. Convert to grayscale and those four classes become the same gray. This is why a colorful map so often turns to mud in a handout: the swatches were chosen to differ from each other, not to differ in value.
A qualitative palette has the opposite requirement and looks almost identical in a hex list. There you want a flat lightness band — every swatch within six or seven points — so no category wins by being dark. The Office accents above are, by accident, a passable qualitative set and a bad sequential one. Same six values, opposite verdicts, and the only thing separating them is what the fill means.

Failure three: a diverging ramp with one arm heavier than the other
Diverging ramps fail differently and they fail silently, because the two halves look symmetric. Build one the obvious way — blend white toward red for the negative side and white toward blue for the positive side, at the same percentages — and measure both arms:
| Stop | Negative arm | L\* | Positive arm | L\* | Gap |
|---|---|---|---|---|---|
| 25% | #EFBFBF | 81.5 | #BFBFEF | 78.8 | 2.7 |
| 50% | #E08080 | 64.0 | #8080E0 | 57.5 | 6.5 |
| 75% | #D04040 | 48.8 | #4040D0 | 36.6 | 12.2 |
| 100% | #C00000 | 39.9 | #0000C0 | 23.0 | 16.9 |
The blend was symmetric in code and asymmetric in output, because sRGB luminance is not distributed evenly across hue: red carries 0.2126 of it, blue carries 0.0722. Every blue mix matching a red mix by percentage comes out darker. At the far stop the arms differ by almost seventeen L\* points, more than a full class step.
For real data, this compounds. Take county land area, centered on the national median of 1,561,102,696 square meters — about 603 square miles. Split there and 1,617 counties fall below and 1,617 above, as balanced as data gets. Then count the extremes: 427 counties are less than half the median, 507 are more than double it. The positive tail is already 19 percent heavier, and a darker blue arm turns that into a visible slant that the numbers do not support.
Fitting the arms so a step means the same on both sides
The fix is to specify lightness instead of color: pick 96 at the center, 82 and 68 on each side, then solve for a color at that lightness along each hue.
def lin(c):
c /= 255
return c / 12.92 if c <= 0.04045 else ((c + 0.055) / 1.055) ** 2.4
def unlin(v):
v = min(1.0, max(0.0, v))
return round((v * 12.92 if v <= 0.0031308 else 1.055 * v ** (1 / 2.4) - 0.055) * 255)
def to_lab(h):
r, g, b = (lin(int(h[i:i + 2], 16)) for i in (1, 3, 5))
x = 0.4124564 * r + 0.3575761 * g + 0.1804375 * b
y = 0.2126729 * r + 0.7151522 * g + 0.0721750 * b
z = 0.0193339 * r + 0.1191920 * g + 0.9503041 * b
f = lambda t: t ** (1 / 3) if t > 216 / 24389 else (841 / 108) * t + 4 / 29
fx, fy, fz = f(x / 0.95047), f(y), f(z / 1.08883)
return 116 * fy - 16, 500 * (fx - fy), 200 * (fy - fz)
def from_lab(L, a, b):
fy = (L + 16) / 116
fx, fz = fy + a / 500, fy - b / 200
g = lambda t: t ** 3 if t ** 3 > 216 / 24389 else (108 / 841) * (t - 4 / 29)
X, Y, Z = g(fx) * 0.95047, g(fy), g(fz) * 1.08883
return "#%02X%02X%02X" % (
unlin(X * 3.2404542 - Y * 1.5371385 - Z * 0.4985314),
unlin(-X * 0.9692660 + Y * 1.8760108 + Z * 0.0415560),
unlin(X * 0.0556434 - Y * 0.2040259 + Z * 1.0572252))
def arm(accent, targets):
L0, a0, b0 = to_lab(accent)
return [from_lab(t, a0 * (100 - t) / (100 - L0), b0 * (100 - t) / (100 - L0))
for t in targets]
print(arm("#B2182B", [82, 68]), arm("#2166AC", [82, 68]))
['#F2C0BB', '#E2908A'] ['#C1CCE5', '#91A6D1']
| Class | Hex | L\* | Relative luminance |
|---|---|---|---|
| Well below | #F2C0BB | 81.9 | 0.6016 |
| Below | #E2908A | 68.0 | 0.3795 |
| At the median | #F3F3F3 | 95.8 | 0.8963 |
| Above | #C1CCE5 | 81.9 | 0.6018 |
| Well above | #91A6D1 | 67.9 | 0.3790 |
Sixty-eight against 67.9, and luminance matching to four decimals. What is not matched is chroma — 19.5 against 13.7 at the first step — and that is the right trade: chroma is a saturation preference, lightness is what the eye reads as magnitude. Hand-tune either hue afterward as long as the L\* column stays put.
The good news: the cheap sequential ramp already works
Not everything needs fixing. Blend one accent toward white in sRGB at 20, 40, 60, 80 and 100 percent, and measure:
#D2DCE4— L\* 87.2#A5B8C9— L\* 73.9#7995AF— L\* 60.5#4C7194— L\* 46.3#1F4E79— L\* 32.1
Steps of −13.4, −13.4, −14.2, −14.2. Monotone, and even to within eight-tenths of a point, with no color science involved. If your ramp has one hue and no midpoint, the naive blend is fine; spend the effort elsewhere. Measurement earns its keep exactly when a ramp has more than one hue or two directions — which is most of the ones that go wrong.
A sequential map does not need a lightest class at all. Dropping the first swatch and starting at L\* 74 buys four classes with visible separation instead of five with one that disappears against a white slide.
Typing the hex, and stopping the theme from taking it back
Once the values are settled, put them in as values. Select the shapes, then Shape Format → Shape Fill → More Fill Colors → Custom, and type the six digits into the Hex box. On a Mac it is the Format pane → Fill → Color → Other Color, then the sliders tab with its hex field. Both routes write an absolute RGB value into the file, and both are the last step of building the choropleth itself.
That detail matters more than it sounds. A fill picked from a theme swatch is stored as a pointer to the theme color, not as a value — the pointer resolves against whatever theme is active. Switch Design → Themes, or paste the slide into a deck built on another theme, and the pointer resolves to something new while a typed value does not move. This is how a map ends up looking right in the file it was built in and wrong the moment it is merged into someone else's template.
Two habits catch it: change the theme once after filling and see whether the map shifts, and hand off finished maps as shapes with absolute fills — recoloring them later is the easy part. A county map of 3,235 pre-shaped areas arrives that way, and so does the fifty-state version when county detail is more than the slide needs.

How many classes should a choropleth have?
Is a red-to-green ramp ever acceptable?
Can I check a palette without writing code?
Why did my fills change color in another deck?
Start from shapes that hold a fill
3,235 county shapes, each one fillable on its own and stored as an absolute color, so the palette you compute is the palette the reader sees. $9.99, one-time download.
See the county mapQuestions
How many classes should a choropleth have?
Is a red-to-green ramp ever acceptable?
Can I check a palette without writing code?
Why did my fills change color in another deck?
Written in-house. Boundary counts are checked against the published files, and every figure on this page can be reproduced from the source named in it.