About WCAG color contrast
The Web Content Accessibility Guidelines (WCAG) 2.1 define minimum contrast ratios between text and its background so content stays legible for users with low vision or color-vision differences. The ratio is calculated from the relative luminance of each color and ranges from 1:1 (identical) to 21:1 (pure black on pure white).
- AA — Normal text: at least 4.5:1.
- AA — Large text (≥18pt, or ≥14pt bold): at least 3:1.
- AAA — Normal text: at least 7:1.
- AAA — Large text: at least 4.5:1.
- UI components & graphical objects: at least 3:1 against adjacent colors.