Expand description
APCA lightness contrast (Lc), informative only.
The Accessible Perceptual Contrast Algorithm, as published with the WCAG 3 working draft (APCA-W3, constants of version 0.0.98G): a contrast that depends on which colour is the text and which the background, and on their polarity. Lc runs from about -108 (white text on black) to about 106 (black text on white); its sign says the polarity (positive: dark text on a light background), its size how readable the text is (Lc 60 is the floor for ordinary text, Lc 75 for body text, Lc 45 for large text and solid interface parts).
egui-pop’s theme contract stays on WCAG 2.x (crate::contrast):
Lc is used where a direction must be chosen, to pick the text colour
of an accent fill and to set the fill’s lightness
(crate::palette), and shown beside the WCAG ratio. This is a
reimplementation of the published formula; egui_colors (MIT) does
the same (estimate_lc).
Functions§
- lc
- The lightness contrast of
textoverbackground, alpha ignored (a translucent text is first painted over the background). Positive for dark text on a light background, negative for light text on a dark one; 0 when the two are too close to tell.