Key takeaways
- Aim for 4.5:1 for body text and 3:1 for large text and UI components.
- Never use color as the only way to convey meaning.
- Test every state, not just the default.
Accessible color makes your product usable for more people, in more conditions: bright sunlight, low-quality screens, aging eyes and color vision deficiency. This guide covers the essentials.
Why it matters
Many people have low vision or color blindness, and everyone struggles with poor contrast sometimes. Accessible color is also required or expected by many accessibility laws and procurement rules.
Contrast ratio basics
WCAG measures contrast as a ratio from 1:1 to 21:1. Level AA asks for 4.5:1 for normal text and 3:1 for large text. Level AAA asks for 7:1 and 4.5:1. Our post on how the ratio is calculated shows the math.
User interface components
Input borders, icons, focus rings and chart elements need at least 3:1 against their surroundings, even when they contain no text.
Color blindness
Roughly 1 in 12 men and 1 in 200 women have red-green color blindness. Do not rely on hue alone: add icons, labels or patterns, and test with the color blindness simulator. More in our design guide.
States and overlays
Check hover, focus, active, disabled and error colors. Text over images and gradients should be tested at its worst spot, and semi-transparent colors take on whatever is behind them.
A practical testing process
- List your text colors and backgrounds.
- Test them together in the contrast matrix.
- Fix failures with the accessible color finder.
- Check non-text elements and states.
- Record approved pairs in your design system.
A short checklist
- Body text passes 4.5:1.
- Large text and UI components pass 3:1.
- Meaning never depends on color alone.
- Links are distinguishable beyond color.
- Dark mode is tested separately.
Keep learning
See the step-by-step five-minute contrast check, or build a palette that is accessible from the start with this guide.