Field Notes

Contrast ratio vs perceived contrast

WCAG 2 gives one number for a color pair. APCA gives a different one, and sometimes a different verdict. Where they disagree is where the pair is marginal.

Published

  • color
  • wcag
  • apca

Put a mid-gray text on a white background and on a black background. WCAG 2 says the two pairs have the same contrast ratio, because the formula only cares about the two luminances and not which one is on top. Look at them, and the gray on black is harder to read. Most people see it. The formula does not.

That gap is why a second method exists, and why the Color Lab lets you switch between them.

The same mid-gray glyph on a white tile and a black tile, each with two small gauges whose needles point to different values.

What the ratio measures

The WCAG 2 contrast ratio takes the relative luminance of each color, adds a small constant to both, and divides the lighter by the darker. The result runs from 1:1 (identical) to 21:1 (black on white). Thresholds: 4.5:1 for body text, 3:1 for large text and for UI parts like borders and focus rings, 7:1 for the enhanced level.

It is simple, symmetric, and normative. If you are claiming WCAG 2.x conformance, this is the number that counts, and nothing in this note changes that.

What it misses

Three things, mostly.

Polarity. Light text on a dark background reads as lower contrast than the same pair reversed, especially for thin type. The ratio cannot tell the two apart.

Spatial frequency. Thin, small text needs more contrast than bold, large text to be equally readable. The ratio has a single large-text exception and otherwise ignores size and weight.

The dark end. The ratio treats very dark pairs more generously than perception does. A dark gray on black can pass 4.5:1 and still be close to invisible on a real screen in a lit room.

What APCA does

APCA, the Advanced Perceptual Contrast Algorithm, is the candidate method for WCAG 3. It produces a lightness contrast value, Lc, from about 0 to 106, signed: positive for dark text on light, negative for light on dark. It is not symmetric, so the two polarities get different numbers. It applies a soft clamp near black so very dark pairs score lower than the ratio would suggest. And its guidance ties the required Lc to font size and weight, with Lc 75 as the common target for body text, 60 for large text, and 45 for non-text.

The lab uses the APCA-W3 0.1.9 constants. The method is still changing, and the lab says so. It is a tool for seeing, not a conformance claim.

Where they disagree, and what to do

Switch the lab's measure back and forth on your palette and watch the cells that change color.

  • Passes the ratio, fails APCA. Usually light-on-dark or a dark-on-dark pair. The pair is legal under WCAG 2 and marginal in practice. If it is body text, pick a different pair. If it is a border, it is probably fine.
  • Fails the ratio, passes APCA. Usually a saturated mid-tone on white where the ratio lands at 4.3:1 and APCA says Lc 70. The pair is illegal for WCAG 2 conformance and readable in practice. If conformance matters, change it. The lab shows the numbers so you can make that call knowing what you are trading.
  • Both pass or both fail. Nothing to decide.

The useful rule: when the two methods disagree, treat the pair as marginal and move on to one they agree about. There are always more pairs.

Which number to report

If someone asks "does this pass," they mean WCAG 2 unless they say otherwise, and the answer is the ratio against 4.5:1 or 3:1. Report that. If you are designing and want to know whether something will be readable, look at both, and believe APCA about polarity and the dark end. The agent ruleset uses the WCAG 2 ratio for AW-COLOR-001 for exactly this reason: it is the number that can be defended. To see which way a failing pair has to move, and why one color cannot be fixed for a light and a dark background at once, open the Contrast Circuit.

Open the companion lab

  • Charts that still read when printed in grey

    A chart passes when it still carries its message on a grayscale printer. That means three lightness levels, not three hues; dash and shape before pattern; and labels on the data instead of a legend. This is the rule every chart on this site follows, written down.

  • Fix a failing color with the smallest move

    A color fails contrast and you want to change it as little as possible. There are two short paths, lightness alone and a mix toward black or white. They often end at the same place, and when they do not, the difference is hue. Here is how far each one travels, with numbers.

  • Build a palette that passes every pair

    Not every pair in a palette has to pass. Every pair you use has to. Here is how to build a palette where the allowed pairs are obvious and the forbidden ones are hard to reach for.

Spotted something this note gets wrong?

Corrections and better examples are the best kind of message.

Send a correction