@opena11y/apca
v0.1.0
Published
APCA Lc contrast for a text/background pair. npm @opena11y — not affiliated with OpenA11y on GitHub.
Readme
@opena11y/apca
APCA lightness contrast (Lc) for a text/background pair.
npm @opena11y. Not affiliated with OpenA11y on GitHub.
Wraps apca-w3. Do not reimplement the formula.
Evidence: apca. Not WCAG 2 4.5:1. Not WCAG 3.
For agents
Text color first, background second. Do not swap.
import { apca } from "@opena11y/apca";
apca("#111", "#fff");
// { lc: 105, polarity: "BoW", evidence: "apca", ... }Negative lc is light text on a dark background (WoB).
CLI:
opena11y apca <text> <background>
opena11y apca <url> --selector <css>Do not report this as WCAG AA or as an axe pass.
For humans
Perceptual contrast for self-illuminated displays. Use when WCAG 2 ratios look fine but type still fails to read (grey-on-grey).
