-
Notifications
You must be signed in to change notification settings - Fork 220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question about the contrast. rgb < 0.03928 or rgb <= 0.03928 ... #41
Comments
At |
The old W3C formula was incorrect (0.03928) as it was citing an obsolete reference. It was corrected in WCAG 2.1/2.2 around May 2021. The correct value is 0.04045Also, it is for rgb values normalized to 0.0-1.0:
OR Less than or equal, then it's divided by 12.92, greater than it is the offset power function. Cheers, Andrew Somers |
@Myndex https://www.w3.org/TR/WCAG/#dfn-relative-luminance still gives the value of 0.03928 in WCAG 2.1. It seems to be corrected only in WCAG 2.2: https://www.w3.org/TR/WCAG22/#dfn-relative-luminance |
Hi @stof
My bad for not providing links. It is listed in the errata for 2.0 and 2.1:https://www.w3.org/WAI/WCAG20/errata/#substantive And the latest corrected 2.1 understanding:https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum#dfn-relative-luminance And in MathML https://www.w3.org/WAI/WCAG21/Understanding/relative-luminance.html Please let me know if you have any questions. |
Well, given the section defining the relative luminance has nothing mentioning the existence of this errata, it is quite hard to discover it (the only way to discover it would be to read the entire spec AFAICT) |
Hi @stof Yes, there is no doubt the W3's own site is confusing and hard to navigate¹. Your comments are useful, and this issue is something I'll bring up to leadership. One of the reasons it was finally corrected is because while it doesn't seem to make any difference in 8 bit color, future color spaces are 10 bit or 12 bit, and it does make a difference for them. Note ¹ my opinion only in this case, LOL |
Hello and thank you for sharing his project.
I have a little question.
In your script color.js
Meaning:
if RsRGB < 0.03928 then R = RsRGB/12.92 else R = ((RsRGB+0.055)/1.055) ^ 2.4
On the w3c page:
if RsRGB <= 0.03928 then R = RsRGB/12.92 else R = ((RsRGB+0.055)/1.055) ^ 2.4
It should be:
Or do you change it for any good reason ?
https://www.w3.org/TR/WCAG/#contrast-minimum
The text was updated successfully, but these errors were encountered: