How to test for Color Contrast | TPGI & WebAIM | WCAG
The actual testing tools — WebAIM and TPGI — used on real examples, including how to check the pairs that matter. Practical, quick, and the fastest way to stop guessing about contrast.
Watch on YouTube (opens in a new tab)Third-party video. It is loaded from YouTube and is not hosted by the academy.
By the end of this lesson you can
- Apply the main visual WCAG requirements: text contrast, non-text contrast, use of colour, resizing, reflow and text spacing.
- Design visible focus indicators and adequate target sizes.
- Check a design for visual accessibility problems before handoff.
The idea
Visual accessibility is the part of accessibility designers control most directly. Many of the most common accessibility failures on the web are visual, and most are easy to prevent at the design stage. This lesson focuses on what you can see; Stage 9 covers keyboard, screen readers and cognitive accessibility in depth.
The key requirements
The Web Content Accessibility Guidelines (WCAG) 2.2 include these visual success criteria at level AA, which many organisations and laws use as a target:
- Contrast (minimum), 1.4.3: text needs at least 4.5:1 contrast with its background; large text (at least 24px regular or about 18.7px bold) needs 3:1.
- Non-text contrast, 1.4.11: meaningful graphics and the visible parts of controls (input borders, icons, focus indicators, chart lines) need at least 3:1 against adjacent colours.
- Use of colour, 1.4.1 (level A): colour must not be the only way information is conveyed, such as errors, links in text, or chart series.
- Resize text, 1.4.4: text can be enlarged to 200% without loss of content or function.
- Reflow, 1.4.10: content works at a width of 320 CSS pixels without two-dimensional scrolling, with some exceptions.
- Text spacing, 1.4.12: layouts survive users increasing line, paragraph, letter and word spacing.
- Focus visible, 2.4.7: keyboard focus is always visible. WCAG 2.2 adds focus not obscured (minimum), 2.4.11: the focused element is not completely hidden, for example by a sticky header.
- Target size (minimum), 2.5.8: pointer targets are at least 24 by 24 CSS pixels, or spaced so a 24px circle around each does not overlap others. Larger targets, such as 44px, are more comfortable and recommended by many platform guidelines.
Beyond the minimum
Meeting a success criterion is a floor, not a guarantee of a good experience. Text that passes 4.5:1 can still be tiring if it is thin and small. Aim for comfortable, not just compliant. And remember that automated contrast checkers cannot judge everything, such as text over images or whether colour is the only cue.
Why it matters in real projects
Low vision, colour vision deficiency, ageing eyes, small screens, bright sunlight and tired eyes affect a large share of people. Visual accessibility problems therefore affect far more people than many teams assume. Fixing them in design costs almost nothing; fixing them after development costs time and money, and in many countries inaccessible public services and some private ones can face legal challenges.
A realistic example
A transport company's journey planner shows delays in red text on a dark grey background, uses a pale grey outline for input fields, and removes the default focus outline because it "looked ugly". A customer who navigates by keyboard cannot tell where they are on the page, and colour-blind customers miss delays entirely.
The fix: delays get an icon and the word "Delayed" with sufficient contrast; input borders darken to meet 3:1; a clear two-colour focus ring is designed to work on both light and dark backgrounds; the sticky header is checked so it never covers a focused field. The changes take a designer one afternoon.
Step by step
Check text contrast
Measure every text colour on every background it sits on, including text over images and coloured panels.
Check non-text contrast
Measure input borders, icons that convey meaning, chart lines and focus indicators against adjacent colours (3:1).
Remove colour-only meaning
View the design in greyscale. Add text, icons or patterns wherever meaning disappears.
Design focus states
Design a focus indicator for every interactive component, visible on all backgrounds it appears on.
Check targets
Measure tap targets. Aim for 44px; never go below 24px without spacing.
Stress test
Check the layout at 320px wide, with 200% text size, and with long translated strings.
Common mistakes
Mistake Removing focus outlines for aesthetics.
Instead Design a better focus indicator instead; never remove it without a visible replacement.
Mistake Placeholder text as the only label, in light grey.
Instead Use visible labels above fields; placeholders, if used at all, are hints with sufficient contrast.
Mistake Assuming an automated checker found everything.
Instead Combine tools with manual checks such as greyscale, zoom and keyboard focus.
Mistake Text over busy photos.
Instead Add a solid or gradient overlay and measure contrast on the worst part of the image.
Check your understanding
Choose an answer, then check it. There is an explanation either way.
Practice exercise
Exercise · about 45 min
Visual accessibility review
Review one of your own designs, or a public website, for visual accessibility using the walkthrough.
Steps
- Measure and record contrast for all text and key non-text elements.
- Produce a greyscale version and note any lost meaning.
- Check focus indicators on three interactive elements.
- Check target sizes on mobile.
- Write a prioritised list of fixes.
Deliverable
A short audit using the accessibility audit template, with fixes.
Self-assessment
Tick each item when it is true of your exercise. Be honest; this is for you.
5 items
Summary
- Key visual criteria: text contrast, non-text contrast, use of colour, resize, reflow, text spacing, focus and target size.
- Never rely on colour alone; never remove focus indicators.
- Treat WCAG as a minimum and design for comfort.
- Automated tools help but do not replace manual review.
Further reading
Third-party sources, chosen for reliability. They open in a new tab.
Your notes
Marking complete updates your course and roadmap progress.