Designing Colour Palettes for Accessibility.doc

Designing Colour Palettes for Accessibility

5 August 2026 Harry Chapman

Human eyes and RGB hex codes disagree wildly on brightness. I built a browser tool that generates 3 to 16 distinct chart colours and nudges their lightness to hit WCAG contrast targets.

Computer monitors think pure yellow (#FFFF00) and pure blue (#0000FF) are equally bright. In HSL, both sit at 100% saturation and 50% lightness.

Human eyeballs strongly disagree. Put #FFFF00 text on a white background and it vanishes into a faint lemon haze, with a contrast ratio of 1.07:1. Put #0000FF on the same white background and it hits 8.59:1. That happens because human cone cells are wildly sensitive to green light, moderately sensitive to red, and comparatively terrible at seeing blue.

Whenever you build a dashboard or a multi-series chart, you run head-first into that biology. You need eight or twelve colours that look obviously different from one another, don’t look like a circus tent, and still pass WCAG contrast targets against your background so people can actually read the labels. Doing that by hand in a contrast checker is a slow game of whack-a-mole: fix the contrast on your orange, and now it looks identical to your brown.

I built the Accessible Palette Generator to stop doing that maths manually.

How WCAG actually measures contrast

Instead of trusting HSL lightness, WCAG 2.1 calculates relative luminance (L) from linearised sRGB channels:

L = 0.2126 × R + 0.7152 × G + 0.0722 × B

Notice that green carries more than 71% of the perceived brightness, red carries 21%, and blue gets a measly 7%. Once you have the luminance of your swatch and your background (L₁ for the lighter colour, L₂ for the darker), the contrast ratio is:

Contrast = (L₁ + 0.05) / (L₂ + 0.05)

Normal body text needs 4.5:1 for WCAG AA and 7:1 for AAA. Large text and graphical chart marks need 3:1.

Solving separation and contrast at the same time

When you ask the generator for between three and sixteen colours, it first spaces the hues evenly across your chosen wheel range and staggers saturation and lightness so neighbouring bars or lines don’t blend together for readers with colour-vision deficiencies.

Then, if you switch on AA or AAA enforcement, it does not just slap a red “FAIL” badge on the offending yellow and wish you luck. It holds the hue and saturation steady and walks the lightness channel up or down until the relative luminance equation clears the target ratio against your background.

You can also paste in an existing comma-separated list of hex codes from a brand guide or a Power BI theme. The tool normalises valid codes, strips duplicates, flags malformed strings instead of silently dropping them, and shows you immediately which three brand colours are doing crimes against legibility.

Click any swatch to copy its hex code, flip the background between light and dark, and watch the whole grid recalculate on the fly.

Open the generator or view the source.

Page 1 445 words 2 min Work