Skip to content
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

Outdated relative luminance threshold #1629

Closed
SashimiEthan opened this issue Jun 12, 2019 · 3 comments
Closed

Outdated relative luminance threshold #1629

SashimiEthan opened this issue Jun 12, 2019 · 3 comments
Labels
color contrast Color contrast issues feat New feature or enhancement needs discussion More discussion is needed to continue

Comments

@SashimiEthan
Copy link

SashimiEthan commented Jun 12, 2019

Expectation: << Describe what you expect the product to do >>
Use the correct relative luminance threshold: 0.04045

Actual: << Describe what the product actually does >>
The current threshold 0.03928 used in the sRGB definition is outdated.

There is already a bug filed against this issue in the wcag repo: w3c/wcag#360

Motivation: << Describe why you want the behavior to be changed >>
Although there will be no visible difference in calculated contrast ratio from using the draft or the final standard threshold values, please refer to the discussions in the wcag repo for the detailed justification. I'm not an expert in color spaces. Our company Microsoft's accessibility tool is using this library, so just wanted to bring this to your attention.


axe-core version: current
@straker straker added color contrast Color contrast issues feat New feature or enhancement needs discussion More discussion is needed to continue labels Jun 12, 2019
@straker
Copy link
Contributor

straker commented Jun 12, 2019

Thanks for letting us know about the outdated threshold. I'll bring this up and see if we're ready to update the threshold in axe before the wcag issue is accepted and all the specs are updated.

@Myndex
Copy link

Myndex commented Jul 10, 2019

I am the W3C member who is working on these issues in the WCAG. The correct threshold for the reverse transform (going to linear) is 0.04045 and this should be used, not 0.03928 as incorrectly listed in the WCAG Understanding document. Also, the sRGB working draft from 1996 is not the standard, IEC 61966-2-1:1999 is the relevant international standard for sRGB.

There is no real reason to use the incorrect threshold. In terms of the WCAG contrast measurement, it functionally make no difference, but it can make a difference if you are using the equation for image processing. As a matter of best practices, the correct math should be used for converting sRGB to linear RGB.

For background, the reason for the change from the original sRGB draft has to do with a discontinuity at the intercept between the power curve and the linearized segment.

There are some color transform libraries that use a more accurate (more decimal places) method which is advisable if you are doing multiple round trips for image processing applications. In the case of the reverse transform this is 0.0404482 (IEC rounded to 0.04045). This is discussed to some degree in the Wikipedia page on the subject.

Nevertheless the DEFINED STANDARD is 0.04045

@WilcoFiers
Copy link
Contributor

I'm going to close this issue. I think staying consistent with the normative requirements from WCAG is very important for the work, even if the math is wrong. The place to fix this is in the WCAG standard. W3C can publish an errata to WCAG. We'll update it if/when this happens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
color contrast Color contrast issues feat New feature or enhancement needs discussion More discussion is needed to continue
Projects
None yet
Development

No branches or pull requests

4 participants