splicedesign / culture / practice
← All guides

Accessibility · 13 min read

How to check contrast properly

Beyond pass and fail: what WCAG contrast actually measures, why 4.5:1 exists, how to fix a failing pair without losing your palette, and which situations the formula cannot judge.

Accessibility / Colour 13 min read · approximately 2 min at 220 wpm

What the number actually measures

Contrast ratio compares the relative luminance of two colours — how much light each one emits or appears to emit — on a scale from 1:1 to 21:1. Each sRGB channel is linearised to undo gamma encoding, then weighted 0.2126 for red, 0.7152 for green and 0.0722 for blue, because human vision is far more sensitive to green wavelengths than to blue.

The result is (L1 + 0.05) / (L2 + 0.05), where L1 is the lighter of the two. This is why two hexadecimal colours that look far apart to you can score similarly: the maths cares about perceived light output, not about how far apart the hex digits are.

Where the thresholds come from

WCAG 2.1 sets 4.5:1 for normal text (SC 1.4.3), 3:1 for large text — 18.66px bold or 24px regular and above — and 3:1 for interface elements and meaningful graphics (SC 1.4.11). Level AAA asks for 7:1, or 4.5:1 for large text. These figures were derived from legibility research and adjusted to stay achievable for real designs rather than to reflect a perfect visual system.

Treat them as a floor, not a target. Text at exactly 4.5:1 is accessible by definition and still tiring to read at length; comfortable body copy usually lands well above 7:1.

  • Body text: aim above 7:1 wherever the palette allows it.
  • Secondary text, captions and placeholders: still need 4.5:1 — “secondary” is not an exemption.
  • Borders, icons and focus rings that carry meaning: 3:1 against what sits behind them.
  • Disabled states are the common exception, but the less you rely on it, the better.

Fixing a failing pair without losing the palette

When a pair fails, change lightness rather than hue. Keeping hue and saturation constant and moving the L value preserves the character of the colour — a muted terracotta stays a muted terracotta, just darker — whereas picking a new hue means redesigning the palette.

On dark backgrounds, remember that the relationship is not symmetric: many mid-tone colours pass as backgrounds but fail as text, simply because there is not enough distance left. If neither end of the pair can move, introduce a third element — a darker panel behind the text — instead of forcing the two existing colours to work.

Run any pair through the Contrast Checker and read not only the verdict but the suggested fix — it scans lightness in small steps so the correction stays as close as possible to your original choice.

What the formula cannot judge

The maths assumes two flat, known colours. It cannot evaluate text over photography, gradients, video or semi-transparent overlays, because the background value changes pixel by pixel. In those cases either guarantee a single effective background — a solid strip, scrim or card behind the text — or treat every possible frame as a separate pair to check.

It also says nothing about the things that make text comfortable: size, weight, line length, tracking, chromatic aberration in pure blue-on-black combinations, and individual vision differences such as astigmatism, which makes certain blue and violet text notably harder to read even at a passing ratio.

Finally, a passing ratio does not mean a readable design. Confirm the result in context, on a real device, at real brightness — and if an accessible choice genuinely conflicts with a hard brand constraint, document the trade-off rather than quietly shipping it.

If you disagree

Every standard referenced here is public.

If you think a recommendation is wrong, email hello@splicewb.top with the specific claim and what you observed. Corrections are published with a note explaining what changed — see the editorial policy.

Try the tools →

Continue reading