Given a foreground and a background, the nearest accessible color — measured perceptually in OKLAB.
Body copy at a regular reading size. Long-form content like articles, documentation, and product descriptions all sit in this size range — where contrast matters most for sustained reading.
Fine print. Footnotes, captions, metadata, and other secondary text. WCAG’s normal-text threshold (4.5:1) was set with text at this size in mind — and is the most commonly required level.
Replaces your foreground with the nearest compliant color above.
WCAG defines minimum contrast ratios between text and its background. 4.5:1 is the standard for normal body text (AA), 3:1 covers large or bold text and UI components, and 7:1 is the stricter AAA target.
OKLAB is perceptually uniform — equal numerical distances correspond to roughly equal visual distances. Searching here, rather than in raw RGB, finds a substitute that looks close to your original, not just one that’s mathematically near in the wrong space.
A two-pass search across the sRGB cube: a coarse sweep filters for colors meeting your contrast target, then a fine pass refines the winner. The result is the smallest perceptual jump that still passes.