Glossary / Color contrast

Color contrast

Color contrast is the measurable difference in luminance between foreground content and its background. Sufficient contrast helps people with low vision, color-vision differences, aging vision, and users in glare or low-quality displays. WCAG contrast requirements apply to text and meaningful non-text interface graphics; color alone must not communicate meaning. Contrast should be designed into tokens and tested across states, themes, transparency, gradients, and real rendered backgrounds.

WCAG 2.2 essentials

Engineering practice

Choose accessible foreground/background pairs in design tokens and validate every theme and component state: hover, focus, disabled, error, selected, visited, and high-contrast/forced-colors modes. Semi-transparent overlays and images require checking the final composite color, not the nominal token. Do not reduce font size to evade a large-text threshold. Use automated contrast tooling for candidate detection, then inspect actual UI and non-text indicators. Preserve user agent forced-colors behavior where possible instead of disabling it.

Interview questions

  1. What is the AA text contrast requirement? 4.5:1 for normal text and 3:1 for large text.
  2. What contrast applies to control boundaries and icons? Often 3:1 under Non-text Contrast when the visual cue is necessary to identify the component or state.
  3. Does passing contrast make a chart accessible? No. It also needs non-color distinctions and, where appropriate, text or tabular alternatives.
  4. Why test composited colors? Transparency, gradients, and imagery change the actual foreground/background relationship.
  5. Can a tool prove every contrast issue absent? It can help measure known color pairs, but dynamic backgrounds and state/context require manual verification.

References