How to fix
How to fix color contrast issues
By Chris Morris · updated 2026-09-15
Low-contrast text is the most common accessibility failure on the web. It shows up on more than four in five home pages. Here is what WCAG requires and how to fix it.
What WCAG requires
WCAG 2.2 success criterion 1.4.3 Contrast (Minimum) sets the AA bar:
- 4.5:1 for normal text against its background.
- 3:1 for large text (≥ 24px, or ≥ 18.66px bold).
- 3:1 for meaningful graphics and UI component boundaries (1.4.11).
The ratio compares the relative luminance of the text colour and the colour directly behind it.
How to find the failures
Run the free scan above. Every element that fails contrast is outlined and reported with its measured ratio and the colours involved. Watch especially for: muted "secondary" text, placeholder text, link colours on coloured backgrounds, sale/notification badges, and disabled-looking buttons that are actually active.
The same scan often flags skipped heading levels as well. Unlike contrast, those are a best-practice warning rather than a WCAG failure, so fix contrast first.
"Element's background color could not be determined"
This is not a failure and not a pass. It is axe reporting that it could not measure the element at all, so the result is incomplete and a human has to decide. You will see it with a reason attached:
- "due to a background gradient" — the text sits on a gradient, so the contrast changes across the element.
- "due to a background image" — the backdrop is a photo, and the pixels under the text are unknown to a static check.
- "because it is overlapped by another element" — something is painted on top, commonly a scrim over a hero image.
- "because of alpha transparency" — a translucent colour that has to be composited over whatever is beneath it.
- "due to a pseudo element" — the backdrop comes from
::beforeor::after.
Most tools stop here and leave you a list to check by hand, which is why a big site can finish a scan with hundreds of unresolved contrast items and no idea which ones are real.
How to resolve a gradient or image background yourself
The measurement that matters is the worst case, not the average. Text legible over the pale end of a gradient and invisible over the dark end is a real failure, so sample the least favourable point rather than a midpoint.
- Gradients: test every colour stop and the stretches between them. A blend of two colours can be darker than either end, so dark text can pass at each stop and still fail part of the way across.
- Background images: sample the actual pixels beneath the text. A photo that is bright in one corner and dark in another can pass and fail within one heading.
- Overlays: composite the translucent layer over what is behind it first, then measure. A 60% black scrim over a light photo gives a very different number from the scrim alone.
Our scanner does the first three automatically and reports a real pass or fail instead of leaving them incomplete. Where it cannot be sure, it says so rather than guessing: cross-origin images that cannot be read back, backgrounds fixed to the viewport, pseudo-element backdrops, and overlays painted by an element that is not an ancestor of the text. An unresolved item always stays "needs review" and is never counted as a pass, because a false pass is exactly the fake-compliance badge this tool exists to argue against.
To check a single gradient or photo by hand, paste the CSS or load the image into the image and gradient contrast checker. It runs in your browser and shows the lowest-contrast point.
How to fix it
- Darken the text or lighten the background until it clears 4.5:1. A contrast checker tells you the exact ratio.
- Don't rely on colour alone for links. Keep underlines, or give links a 3:1 difference from body text plus a non-colour cue on hover and focus.
- Fix it in CSS or your theme settings, not with an overlay widget. Overlays can't reliably correct contrast and don't make you compliant.
- Re-scan after changes to confirm the ratio now passes.
Frequently asked questions
What contrast ratio is required for accessibility?
4.5:1 for normal text and 3:1 for large text (WCAG 2.2 AA, criterion 1.4.3). AAA raises this to 7:1 and 4.5:1.
Why is color contrast so important?
Low contrast makes text hard or impossible to read for people with low vision, colour vision deficiencies, or anyone on a glary screen. It's also the most frequent WCAG failure online.
Does large text need less contrast?
Yes, large text (≥ 24px, or ≥ 18.66px bold) only needs 3:1 because larger letterforms remain legible at lower contrast.
Can an accessibility overlay fix contrast?
Not reliably. Overlays apply blunt filters and don't fix your actual styles. Correct the colours in your CSS or theme and re-test.
What does "unable to determine contrast ratio" mean?
The checker could not work out what colour sits behind the text, so it returned incomplete rather than pass or fail. It is a request for a human decision, not a clean bill of health. The usual causes are gradients, background images, translucent overlays and pseudo-element backdrops.
How do you check contrast on a gradient background?
Measure the text against every colour stop and against points between them, then take the worst result. Checking only the two ends misses a mid-gradient stop, and checking only the stops misses the darker patch a blend can produce between two colours. Our scan samples the whole gradient and returns a real pass or fail.
Does text over a background image fail WCAG?
It depends on the pixels actually behind the text, which is why automated tools usually decline to answer. Sample the darkest and lightest regions under the text and use the worst case. If a photo can change, add a solid or gradient scrim so the backdrop is predictable rather than relying on the current image.
Is an incomplete contrast result a pass?
No. Incomplete means unmeasured. Treating it as a pass is how sites end up reporting clean scans while real failures sit on every hero section. A scan that resolves these gives you a smaller review list and a truthful count.
Related guides
See what's actually broken on your site
Real axe-core results, every element outlined. No email wall, no fake “compliant” badge.
Run a free scanLast updated 2026-09-15.