Foreground and Background Contrast
Contrast relates the relative luminance of foreground and background under a defined method. Text and interactive indicators should remain distinguishable where they appear.
- Source
- Anbloq
- Language
- English
- Created
- Updated
- Chapters
- 2
- Reading time
- 1 min
In this article2 chapters
Work a simple ratio
For a white foreground with luminance one and black background with zero, the WCAG contrast calculation is \((1+0.05)/(0+0.05)=21\). This differs from a ratio of RGB channel numbers. Visible focus also depends on the surrounding colors.
Check actual states
Measure text and required indicators in normal, hover, and focused contexts as appropriate. When information is also encoded as color, provide a non-color cue.[1][2]