A Complete Guide to Color Theory for Web Designers
The color wheel, harmonies, temperature and contrast — explained for people who ship interfaces, not oil paintings.
Understand WCAG 2.1 and 2.2 color contrast requirements: 3:1 vs 4.5:1 ratios, how contrast is calculated, common failures, and how to fix inaccessible palettes.
Roughly one in twelve men has some form of color vision deficiency. Add low-vision users, aging users, and the very large group of people reading phones in bright sunlight, and accessible color stops being an edge case — it becomes basic quality control. Yet "light gray text on white" remains one of the most common accessibility failures on the web, right alongside missing alt text.
This article explains what the Web Content Accessibility Guidelines (WCAG) actually require for color, how contrast is computed, and — most usefully — how to design palettes that pass from day one instead of getting patched after an audit.
WCAG organizes requirements into three conformance levels: A (minimum), AA (the widely accepted standard), and AAA (enhanced). For color, the AA rules that matter most are:
1.4.3 Contrast (Minimum): text must have a contrast ratio of at least 4.5:1 against its background. Large text — defined as 18pt (roughly 24px) regular or 14pt bold (roughly 18.7px) and above — needs only 3:1, because bigger glyphs are easier to distinguish.
1.4.11 Non-text Contrast: UI components and graphical objects required to understand content — form input borders, icons without labels, focus indicators, chart lines — need at least 3:1 against adjacent colors.
1.4.1 Use of Color: color cannot be the only means of conveying information. Error states need an icon or message as well as red; chart series need shapes or labels as well as hue differences; links inside body text should be underlined or otherwise distinguished beyond color alone.
AAA raises body-text contrast to 7:1 — worth targeting for long-form reading surfaces, but AA is the legal benchmark referenced by major accessibility laws including the ADA-related guidance in the US and EN 301 549 in the EU.
Contrast isn't subjective once you know the formula. For any foreground/background pair:
(L1 + 0.05) / (L2 + 0.05) with L1 the lighter color.The result ranges from 1:1 (identical colors) to 21:1 (black on white). Two properties surprise people:
This is why eyeballing fails so reliably. Monitors, ambient light, and individual eyes distort judgment; the formula doesn't. Every palette page on our explore gallery computes these ratios per swatch automatically, flagging which combinations pass at which level — it's faster than arguing about whether something "looks fine."
The signature move of minimalist design and the signature failure of audits. #999999 on white is about 2.8:1 — fails even for large text. Fix: darken grays until body copy reaches 4.5:1 (#767676 squeaks by at 4.54:1, giving no safety margin — prefer #707070 or darker). Better yet, treat pure white backgrounds as an invitation to use near-black text (#1a1a1a–#333) which comfortably clears AAA and reads better for everyone.
White text on a mid-tone brand color is endemic. A pleasant medium blue like #4A90D9 with white text lands around 3:1 — fine for large text, a failure for normal button labels. Fixes in order of preference: darken the button background, switch the label to dark text, or increase label size/weight to qualify as "large." Note that hover states often get worse (lighter) than the resting state; check every state.
Placeholder gray almost always fails 4.5:1, and WCAG treats placeholders as text content when they convey essential information. Either meet contrast with the placeholder itself or stop relying on placeholders entirely — floating labels are the accessible pattern anyway.
Red "error" dots, green "success" pills, yellow "warning" badges — invisible to the ~8% of male users with red-green deficiencies if color carries the meaning alone. Always pair hue with iconography, text, or position. This costs nothing and helps far more people than just those with deficiencies: anyone skimming, anyone with notifications suppressed, anyone on a washed-out screen.
Categorical palettes built from five similar-lightness hues are unreadable for color-blind users. Use established color-blind-safe scales (Okabe–Ito, viridis), vary lightness deliberately across categories, add direct labeling or patterns for dense charts, and keep adjacent-line contrast above 3:1.
The efficient way to guarantee contrast is to stop auditing finished designs and start building ramps that can't fail:
For a deeper look at the underlying numbers — luminance weighting, why HSL lightness misleads, and how LAB improves on it — see our guide to color models compared.
Two nuances keep designs humane after the ratios pass:
Accessible color isn't a tax on good design — the constraints produce clearer hierarchy, stronger CTAs, and palettes that survive bad screens and bright sun. Build the ratios into your palette workflow once, and compliance becomes a side effect of doing things properly.
Try the techniques from this guide in our free tools — no sign-up required.
More in Accessibility · All articles · FAQ
The color wheel, harmonies, temperature and contrast — explained for people who ship interfaces, not oil paintings.
Four color models, one practical answer: which to use in CSS, which to use in print, and why LAB quietly became the most important of all.
Why the same beige looks perfect in the living room and grim in the hallway — plus a practical, room-by-room method for getting paint right the first time.