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
| Colour A | Colour B | Contrast | Normal text AA |
|---|---|---|---|
| #ffffff | #111827 | 17.74:1 | Yes |
| #ffffff | #2563eb | 5.169:1 | Yes |
| #ffffff | #93c5fd | 1.803:1 | No |
| #111827 | #2563eb | 3.432:1 | No |
| #111827 | #93c5fd | 9.838:1 | Yes |
| #2563eb | #93c5fd | 2.866:1 | No |
| Foreground | Background | Contrast | Chosen threshold |
|---|---|---|---|
| text | surface | 17.928:1 | 4.5:1 |
| text | mutedSurface | 16.444:1 | 4.5:1 |
| onAccent | accent | 5.169:1 | 4.5:1 |
| onAccent | accentHover | 7.046:1 | 4.5:1 |
| link | surface | 5.169:1 | 4.5:1 |
| border | surface | 4.542:1 | 3:1 |
| focus | surface | 5.985:1 | 3: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.
| Role | Check in context |
|---|---|
| Body text | Text against every surface on which it can appear. |
| Button | Label against fill, plus necessary identifying cues against surrounding colours. |
| Form error | Text and meaningful symbols, with a message that does not depend on red alone. |
| Focus | The 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>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
- Save the colours and opaque canvas used.
- State the intended text size or component role.
- Export role names rather than only a list of hex values.
- 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 and method
Source content checked . This is not a claim of external expert review.