WCAG makes readable web text measurable: calculate the contrast ratio between foreground and background colors instead of relying on visual judgment. section 7.4
Choose the applicable minimum ratio:
- Normal text below 18px needs 4.5:1 for AA or 7:1 for AAA. section 7.4.1
- Large text at least 18px, or bold text at least 14px, needs 3:1 for AA or 4.5:1 for AAA. section 7.4.1
- Compute contrast as CR = (L1 + 0.05) / (L2 + 0.05), using the lighter luminance first; results range from 1:1 to 21:1. section 7.4.2
To obtain luminance, normalize sRGB channels to 0–1, linearize each with the piecewise gamma formula, then calculate L = 0.2126Rᵢ + 0.7152Gᵢ + 0.0722Bᵢ. The weighting reflects greater sensitivity to green than blue. section 7.4.3
Blue text on white
Pure blue (#0000FF) has relative luminance 0.0722. Against white with luminance 1, the contrast ratio is 8.59:1, exceeding the AAA threshold for normal text. section 7.4.3 section 7.4.1
CR = (1 + 0.05) / (0.0722 + 0.05) = 1.05 / 0.1222 = 8.59
Verify the blue-on-white result by evaluating the contrast formula with the two luminance values. section 7.4.3


