Colour Accessibility in Design: Contrast, Legibility and Standards

Legibility is a measurable property, not a matter of taste

Most design arguments about colour end in preference. Accessibility is the part that does not have to. Whether a given pair of colours provides enough separation for text to be read is a calculation with a defined formula, published thresholds and free tools that will give you an answer in a second. That makes it one of the few places in visual design where a team can settle a disagreement with a number.

The number in question is the contrast ratio: a comparison of the relative luminance of two colours, expressed as a ratio between 1:1 (identical) and 21:1 (pure black against pure white). This article covers how it is calculated, what the actual required thresholds are, where the model is known to be weak, and how to build a palette that passes without becoming visually inert.

How contrast ratio is calculated

The formula defined by the Web Content Accessibility Guidelines works in three steps. First, each of the red, green and blue channel values is normalised to a 0-to-1 range and linearised, undoing the gamma encoding that display values carry. Second, the linearised channels are combined into a single relative luminance value using the weights 0.2126 for red, 0.7152 for green and 0.0722 for blue — weights that reflect how strongly each primary contributes to perceived brightness. Third, the ratio is computed as the lighter luminance plus 0.05, divided by the darker luminance plus 0.05.

Two things follow from the weights, and they explain a lot of real-world surprises.

  • Green dominates luminance. A saturated green is far brighter in luminance terms than a saturated blue of the same nominal intensity. Green text on white almost always fails; the same green on black passes comfortably.
  • Blue contributes very little. A pure blue is luminance-dark even when it looks vivid, which is why blue on black is a common failure and blue on white a common pass.
  • Hue is otherwise ignored. The formula measures only luminance. Two colours can have wildly different hues and still return a ratio near 1:1, meaning text is effectively invisible despite being obviously “different colours”.
  • The 0.05 offset models flare. It accounts for ambient light scattering on the screen surface, and it is why the maximum possible ratio is 21:1 rather than infinite.

The thresholds you actually need

Under WCAG 2.1 and 2.2, the relevant success criteria and their thresholds are as follows.

Text contrast

  • 4.5:1 — normal text, Level AA. Success criterion 1.4.3. This is the working baseline for body copy in almost every legal and procurement context.
  • 3:1 — large text, Level AA. Large text is defined as at least 18 point, or 14 point when bold. In CSS terms that is commonly taken as 24px, or 18.66px bold, though the specification is written in points.
  • 7:1 — normal text, Level AAA. Success criterion 1.4.6. Appropriate for text-heavy reading applications and for audiences with known low vision.
  • 4.5:1 — large text, Level AAA. The enhanced threshold for headings and display sizes.

Non-text contrast

  • 3:1 — user interface components and graphical objects, Level AA. Success criterion 1.4.11. This covers the visual boundary of form inputs, checkboxes, toggles and buttons, the focus indicator, and the parts of an icon or chart needed to understand it. It is the criterion most often missed, because teams check their text and stop.

Exemptions worth knowing

  • Disabled controls. Inactive components are exempt from the contrast requirements. This is not a licence to make them illegibly faint — users still need to see what exists.
  • Logotypes. Text that is part of a logo or brand name has no minimum contrast requirement.
  • Incidental text. Text in a decorative image, or text that is not visible to anyone, is exempt.
  • Pure decoration. Graphics that convey no information have no non-text contrast requirement.

Where the model is known to be imperfect

The WCAG 2.x contrast formula is a useful, testable approximation, and it is also acknowledged — including by the people working on its successor — to misjudge certain cases. Being honest about this makes for better decisions than treating the number as sacred.

  • Dark mode is systematically mispredicted. The formula tends to be optimistic about light text on dark grounds. A pairing that passes at 4.5:1 on a dark interface often reads worse than the equivalent light-mode pairing, partly because of halation, where bright glyphs bleed into the dark surround, an effect particularly pronounced for people with astigmatism.
  • Font weight and size are barely modelled. A hairline 300-weight face at 14px and a 700-weight face at the same size return the same ratio, but they do not read the same. The large-text allowance is the only concession the 2.x model makes.
  • Certain hue pairs behave oddly. Saturated blues and some oranges are known cases where the computed ratio and perceived legibility diverge.
  • A successor exists. APCA, the Advanced Perceptual Contrast Algorithm, is being developed for WCAG 3 and models polarity, weight and size explicitly, producing a signed lightness-contrast value rather than a symmetric ratio. It is worth understanding, but WCAG 2 AA remains the conformance target that regulations and contracts actually reference.

