Design & Accessibility
WCAG Color Contrast Guide: How to Check Text Accessibility
Learn how foreground and background contrast affects readability, what common WCAG contrast thresholds mean, and how to fix low-contrast interface text.
In this article
WCAG Color Contrast Guide: How to Check Text Accessibility
A color combination can look elegant on one monitor and become difficult to read for many users.
Contrast testing turns that visual judgment into a measurable check between foreground and background colors.
Use Duck Cloud's Contrast Checker to test color pairs and the Color Picker to inspect HEX and RGB values.
Why contrast matters
Low-contrast text can be difficult to read for users with low vision, color-vision differences, aging displays, bright sunlight, poor screens, or temporary visual limitations.
Accessibility is not only a compliance task. It improves everyday readability.
Contrast is a relationship
A color is not “accessible” by itself.
The result depends on the foreground and background combination.
For example, the same gray text may work well on white and fail on another light gray.
Always test the actual pair used in the interface.
Common WCAG thresholds
WCAG guidance defines contrast requirements that differ by text size and conformance level.
A commonly used target for normal text is a contrast ratio of at least 4.5:1 for WCAG AA.
Large text has a lower common AA threshold of 3:1.
For stricter AAA targets, common thresholds are higher.
Use the Contrast Checker to evaluate the exact foreground and background values rather than estimating by eye.
Do not rely on color alone
Contrast is only one accessibility principle.
If red means “error” and green means “success,” add an icon, text label, or other non-color cue.
Users who cannot distinguish the colors should still understand the status.
Common design mistakes
Light gray body text
Design systems sometimes reduce contrast to make secondary text feel subtle. Body copy still needs to remain readable.
Text over images
The effective background changes across the image. A text color that passes over one region may fail over another.
Use a solid overlay, text background, gradient, or controlled image treatment.
Disabled controls that disappear
Disabled UI can be visually muted, but users still need to understand what the control is and why it is unavailable.
Placeholder-only forms
Placeholder text often has weak contrast and disappears when the user types. Use persistent labels.
Test interactive states
Do not check only the default state.
Review:
- hover;
- focus;
- active;
- disabled;
- selected;
- error;
- success;
- dark mode.
A button may have excellent contrast normally and fail when hovered.
Dark mode needs separate testing
Dark mode is not automatically accessible.
Very light text on pure black can also feel harsh for some users, while muted text can become too faint.
Test each dark-mode token against its real background.
Build accessible color tokens
Instead of fixing colors page by page, define reusable design tokens such as:
- text-primary;
- text-secondary;
- surface;
- border;
- link;
- danger;
- success.
Test the token combinations centrally. That turns accessibility into a system property rather than an emergency patch.
Use the HEX to RGB and RGB to HEX tools when translating design values between formats.
Contrast testing workflow
- Identify the foreground color.
- Identify the actual background color.
- Test the pair with the Contrast Checker.
- Compare against the requirement for that text size and use.
- Adjust one color while preserving the design hierarchy.
- Test hover, focus, error, disabled, and dark-mode states.
- Review the interface at realistic device brightness and zoom levels.
- Combine automated checks with human review.
Good accessibility does not require dull design. It requires intentional contrast, clear hierarchy, and components that remain understandable across real viewing conditions.