Color Contrast in Web Design: Why It Matters for ADA Compliance
Color contrast is one of the most commonly failed WCAG criteria and one of the most measurable. Here's how the math works, what the thresholds are, and how to pick accessible color palettes.
By Apoorv Dwivedi · Rare Input
Why Color Contrast is an Accessibility Issue
Approximately 300 million people worldwide have color blindness, and hundreds of millions more have low vision. When text does not have sufficient contrast against its background, these users — and anyone using a screen in bright sunlight or a low-quality display — cannot read the content. Color contrast is not a preference; it is a fundamental readability requirement.
WCAG criterion 1.4.3 (Contrast, Minimum) is one of the most commonly failed WCAG AA criteria. It is also one of the most precisely measurable — contrast is a number, not a judgment call — which makes it both easy to audit and hard to argue about.
How the WCAG Contrast Formula Works
WCAG uses a measure called relative luminance, which represents the perceived brightness of a color. It is calculated from the RGB values of a color using a gamma-adjusted formula that accounts for how human vision perceives different wavelengths.
The contrast ratio between two colors (L1 and L2, where L1 is the lighter of the two) is:
(L1 + 0.05) / (L2 + 0.05)
This ratio ranges from 1:1 (no contrast, same color) to 21:1 (black text on white, maximum contrast).
What Are the Required Ratios?
WCAG 2.1 AA requires:
- 4.5:1 for normal text (below 18pt regular or 14pt bold)
- 3:1 for large text (18pt regular or 14pt bold and above)
- 3:1 for non-text UI elements like input borders, focus indicators, icons, and chart data (WCAG 1.4.11)
Common Failures in Real Design Systems
Gray Body Text on White Backgrounds
A color like #767676 on white (#ffffff) achieves exactly 4.54:1 — barely passing. Many design systems use lighter grays like #808080 (4.08:1 — failing) or #999 (2.85:1 — failing) for secondary text, captions, and placeholders. Secondary text styles are the highest-risk category.
White Text on Medium-Blue Buttons
Lighter blues commonly used in "gentle" design aesthetics often fail the 4.5:1 threshold for button text. Always verify button text contrast programmatically rather than by visual inspection.
Placeholder Text in Form Inputs
Browser default placeholder text is typically around 40% opacity — on a white background, this is often around #767676 or lighter. Beyond contrast, placeholder text disappears when the user starts typing, making it a poor label substitute for multiple reasons.
Tools for Checking Contrast
- ADA Compliance Checker extension: Automatically checks all visible text elements using computed CSS values and flags contrast failures directly on the page.
- WebAIM Contrast Checker: Enter two hex codes and see the ratio instantly.
- Colour Contrast Analyser: A free desktop app with an eyedropper tool for checking any two colors on screen.
- Figma plugins: Contrast, A11y - Color Contrast Checker, and Stark all integrate into Figma to check contrast during the design phase — before a line of code is written.
Building Accessible Color Palettes
The most sustainable approach is to test contrast at the design system level, not page by page. Define your color palette with contrast-checked pairings. For each text color in your system, specify which background colors it is approved for use on. Document the ratios. Enforce them in code review.
A common approach for primary text: use a very dark color (near black, like #202124 or #1a1a1a) for primary text, a darker gray (like #5f6368) for secondary text, and test both against all background colors in the system.
The One Test You Should Always Run
Before shipping any page, tab through it with only a keyboard and look at the focus indicator. If you can barely see it, your contrast is failing. The same applies to button labels, input placeholder text, and any gray-on-white typography. Run an automated scan and verify every text element is at or above 4.5:1.
Free Chrome Extension
Check your site for ADA violations right now
The ADA Compliance Checker by Rare Input scans any webpage instantly. No account needed. Completely free.
Add to Chrome — It's Free