The practical stance: meet WCAG 2 thresholds because that is what conformance requires, and then use judgement, particularly in dark mode, where the number says you have more room than your eyes agree with.

Colour is never the only signal

Contrast is one criterion; use of colour is another. Success criterion 1.4.1 requires that colour is not the sole means of conveying information, indicating an action, prompting a response or distinguishing a visual element. This is a separate obligation from contrast, and passing one says nothing about the other.

  • Form errors. A red border alone fails. A red border plus an icon plus a text message associated with the field passes and is more useful for everyone.
  • Links in body text. A link distinguished only by colour fails unless the contrast between link and surrounding text is at least 3:1 and a non-colour cue appears on hover and focus. Underlining is simpler and more reliable.
  • Charts and maps. Add direct labels, patterns, line styles or varied marker shapes. A legend that maps colour to category and nothing else is a barrier.
  • Status systems. Red-amber-green with no icon or label is the archetypal failure. Adding a shape — circle, triangle, square — fixes it at almost no cost.
  • Required fields. A red asterisk is a colour cue plus a symbol, which helps, but the symbol still needs explaining in text.

Adjacent requirements that involve colour

  • Focus visibility. Criterion 2.4.7 requires a visible focus indicator, and 1.4.11 means it must reach 3:1 against adjacent colours. WCAG 2.2 added 2.4.11, Focus Not Obscured, and 2.4.13, Focus Appearance, which sets out minimum area and contrast expectations for the indicator itself.
  • Text resizing and reflow. Criteria 1.4.4 and 1.4.10 require that content works at 200 per cent text size and reflows at narrow widths. Palettes that rely on tight text-over-image placement often break here.
  • Text spacing. Criterion 1.4.12 requires content to survive user-applied increases to line height, paragraph spacing, letter spacing and word spacing.
  • Non-text content. Where colour carries meaning in an image, the alternative text must carry that meaning too.

Building a palette that passes by construction

Retrofitting accessibility onto a finished palette is painful. Designing for it is not, provided the palette is built in a perceptually sensible way from the start.

  • Work in a perceptual space. Building ramps in a space where the lightness axis is perceptually uniform — LCH or the newer OKLCH — means that a step in lightness is a comparable step visually across every hue. Ramps built by mixing towards white in sRGB give inconsistent results between hues.
  • Fix the ramp steps, then test once. Define, say, eleven lightness stops per hue and record which stops pass 4.5:1 and 3:1 against your background stops. That table becomes a rule the team can apply without recalculating.
  • Choose text colours before brand colours. A brand accent rarely makes a good body-text colour. Decide the text and background pair first, then find an accent that reaches 3:1 for interface use.
  • Never place text on an unconstrained image. Use a scrim, a solid panel or a gradient overlay with a tested minimum, because the image behind will change.
  • Test both themes independently. A dark theme is not an inversion of a light one. Ratios, and perceived weight, change.
  • Automate the check. Contrast linting in the design system and in continuous integration catches regressions that manual review will not. Automated tools find only a minority of accessibility issues overall, but contrast is precisely the category they find reliably.

The pleasant surprise, once a team works this way, is that constraint improves the output. Palettes forced onto a disciplined lightness ramp look more coherent, hierarchies get clearer because emphasis has to be earned with real separation rather than a slightly different tint, and the interface stops depending on the viewer having excellent eyes in good lighting. The threshold is a floor, not a ceiling — but a floor that has held up a great deal of good design.