Guides
Color contrast that survives real screens
How to check contrast ratios, move between HEX and RGB, and build palettes that still read when the room lighting is unkind.
Nico Vale · Jun 9, 2026 · 8 min read
A palette can look refined in a mock and fail in a product. The usual failure is not a loud accent. It is body text in a gray that seemed elegant on a calibrated laptop, sitting on a near-white background, in a room with sun on the screen.
Contrast is the most mechanical part of visual accessibility and the one you can measure. This guide covers ratios, HEX versus RGB, and how to check combinations before they harden into design tokens.
What a contrast ratio measures
Contrast ratio compares the relative luminance of two colors. The number is a relationship, not a vibe. WCAG 2.x sets thresholds that are still the working language of audits and design systems:
- 4.5:1 for normal text (roughly under 18pt / 14pt bold, depending on the exact criteria you follow)
- 3:1 for large text and for many UI component boundaries
- Stronger targets exist for enhanced criteria; treat them as product goals, not optional fluff
You do not need to memorize the luminance formula. You need a habit of checking pairs before you lock tokens.
HEX, RGB, and why conversion matters
Designers often think in HEX; engineers sometimes get RGB or HSL from a token pipeline. Conversion mistakes create “almost the same” colors that fail audits. Keep a local converter next to the contrast checker so you are comparing the same pair the browser will paint.
UtilInUse’s contrast checker and color picker are meant for that loop: pick two values, read the ratio, adjust, repeat.
Body text versus chrome
Primary body copy needs the stricter bar. Icons, focus rings, and chart lines often fail quietly because they look “fine” on your display. Test:
- Body text on page background
- Muted text on cards
- Links against their surrounding paragraph
- Button labels on filled buttons
- Placeholder text in inputs (placeholders are not a substitute for labels)
Dark mode is not automatic accessibility
Inverting a light palette rarely preserves ratios. Dark surfaces need their own muted and accent steps. Check both themes if you ship both.
A practical review pass
- List the text styles that appear most often
- Check each against its actual background token
- Fix failures by darkening text or lightening surfaces — not by shrinking type
- Re-check hover and disabled states
- Spot-check on a phone outdoors if you can
Accessible color is mostly discipline. Measure early, and you will spend less time arguing about “subtle” gray later.