🍋
Menu
Best Practice Beginner 2 min read 301 words

Accessible Color Contrast for UI Design

Meet WCAG color contrast requirements for text, UI components, and graphical elements in web interfaces.

Key Takeaways

  • WCAG 2.1 defines minimum contrast ratios that ensure text and interactive elements are perceivable by users with low vision and color vision deficiencies.
  • Disabled button text is exempt from contrast requirements, but the disabled state itself must be perceivable.
  • Never use color as the only means of conveying information — add icons, patterns, or text labels.

Color Contrast for Accessibility

WCAG 2.1 defines minimum contrast ratios that ensure text and interactive elements are perceivable by users with low vision and color vision deficiencies. These are legal requirements in many jurisdictions.

Contrast Ratio Requirements

Level AA (minimum): 4.5:1 for normal text, 3:1 for large text (18pt or 14pt bold). Level AAA (enhanced): 7:1 for normal text, 4.5:1 for large text. Non-text elements (icons, borders, form field outlines) require 3:1 contrast against adjacent colors. These ratios apply to the specific color combination, not to the colors individually.

Common Failures

Light gray text on white backgrounds is the most frequent failure. Placeholder text in form fields often fails contrast requirements. Disabled button text is exempt from contrast requirements, but the disabled state itself must be perceivable. Focus indicators must be visible against all backgrounds they appear on.

Testing Tools

Use browser extensions that overlay contrast ratios directly on your UI. Check each text color against its actual background — components used on different page sections may pass on one background and fail on another. Automated tools catch most issues, but manual review is needed for gradient backgrounds, images with text overlays, and interactive states.

Designing with Constraints

Rather than designing freely and fixing contrast afterward, start with accessible color palettes. For any brand color, generate a full scale (100-900) and identify which combinations meet AA and AAA requirements. Document these as the approved text/background pairings in your design system.

Beyond Contrast Ratios

Color contrast is necessary but not sufficient for accessibility. Never use color as the only means of conveying information — add icons, patterns, or text labels. Ensure that links are distinguishable from surrounding text without relying on color alone (underline is the simplest solution). Test your designs with color blindness simulation tools.

เครื่องมือที่เกี่ยวข้อง

รูปแบบที่เกี่ยวข้อง

คู่มือที่เกี่ยวข้อง