Key takeaways
- Failing pairs are fixed by changing lightness, not hue.
- Light accent colors need dark text.
- Retest after every change.
This is a worked example with an imaginary brand, not a real client. It shows the routine we recommend for fixing contrast problems.
The starting palette
Our imaginary brand uses a sunny yellow (#FAE520) for buttons and a soft gray (#A0A7B4) for secondary text, both on white backgrounds.
Step 1: test the pairs
Using the contrast checker: white text on the yellow buttons scores 1.29:1, and the gray text on white scores 2.42:1. Both fail the 4.5:1 target for body text.
Step 2: fix the button
The yellow is bright, so it needs dark text rather than white. Switching the button text to near-black (#0C0C14) gives 15.11:1, which passes AAA. The brand color stays exactly the same.
Step 3: fix the gray text
The accessible color finder keeps the hue and darkens the gray until it passes. It suggests #6B7588 at 4.64:1 on white.
Step 4: retest and record
Test the new pairs together in the contrast matrix, check hover and disabled states, and record the approved pairs in the design system.
The outcome
| Pair | Before | After |
|---|---|---|
| Button text on yellow | 1.29:1 (white) | 15.11:1 (near-black) |
| Secondary text on white | 2.42:1 | 4.64:1 |
Lessons
- Fix failures by moving lightness, keeping the brand hue.
- Bright accents need dark text.
- Document the approved pairs so the fix lasts.