Guide
Fix low contrast without losing your brand colour
Lock the colour you need to keep, inspect a verified suggestion and test it in its intended role.
Published
Start with one colour pair rather than replacing the entire palette. Lock the colour that must remain, choose the real background and applicable contrast target, then adjust the other colour. Verify the result in the actual component.
A small, checkable change
This synthetic example uses grey text on white so the threshold is easy to inspect. Every suggested replacement is recalculated by the contrast engine before it is presented as meeting the target.
Verified alternatives, not approximate passes
| Before | Before contrast | Alternative | Verified contrast |
|---|---|---|---|
| #777777 | 4.4781:1 | #767676 | 4.5422:1 |
| #93c5fd | 1.8033:1 | #0472ee | 4.5193:1 |
The search holds HSL hue and saturation fixed and compares 2,049 lightness samples using Euclidean distance in linear sRGB. It is not a global perceptual optimum. Every rounded HEX candidate is checked again against the threshold.
Use the suggestion in context
- Select normal AA text and lock the white background.
- Inspect the unrounded ratio rather than judging only the colour swatch.
- Try the colour at the actual font size and weight.
- Check links, errors and keyboard-focus states that reuse it.
”Nearby” means nearby under the tool’s documented colour-distance method and bounded search. It is not a promise of the smallest perceived change for every viewer or the globally optimal colour.
Keep the brand colour in a suitable role
A pale brand colour that fails for small text on white may still work behind dark text or as decoration. Text and a thin component border do not need to share a colour. Evaluate the role instead of attaching a universal accessible label to a swatch.
Sources: W3C: Understanding Contrast (Minimum), WCAG 2.2 SC 1.4.3 · W3C: Understanding Non-text Contrast, SC 1.4.11
Transparency, gradients and images change the rendered background. A suggestion verified against one flat canvas must be checked again if that context changes.
Sources and method
Source content checked . This is not a claim of external expert review.