Contrast Equation:
From: | To: |
The contrast ratio measures the difference in luminance between two colors. It's a dimensionless value ranging from 1:1 (no contrast) to 21:1 (maximum contrast between black and white).
The calculator uses the WCAG contrast ratio formula:
Where:
Explanation: The equation compares the relative brightness of two colors, with higher values indicating greater contrast.
Details: Contrast ratio is crucial for accessibility, particularly for visually impaired users. WCAG recommends minimum contrast ratios for text readability (4.5:1 for normal text, 3:1 for large text).
Tips: Enter relative luminance values between 0 and 1 for both light and dark colors. The calculator will compute the contrast ratio between them.
Q1: What is relative luminance?
A: Relative luminance is the brightness of a color normalized to 0 for darkest black and 1 for brightest white.
Q2: What are good contrast ratios?
A: For AA compliance: 4.5:1 for normal text, 3:1 for large text. For AAA: 7:1 for normal text, 4.5:1 for large text.
Q3: How do I get relative luminance values?
A: They can be calculated from RGB values using a standard formula that accounts for human perception of different color channels.
Q4: Why add 0.05 in the formula?
A: This offset prevents division by zero and accounts for ambient light in typical viewing conditions.
Q5: Can I use this for color combinations?
A: Yes, this works for any two colors where you know their relative luminance values.