# Color Contrast

Color contrast is the luminance difference that helps text, icons, controls, states, and focus indicators remain distinguishable from adjacent colors.

- Type: metric
- Domain: Experience & interface
- Level: Intermediate
- Last reviewed: 2026-09-21
- Original: [Soroush’s Product Wiki](<https://wiki.soroush.uk/topic/color-contrast/>)

## What it means

WCAG defines contrast-ratio requirements for text and separate requirements for meaningful non-text graphics and user-interface component boundaries or states. Contrast is calculated from relative luminance, not guessed from hex distance or subjective brightness.

## Why it matters

Low contrast can make content and controls difficult or impossible to perceive for people with low vision, color-vision differences, aging eyes, or challenging displays and lighting. Systematic contrast decisions also reduce fragile one-off fixes across themes and states.

## When to use it

Check contrast while selecting tokens, designing components, creating data visualizations, adding imagery, and implementing interaction states. Recheck every theme and state, including hover, focus, selected, disabled, error, and text over images.

## How it works

1. Identify the foreground and immediately adjacent background for each meaningful element.
2. Calculate contrast using the WCAG method and the criterion relevant to text or non-text content.
3. Test normal, large, bold, interactive, and stateful variations independently.
4. Avoid using color as the only signal; add text, shape, position, or iconography.
5. Encode approved semantic pairs in tokens and automated tests where practical.
6. Review rendered results under zoom, high contrast settings, themes, and real devices.

## A practical example

A design system pairs text tokens with approved surface tokens instead of publishing an unrestricted palette. Its error field uses a clear message and icon as well as color, and the field boundary, message, and focus indicator are each checked against their adjacent backgrounds.

## Where it breaks

A passing ratio does not guarantee readability: type weight, size, glare, gradients, transparency, and visual clutter still matter. WCAG exceptions and thresholds must be applied to the right element, and disabled controls still need enough clarity for users to understand the interface.

## Common mistakes

- Checking palette swatches but not actual foreground-background pairs.
- Testing only default states and forgetting focus or selected states.
- Using a brand color unchanged across light and dark themes.
- Communicating status by red and green alone.
- Assuming automated contrast results prove overall visual accessibility.

## Visualization

[View the visualization on the website](<https://wiki.soroush.uk/topic/color-contrast/#visualization-color-contrast>)

## Sources

1. [Understanding Success Criterion 1.4.3: Contrast \(Minimum\)](<https://www.w3.org/WAI/WCAG22/Understanding/contrast-minimum>) — W3C Web Accessibility Initiative · Standards guidance
2. [Understanding Success Criterion 1.4.11: Non-text Contrast](<https://www.w3.org/WAI/WCAG22/Understanding/non-text-contrast>) — W3C Web Accessibility Initiative · Standards guidance
3. [Web Content Accessibility Guidelines \(WCAG\) 2.2](<https://www.w3.org/TR/WCAG22/>) — World Wide Web Consortium · Standard

## Related topics

- [Design Tokens](<https://wiki.soroush.uk/topic/design-tokens/>)
- [Accessibility](<https://wiki.soroush.uk/topic/accessibility/>)
- [Color in UI](<https://wiki.soroush.uk/topic/color-in-ui/>)
