Design

Color Contrast in Web Design: The Complete Guide

7 min read

Color contrast is the single most common WCAG failure. Roughly 40% of issues we find on first scan are contrast-related. Here's how to get it right without making your site look like a hospital signage system.

WCAG colour-contrast thresholds Contrast ratios increase from low to high. Key thresholds: 3 to 1 for large text and UI components, 4.5 to 1 for normal text at Level AA, and 7 to 1 at Level AAA. Example: grey #9ca3af on white is about 2.8 to 1 and fails; grey #4b5563 on white is about 7 to 1 and passes. CONTRAST RATIO — WCAG THRESHOLDS 3:1 large / UI 4.5:1 AA 7:1 AAA Sample text✗ #9ca3af on white — 2.8:1 fails Sample text✓ #4b5563 on white — 7:1 passes AA
One shade darker is usually the whole fix: gray-400 → gray-600 clears AA for body text.

The ratios

  • Normal text: 4.5:1 against the background (WCAG AA).
  • Large text (≥18pt regular or ≥14pt bold): 3:1.
  • UI components (button borders, input outlines, focus rings): 3:1 against adjacent colors.
  • AAA bumps to 7:1 / 4.5:1 — required in some public-sector contracts.

Common traps

  • Light grey on white for placeholder text. Almost always fails.
  • Brand color buttons with white text — many brand greens and oranges fail at 4.5:1 unless darkened.
  • Disabled states are exempt from contrast rules, but only if the state is unambiguously communicated through other means.
  • Text on imagery: the contrast must be measured against the actual underlying pixels at the worst spot, not just the average.

Tools

  • WebAIM Contrast Checker — fastest single-pair check.
  • Stark (Figma plugin) — runs across an entire frame.
  • axe-core — analyzes computed styles + image fallbacks at scan time.

Design without sacrificing aesthetics

  1. Build a contrast-aware palette: each accent has at least one paired text color that hits 4.5:1.
  2. Use semitransparent overlays on hero images (e.g. rgba(0,0,0,.4)) before placing text.
  3. For SaaS dashboards: keep secondary text at 4.5:1 minimum, not the trendy 3:1 grey.
  4. Test against your dark mode if you have one — most contrast bugs hide there.

AccessProof flags every contrast violation with the exact node, the computed ratio, and the WCAG level it fails. Fix it and re-scan to confirm.

Want this checked on your site automatically?

AccessProof scans your site against WCAG 2.2 every day, scores it, and tells you exactly what to fix. Free plan available.