Why color contrast keeps failing
Low contrast text has been the most common accessibility failure on the web for as long as the WebAIM Million has measured it: in 2019 it was on 85.3% of the home pages of the top one million sites, and in 2026 it's on 8
Low contrast text has been the most common accessibility failure on the web for as long as the WebAIM Million has measured it: in 2019 it was on 85.3% of the home pages of the top one million sites, and in 2026 it's on 83.9%. That's eight editions, and it came first in all eight.
It's hard to blame that on people not knowing. The rule is one number, a contrast ratio of 4.5 between normal-size text and its background for WCAG's AA level (3 for large text), and the same tools that run those surveys measure it on their own. I still built a palette generator that looked even and didn't meet it. This article is about why that happens.
What's been measured and what hasn't
In WebAIM's series, low contrast dropped four years in a row, from 86.4% in 2021 to 79.1% in 2025, and in 2026 it went back to 83.9%, with 34 instances per page on average, 15% more than the year before. HTTP Archive's Web Almanac 2025 measures a different thing with a different tool (Lighthouse, on about 17 million sites) and counts the sites that pass the contrast check: 22% in 2019, 23% in 2022, 30% in 2025. With different methods, both say that about 7 out of 10 sites fail.
There's a third, smaller data point. An arXiv preprint from February 2026, by two researchers at Common Crawl and not yet peer reviewed, read the colors declared in the code of 240 home pages and found that 1,771 of 4,327 text-and-background combinations, 40.9%, fall short of 4.5. It measures what the code declares, not what ends up on screen, and when the code declares only one color it assumes the other: a white background or black text.
What doesn't exist, as far as I know, is a study that says why. I'm not aware of an audit of the palettes design systems ship, or a survey of when in a project contrast gets checked. So what follows comes from what I saw in my own work and from arithmetic anyone can repeat.
It gets checked at the end
On my projects, contrast being right depended on me remembering to check it. And contrast isn't a property of one color: it is always measured between two, the text and the background behind it. Checking means taking each of those combinations and measuring it. A screen has many: text on the page, a button's label on the button, and that same button hovered, disabled or showing an error.
When that check comes at the end, the palette is already picked and the screens are already built. Each failing combination gets fixed on its own, and fixing it usually means changing a color that had already been chosen. Then a new screen shows up with a new combination, and somebody has to remember again.
Contrast as a side effect
My generator did the obvious thing. It took the hue and chroma of the brand color and laid out ten fixed OKLCH lightness values, from 0.97 at the lightest step down to 0.12 at the darkest. It looked even, and I took it for granted that contrast would come out right by itself. I'd picked that idea up from the tools I'd been looking at.
In late October I measured it with 648 colors spread around the hue wheel, in light and dark mode. For 45 of them, 1 in 14, at least one step had text on it that fell below AA. The worst one came in at 4.10. The ones that failed were reds, magentas and purples, almost always with dark text on top.
The cause is easier to see from the other side, with white text and four colors. They all have the same OKLCH lightness, 0.57, and the same chroma, 0.10. Only the hue changes. With white text on top, and measuring the color as a screen paints it, the red gives a contrast of 4.70 and the purple 4.63, and both pass. The blue gives 4.38 and the green 4.26, and neither gets there.
A gray at that same lightness gives 4.48. The gap between hues is small, under half a point, but the rule has a threshold, and a palette built on evenly spaced lightness drops each color on one side of it or the other depending on its hue. Nobody decided the green should fail. Contrast was left as a side effect of other decisions, and nobody ran the numbers.
WCAG measures luminance
The WCAG 2 contrast formula works on each color's relative luminance, which is a sum with very uneven weights: green contributes 0.7152, red 0.2126 and blue 0.0722. Green counts almost ten times as much as blue.
That's why pure yellow, #ffff00, has a luminance of 0.93 and a contrast of 1.07 on white, while pure blue, #0000ff, has 0.07 and gets 8.59. To the eye both are strong colors, as saturated as they come. To the formula, one is nearly white and the other is a dark color. The intuition we pick colors with looks at how intense a color is. The standard looks at how much light it gives back.
That may change: the WCAG 3 draft, dated September 2026, says its contrast algorithm is yet to be determined. In the meantime, the rules that ask for WCAG 2.1 AA measure with this one: the US Department of Justice's rule for state and local governments, with deadlines starting in April 2027, or Colombia's Resolution 1519 of 2020, which requires level AA since January 2022.
The step number doesn't mean the same thing in every color
Ready-made palettes number their steps, and that number sorts each color from light to dark. It's easy to read it as a promise: if white text is readable on one color's 600, it'll be readable on another's.
With luminance in view, there's no reason it should be. Yellow only looks yellow when it's light; darken it at a fixed hue and it ends up olive. A palette tuned by hand, hue by hue, so that every color looks right, tends to leave yellow lighter than blue at the same step. I measured it on the Tailwind CSS 4 palette: with the colors as declared, white text gives a contrast of 3.71 on its blue 500 and 1.93 on its yellow 500. Both fall outside sRGB, so the exact figure depends on the screen. My reading is that there the step number sorts each color from light to dark and doesn't set a contrast. That's a valid choice, and it has a cost: what you learn with one color doesn't carry over to the next, and every combination has to be measured again. By hand again, and at the end again.
The four reasons have something in common. In all of them the color is chosen first and the contrast is found out afterwards. The next piece in this series shows one way to do it in the other order.
Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.