Skip to article
Legibly

Guide

Check a brand palette for contrast

Turn a pairwise colour comparison into practical text, surface and control roles.

Published

A palette cannot be accessible independently of how its colours are used. Compare pairs, then decide which combinations can support text, surfaces, controls and interaction states.

Start with roles, not colour names

This original sample contains white, dark text, a blue accent and a pale blue surface. The shared contrast engine generates the comparison. It supports choosing roles; it does not certify the palette.

A synthetic blue palette in actual combinations

All six pairs from four opaque colours
Colour AColour BContrastNormal text AA
#ffffff#11182717.74:1Yes
#ffffff#2563eb5.169:1Yes
#ffffff#93c5fd1.803:1No
#111827#2563eb3.432:1No
#111827#93c5fd9.838:1Yes
#2563eb#93c5fd2.866:1No
Example roles and states
ForegroundBackgroundContrastChosen threshold
textsurface17.928:14.5:1
textmutedSurface16.444:14.5:1
onAccentaccent5.169:14.5:1
onAccentaccentHover7.046:14.5:1
linksurface5.169:14.5:1
bordersurface4.542:13:1
focussurface5.985:13:1

Two colours working for normal text does not make an entire palette accessible. Choose a use, apply its threshold, and check focus, hover and error states in context.

RoleCheck in context
Body textText against every surface on which it can appear.
ButtonLabel against fill, plus necessary identifying cues against surrounding colours.
Form errorText and meaningful symbols, with a message that does not depend on red alone.
FocusThe visible indicator in its real state and against adjacent colours.

Try a small component

<button class="primary">Save changes</button>
<p class="error">Enter your email address.</p>
Sample markup: check colour roles in both ordinary and error states.

Check the button label as text. Then identify which visual cues are needed to find and operate the button. Not every decorative edge has its own requirement, while necessary visual information can fall under non-text contrast.

Sources: W3C: Understanding Contrast (Minimum), WCAG 2.2 SC 1.4.3 · W3C: Understanding Non-text Contrast, SC 1.4.11

Record allowed combinations

  1. Save the colours and opaque canvas used.
  2. State the intended text size or component role.
  3. Export role names rather than only a list of hex values.
  4. Recheck combinations when the design changes.

Use words, shape or another cue alongside meaningful colour. A satisfactory ratio does not make colour sufficient as the only way of conveying information.

Sources: W3C: Understanding Use of Color, SC 1.4.1

Sources and method

Source content checked . This is not a claim of external expert review.

  1. W3C: Understanding Contrast (Minimum), WCAG 2.2 SC 1.4.3
  2. W3C: Understanding Non-text Contrast, SC 1.4.11
  3. W3C: Understanding Use of Color, SC 1.4.1