WCAG Color Contrast — A Complete Guide to Accessible Color Palettes

Accessibility isn't optional. Learn how to design color palettes that work for everyone, including people with color blindness and low vision.

What is WCAG?

The Web Content Accessibility Guidelines (WCAG) are international standards that define how to make web content accessible to people with disabilities. Maintained by the W3C, WCAG 2.1 Level AA is the most widely adopted standard.

One of the most important WCAG requirements is color contrast—the difference in brightness between text and its background. Proper contrast ensures that people with low vision, color blindness, or visual impairments can read your content.

Understanding Contrast Ratios

How Contrast is Measured

Contrast is expressed as a ratio comparing the relative luminance (brightness) of two colors. The formula is:

(L1 + 0.05) / (L2 + 0.05)

Where L1 is the lighter color's luminance and L2 is the darker color's luminance. Black text on white has a 21:1 ratio (excellent). Black text on dark gray might be 3.5:1 (insufficient).

WCAG Levels

WCAG defines three conformance levels for contrast:

AA: 4.5:1 for normal text

The minimum standard. Normal body text must have at least 4.5:1 contrast. Large text (18pt+) requires 3:1.

AAA: 7:1 for normal text

The enhanced standard. Normal text requires 7:1 contrast. Large text requires 4.5:1. Recommended for high-impact content.

Non-Text Contrast: 3:1

Applies to UI components, icons, borders, and decorative elements. A button border must contrast 3:1 with the background.

Why Contrast Matters Beyond Compliance

Low Vision Users

Approximately 253 million people have visual impairments. High contrast helps users with:

  • Cataracts (reduced contrast perception)
  • Macular degeneration (central vision loss)
  • Glaucoma (peripheral vision loss)
  • General presbyopia (age-related vision loss)

Color Blindness

About 1 in 12 men and 1 in 200 women have color blindness. There are several types:

  • Protanopia: Red-blind (0.5% of males)—cannot distinguish reds from greens
  • Deuteranopia: Green-blind (1% of males)—green appears as red/orange
  • Tritanopia: Blue-yellow blindness (0.001% of population)—rare but severe

Situational Context

High contrast benefits everyone. A user viewing your site on a mobile phone in sunlight benefits from higher contrast. So does someone reading on an old monitor with poor color calibration.

Common Contrast Failures & Solutions

Gray Text on Light Background

The most common failure. Light gray (#888) on white (#FFF) is approximately 3.5:1—failing both AA and AAA.

Solution: Either darken the gray (#666 or darker) or use a colored background. For body text, aim for #333 or darker.

Color Alone for Information

Red text to indicate an error fails for color-blind users. Don't use color as the only method to convey information.

Solution: Always pair color with text, icons, or patterns. "Error: Invalid email" is better than just red text.

Fancy Fonts with Low Contrast

Some display fonts are thin or light by design. Light text (#CCC) on light backgrounds fails badly.

Solution: For headings, aim for at least 3:1. For body text, maintain 4.5:1 minimum. Consider font weight when selecting colors.

Reduced Contrast on Hover

Changing a button's color on hover can accidentally reduce contrast. A dark button becoming slightly darker might fall below AA.

Solution: Test all interactive states (normal, hover, active, focus) for contrast compliance.

Creating WCAG-Compliant Palettes

Step 1: Check All Color Pairs

Generate your palette, then test every combination against your primary background colors. A 5-color palette generates 20 unique text+background combinations (plus text colors on other text colors).

Step 2: Adjust Lightness

The most effective way to fix contrast is adjusting lightness (brightness). Lighten dark colors or darken light colors.

  • If text is too light: reduce lightness by 10-20%
  • If background is too light: reduce lightness by 5-10%
  • For both: move them apart on the lightness scale

Step 3: Simulate Color Blindness

Use color blindness simulation (Protanopia, Deuteranopia, Tritanopia) to see how your palette looks to color-blind users. If contrast disappears in simulation, adjust hue or saturation.

Step 4: Test in Context

Check your palette on real devices, especially small screens and in different lighting conditions. Color grading and monitor calibration vary widely.

Advanced Contrast Strategies

Minimum Hue Differences

When you can't increase lightness, increase hue difference. Blue (#0000FF) and cyan (#00FFFF) have the same lightness but high hue difference (120°), improving contrast for color-blind users.

Saturation Trade-offs

Highly saturated colors can appear to have more contrast. A saturated dark blue feels more distinct from white than a desaturated dark blue, even at the same technical ratio.

Font Size Matters

WCAG allows lower contrast for large text (18pt+ or 14pt+ bold). Headings have looser requirements than body text. Use this to your advantage in layout design.

Background Images

Text over images needs extra attention. Use semi-transparent overlays to ensure text contrast regardless of image colors.

Tools for Testing Contrast

Use tools to validate your work:

  • Our color palette generator: Built-in WCAG checker for all color pairs
  • WebAIM Contrast Checker: Quick online tool for two colors
  • Color Blindness Simulators: Simulate how colorblind users see your site
  • Browser DevTools: Most modern browsers include accessibility checkers
  • Automated Testing: axe, WAVE, and Lighthouse automate compliance checks

Practical Examples

Good: Dark Text on Light Background

Dark gray (#222) on white (#FFF): 18.5:1 ratio. Exceeds AAA. Works for all color-blind types.

Acceptable: Mid-Gray Text

Dark gray (#555) on white: 6.5:1 ratio. Meets AAA. Better readability than pure black.

Failing: Light Gray Text

Light gray (#AAA) on white: 1.8:1 ratio. Fails AA. Hard to read even for people without vision impairments.

Problem: Light Text on Light Background

Light gray (#CCC) on off-white (#F5F5F5): 1.5:1 ratio. Barely visible. Inaccessible and poor UX.

Conclusion

WCAG color contrast requirements aren't obstacles—they're guidelines for better design. High-contrast interfaces are more readable, more professional, and reach a wider audience.

Start with our accessible color palette generator and use the built-in contrast checker to validate every color combination. When you design with accessibility in mind from the start, you create better products for everyone.