Check foreground and background colors against WCAG contrast thresholds.
The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.
Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.
Relative luminance is computed for foreground and background, then the lighter value plus 0.05 is divided by the darker value plus 0.05. The ratio is compared with WCAG thresholds that vary by text size and weight.
Input1: #000000 Input2: #FFFFFF
Original: Foreground: #000000 Modified: Background: #FFFFFF Contrast Ratio: 21.00:1 WCAG AA Normal Text (4.5:1): PASS WCAG AA Large Text (3:1): PASS WCAG AAA Normal Text (7:1): PASS WCAG AAA Large Text (4.5:1): PASS
Design tokens, component states, and link colors are checked for accessibility.