Input your colors below to check if they respect accessiblity recommendations.
Foreground color
Background color
Contrast:
1:1
A quick brown fox jumps over the lazy dog.
The fox is quicker indeed.
What is color contrast?
Color contrast is a unit which measures the difference in luminance between two overlapping colors (text and background, for example). As a unit that doesn't depend on the hue of a color but on its luminance, it helps determine the accessibility of different color combinations. WCAG (Web Content Accessibility Guidelines) requires a contrast level of at least 4.5:1 (The higher the number, the more contrasted the two colors are). You can use the tool above to test whether your foreground and background colors have adequate contrast.
How is color contrast calculated?
W3C defines the following formula to calculate the luminance of a color in RGB units:
⎩⎨⎧R0=255RG0=255GB0=255B⎩⎨⎧if R0<=0.03928 then RsRGB=12.92R0 else RsRGB=(1.055R0+0.055)2.4if G0<=0.03928 then GsRGB=12.92G0 else GsRGB=(1.055G0+0.055)2.4if B0<=0.03928 then BsRGB=12.92B0 else BsRGB=(1.055B0+0.055)2.4L=0.2126R+0.7152G+0.0722B
With the luminance of the two colors, the contrast ratio is caculated with the following formula: