-
Notifications
You must be signed in to change notification settings - Fork 101
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
[BUG] Outdaded SrGB value calculation #391
Comments
calculation of this is in ColorContrastViewModel.cs |
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 makes 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, and this is the threshold value of 0.04045 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 |
Describe the bug
Per WCAG bug Non-sRGB color spaces, outdated sRGB threshold, and other issues in the "relative luminance" definition
the number used to calculate relative luminance is incorrect.
Additional context
Blocked until WCAG bug gets resolved.
The text was updated successfully, but these errors were encountered: