Noindex support page · W3C source checked 2026-10-01
Method and sources
This worksheet implements the WCAG 2.2 relative-luminance and contrast-ratio arithmetic for opaque six-digit sRGB colors. Its explanations are informative; the linked WCAG Recommendation is normative.
Arithmetic
- Convert each 8-bit channel to encoded sRGB by dividing by 255.
- Linearize each channel: when the encoded value is at most 0.04045, divide by 12.92; otherwise use
((value + 0.055) / 1.055) ^ 2.4. - Compute relative luminance:
L = 0.2126R + 0.7152G + 0.0722B. - Compute contrast:
(lighter L + 0.05) / (darker L + 0.05).
Threshold decisions use the unrounded result. Displayed ratios are rounded only after the pass/fail comparison.
Role thresholds implemented
| Declared role | AA | AAA | Source criterion |
|---|---|---|---|
| Regular text | 4.5:1 | 7:1 | SC 1.4.3 / SC 1.4.6 |
| Large text | 3:1 | 4.5:1 | SC 1.4.3 / SC 1.4.6 |
| Required UI/state/graphical information | 3:1 | Not evaluated | SC 1.4.11 |
| Surface or decorative | No threshold by itself | No threshold by itself | May still be the adjacent color for another role |
Primary sources
- WCAG 2.2 — relative luminance definition
- WCAG 2.2 SC 1.4.3 — Contrast (Minimum)
- WCAG 2.2 SC 1.4.6 — Contrast (Enhanced)
- WCAG 2.2 SC 1.4.11 — Non-text Contrast
- W3C Understanding SC 1.4.3 — informative explanation, including unrounded threshold comparison and expected adjacency.
- W3C Understanding SC 1.4.11 — informative explanation of adjacent colors and required visual information.
NOT_A_FULL_ACCESSIBILITY_AUDITThe worksheet does not inspect markup, rendered context, states, exceptions, font metrics, anti-aliasing, or any other WCAG success criterion.