In WCAG 2, contrast is a measure of the difference in perceived "luminance" or
brightness between two colors (the phrase
"color contrast" is never used in WCAG)
This brightness difference is expressed as a ratio ranging from 1:1 (e.g.
white on white) to 21:1 (e.g., black on a white)
If text and background colors are swapped, the contrast ratio remains the same
Color Contrasts
Color
Color code
Contrast Ratio
White
#FFFFFF
1
1
Yellow
#FFFF00
1:1.07
1.07
Cyan
#00FFFF
1:1.25
1.25
Green (lime)
#00FF00
1: 1.4
1.4
Magenta
#FF00FF
1:3.13
3.13
Red
#FF0000
1:4
4
Blue
#0000FF
1:8.6
8.6
Black
#000000
1:21
21
WCAG Guidelines
minimum (AA level)
The visual presentation of text and images of text has a contrast ratio of at
least
4.5:1
Exception: Large-scale text and images of large-scale text have a contrast ratio
of
at least 3:1