contrast ratio
A number from 1:1 to 21:1 comparing the relative luminance of text and its background, used by WCAG to judge readability.
In more detail
The formula is (lighter + 0.05) divided by (darker + 0.05), using relative luminance. WCAG level AA requires at least 4.5:1 for normal text and 3:1 for large text and for the edges of controls and icons. Black on white is 21:1.
Related terms
- relative luminance — How bright a colour is on a scale from 0 (black) to 1 (white), computed from its sRGB red, green and blue values.
- WCAG — The Web Content Accessibility Guidelines, the W3C standard that defines testable requirements for making web content accessible.
- WCAG conformance level — One of WCAG's three grades, A, AA and AAA, where each level includes all requirements of the levels before it.
- APCA — The Accessible Perceptual Contrast Algorithm, a newer way to score text contrast that accounts for font size, weight and whether text is light on dark or dark on light.
Taught in
- Modern Color Spaces: OKLCH, Gamut Mapping & APCA Contrast — Design Systems & Component Engineering
- Visual Contrast Auditing: Color Blindness & Reduced Motion — Design Systems & Component Engineering