My designer colleague just brought to my attention that he has different results for contrast from different tools. How is that possible?
He did the comparison for a ~Portage color #9E83F5 with white with the following, proven, tools:
The tools return contrast values that differ by 0.5 sometimes, which is considerable. We made sure that both tools actually got the same colour code, which is the case.
I was convinced that the algorithm was specified as part of the WCAG, and this seems the case. There even is a MathML version of the relative luminance definition
(L1 + 0.05) / (L2 + 0.05), where
- L1 is the relative luminance of the lighter of the colors, and
- L2 is the relative luminance of the darker of the colors.
the relative luminance of a color is defined as L = 0.2126 * R + 0.7152 * G + 0.0722 * B […]
the relative luminance of a color is defined as L = 0.2126 * R + 0.7152 * G + 0.0722 * B […]
My conclusion would be that one of the tools has a bug and does not conform to WCAG’s definition.
Or is there any nuance that I’m unaware of, that would explain these differences?