Benchmark · Color
Contrast methods WCAG 2 and APCA, on 16.8 million color pairs
Every color of a 16-level sRGB grid as text on every color as background: 16,777,216 pairs, each measured with the WCAG 2 contrast ratio and with APCA. Where do the two agree, and where does one pass what the other fails?

- Pairs
- 16,777,216
- Colors
- 4,096
- Run date
Assumptions
What was compared, decided in advance
- The sample. Every color whose red, green and blue are each one of 0, 17, 34 … 255: 4,096 colors, each as text on each as background, 16,777,216 ordered pairs. The grid is even in sRGB code values, not in perceived lightness.
- WCAG 2. The contrast ratio of WCAG 2.2, against 4.5:1 for body text and 3:1 for large text, its AA levels.
- APCA. APCA-W3 0.0.98G-4g, against the minimums of APCA’s Bronze Simple Mode: Lc 75 for body text, Lc 60 for other content text and Lc 45 for large text. The sign of Lc is ignored for the thresholds and used for polarity.
- The comparisons. Three pairings, fixed before the data was looked at: 4.5:1 with Lc 75, 4.5:1 with Lc 60, and 3:1 with Lc 45.
Results
How often the two agree
Each pairing splits the 16,777,216 pairs four ways. Agreement is both pass or both fail.
Body text: 4.5:1 and Lc 75
| Outcome | Pairs | Share of pairs |
|---|---|---|
| Both pass | 514,360 | 3.07% |
| Only WCAG 2 passes | 1,801,542 | 10.74% |
| Only APCA passes | 120 | 0.00% |
| Both fail | 14,461,194 | 86.20% |
| Agreement | 14,975,554 | 89.26% |
Body text: 4.5:1 and Lc 60
| Outcome | Pairs | Share of pairs |
|---|---|---|
| Both pass | 1,502,382 | 8.95% |
| Only WCAG 2 passes | 813,520 | 4.85% |
| Only APCA passes | 218,095 | 1.30% |
| Both fail | 14,243,219 | 84.90% |
| Agreement | 15,745,601 | 93.85% |
Large text: 3:1 and Lc 45
| Outcome | Pairs | Share of pairs |
|---|---|---|
| Both pass | 3,491,659 | 20.81% |
| Only WCAG 2 passes | 1,312,695 | 7.82% |
| Only APCA passes | 345,082 | 2.06% |
| Both fail | 11,627,780 | 69.31% |
| Agreement | 15,119,439 | 90.12% |
Findings
What the numbers say
- Of the 2,315,902 pairs that pass 4.5:1, 1,801,542 (77.8%) measure below Lc 75, APCA’s minimum for body text. Only 120 pairs reach Lc 75 and fail 4.5:1.
- At Lc 60 the disagreement runs both ways: 813,520 pairs pass only WCAG 2 and 218,095 pass only APCA.
- The body-text disagreements gather on dark backgrounds: backgrounds with a relative luminance below 0.1 hold 41.8% of the pairs that pass 4.5:1 but not Lc 75, though they are 18.9% of all pairs.
- APCA weighs polarity and WCAG 2 does not: at Lc 60, pairs only APCA passes are 2.5 times as common for light text on dark backgrounds as for dark text on light ones.
Where
Where the pairs fall
Each image plots every pair by its WCAG 2 ratio, left to right on a log scale from 1 to 21, against its APCA |Lc|, bottom to top from 0 to 112. Darker means more pairs. The gold lines are the thresholds: 3:1 and 4.5:1 across, Lc 45, 60 and 75 up.
WCAG 2 ratio
WCAG 2 ratio
The dark strip along the bottom is real: 1,647,490 dark-on-light pairs and 1,456,975 light-on-dark pairs score exactly Lc 0. APCA reports 0 for any pair below its low-contrast clip, so no pair scores above Lc 0 and below Lc 7.
Body-text disagreement by background lightness
| Background luminance | Share of pairs |
|---|---|
| 0.0–0.1 | 23.7% |
| 0.1–0.2 | 3.4% |
| 0.2–0.3 | 1.8% |
| 0.3–0.4 | 5.5% |
| 0.4–0.5 | 10.0% |
| 0.5–0.6 | 15.0% |
| 0.6–0.7 | 17.4% |
| 0.7–0.8 | 16.3% |
| 0.8–0.9 | 13.6% |
| 0.9–1.0 | 9.3% |
Examples
The widest disagreements
#777744 text on #000000: 4.51:1, Lc -29.3.#FFFFFF text on #777799: 4.30:1, Lc -75.2.Reading it
What it means, and what it does not
- WCAG 2.2 is a W3C Recommendation, and conformance to it is measured with its own ratio. APCA is a separate method, published by its author with its own guidance; it is not part of WCAG 2.2. This study measures where they differ, not which one is right.
- A pair that passes both meets either method’s minimum. Where they disagree, look at the pair at the size it will be used: the two examples above are the kind of pair each method lets through that the other does not.
Limits
What this does not show
- The grid is a sample, even in sRGB code values; colors used on real sites cluster differently, so the shares here are not shares of real design choices.
- Only the simplest APCA levels are used. APCA’s fuller guidance ties Lc to font size and weight, which this study does not model.
- Flat colors only: no transparency, gradients, images, anti-aliasing, display differences or color-vision deficiency.
Rerun it
Files and commands
| File | Contents | Size | SHA-256 |
|---|---|---|---|
| study.mjs | The study: computes every number on this page. Node.js only. | 8.2 kB | c74cf7a25830… |
| results.json | Its output, including the density grids. | 52.9 kB | fbf09330be69… |
| density-dark-on-light.png | The first image above. | 8.5 kB | a7fa09dae0ea… |
| density-light-on-dark.png | The second image above. | 9.4 kB | be633d62e54d… |
| SHA256SUMS.txt | The checksums of the files above. | 0.3 kB | d18e8551f7aa… |
The results and figures are CC BY 4.0: share and adapt them, with credit to Auric Artisan. study.mjs is CC0 1.0.
In a folder with study.mjs, with Node.js 18 or later; it takes a few seconds:
node study.mjs --png=.
References
Sources
- WCAG 2.2: Understanding 1.4.3 Contrast (Minimum)www.w3.org
- WCAG 2.2: contrast ratiowww.w3.org
- APCA Readability Criterion: Bronze Simple Modereadtech.org
- APCA-W3: the reference implementation (apca-w3)github.com
Found a mistake? Write to us and we will correct it.