Skip to content
Back to blog
Field notes · image

WebAIM Says This Gray Passes WCAG; APCA Says It Doesn't

#767676 on white passes WCAG 2 AA at 4.54:1 but scores APCA Lc 71.6, below the 75 needed for 16 px body text. Why WCAG 2 and APCA disagree.

4 min readSimon Wong

#767676 text on a white background gives a WCAG 2 contrast ratio of 4.54:1. Drop those exact colors into the WebAIM Contrast Checker — the most-linked accessibility tool on the web — and you get a green badge: AA Pass — Normal Text. Drop the same colors into the APCA reference implementation (apca-w3 v0.1.19d) and you get Lc +71.6, which is below the 75 minimum for 16-pixel body text in APCA's font-weight lookup table. Two algorithms, same hex codes, opposite verdicts at body-text size. They do not have the same standing: WCAG 2 is a W3C Recommendation, while APCA is not a W3C standard. It was developed as a candidate contrast method for WCAG 3, which is still a working draft.

This is the gap the WCAG 3 working draft exists to close. WCAG 2.1's (L1 + 0.05) / (L2 + 0.05) formula was specified in 2008 against a 1996 sRGB linearization, and the contrast-ratio thresholds were calibrated against early-2000s CRTs. The APCA documentation (Somers / Myndex) argues that the WCAG 2 ratio misjudges color pairs in both directions: some pass WCAG 2 but are hard to read, especially for low-vision readers, and some fail WCAG 2 but read well. Every mainstream consumer contrast checker (WebAIM, Coolors, contrast-ratio.com, Whocanuse) implements only WCAG 2. This tool runs both, side by side, and flags every pair where they disagree.

The 4.54 vs Lc 71.6 Trap

The WCAG 2 number for #767676 on white is 4.54:1. WCAG 2.1 SC 1.4.3 sets the AA-Normal floor at 4.5, so this pair passes by 0.04 — close, but a pass is a pass. The APCA Lc is +71.6. The font lookup table from apca-w3 (fontLookupAPCA, SA98G constants) requires:

Font sizeWeight 400Weight 700
14 px9075
16 px7560
18 px7560
24 px6045

At 16 px regular — what most websites use for body copy — the minimum is 75. Lc 71.6 is below that. APCA's verdict for 16 px body text is fail; APCA's verdict for 24 px body text is pass. WCAG 2 prints one number and one verdict for every size below 18 pt. APCA prints one number and asks the developer what size the text actually is.

The disagreement is not noise. Run the gray ramp:

ForegroundWCAG ratioWCAG AA NormalAPCA LcAPCA 16 px / 400
#7676764.54✓ pass+71.6✗ fail
#8888883.93✗ fail+63.1✗ fail
#9999992.85✗ fail+55.7✗ fail
#FFD700 (gold)1.62✗ fail+21.4✗ fail
#FF8800 (orange)2.51✗ fail+46.6✗ fail

#767676 is the boundary case the WCAG 2 ratio uniquely gets wrong. APCA agrees with WCAG 2 on the obvious losers (#FFD700, #FF8800) and disagrees on the borderline grays that real readers struggle with — the exact range where a designer is most likely to trust a green checkmark.

Asymmetric Exponents: Why Polarity Has a Sign

WCAG 2's formula is symmetric in polarity: swap foreground and background and the ratio is identical (max / min does not care which color is which). Human contrast perception is not symmetric. Dark text on a light background is measurably easier to read than light text on a dark background at the same luminance gap — APCA encodes this in two pairs of exponents and reports a signed Lc:

if (bgY > txtY) {
  // BoW — dark text on light bg → positive Lc
  Sapc = (bgY ** 0.56 - txtY ** 0.57) * 1.14;
} else {
  // WoB — light text on dark bg → negative Lc
  Sapc = (bgY ** 0.65 - txtY ** 0.62) * 1.14;
}

The exponents 0.56 / 0.57 (BoW) and 0.65 / 0.62 (WoB) are not interchangeable, and txtY and bgY use different exponents within each branch on purpose. Black text on white returns Lc +106.04; white text on black returns Lc −107.88. Same two hex codes, polarity swapped, a 1.84-point gap in absolute magnitude. WCAG 2 returns 21.0 either way and cannot tell you which polarity is more legible.

Two sRGB-to-Linear LUTs, On Purpose

The most common porting bug for either algorithm is sharing the sRGB-to-linear lookup. WCAG 2 uses the IEC 61966-2-1 piecewise function (post-2021 threshold 0.04045, not the original 1996 value 0.03928 — the change is normatively equivalent for 8-bit input but several published implementations still ship the old number). APCA uses a pure pow(c, 2.4). The two diverge below ~10/255 by enough to flip pass/fail on low-luminance pairs:

// WCAG 2.1 SC 1.4.3 (IEC 61966-2-1 piecewise)
const wcag = cs <= 0.04045 ? cs / 12.92 : ((cs + 0.055) / 1.055) ** 2.4;

// APCA G-4g (apca-w3 v0.1.19d SA98G)
const apca = (c / 255) ** 2.4;

They live in separate 256-entry Float64Array LUTs. Collapse them into one and your APCA output for #101010 shifts by enough Lc to move a "fail" into a "borderline pass." This implementation keeps two SRGB_LINEAR_WCAG and SRGB_LINEAR_APCA constants at module scope, each built once at import time and never mixed.

Color-blindness simulation needs the same piecewise decode before its LMS matrices; skipping it renders #FF0000 about 1.6 stops too dark.

Try It

Paste #767676 as the foreground and #FFFFFF as the background into the Contrast Checker. The left panel reads WCAG 2 ratio 4.54 — AA Pass (Normal Text). The right panel reads APCA Lc +71.6 — fails 16 px / 400 body text (needs 75), passes 24 px / 400 (needs 60). The misclassification banner above both panels reads: "WCAG 2 and APCA disagree at body text size."

For the polarity asymmetry, set foreground #000000 on background #FFFFFF: Lc +106.04. Click Swap: now #FFFFFF on #000000 gives Lc −107.88. WCAG 2 prints 21.00 either way.