-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
luma/luminance named incorrectly? #2829
Comments
The spec is rather blurry on the naming because it calls it "relative luminance" in one place and "relative brightness" on the next line. "Luma" is not mentioned at all. So the question comes down to this: Is the spec actually refering to luma (then the current naming in Less would be correct) or is it using the right word? One major source of confusion for me is the term "gamma correction/compression". Does it refer to the encoding or the decoding step? And which of these is the one described in the spec? Here is a quote from wikipedia:
Reading this again closely I get the impression that you are right and the spec is wrong. The RGB colors we usually use are in the sRGB color space (multiplied by 255), so the relative luminance can be calculated with the above formular. The spec says that you have to apply some non-linear conversion first, so it is most definitely refering to luma. But I am still very confused. Do you think I should file a bug report with https://github.com/w3c/wcag/? |
No, it's correct - that relative luminance is what we're calling luminance. luma uses the same coefficients, but applied to gamma-corrected RGB values rather than the linear ones. sRGB defines the gamma transform that's applied, which you can see in the less luma code. You'll see the luma calc written like this:
The
In short, there's nothing to worry about... |
Actually, I see what you mean about the WCAG page - it does refer to gamma-corrected luminance (i.e. luma) as relative luminance. The luminance wikipedia page is clearer in its definitions, and agrees with what Less does. |
Yes, I guess we discussed the naming when it was implemented in #1890. And it looks more to be correct as it is now (after all it's all about more a common convention and that's where WCAG wordings are not always issue free :). So I guess it's safe to close this. |
Closing as not an issue. |
I sent a mail to w3c-wai-ig@w3.org and wanted to wait for that discussion before closing this issue. Unfortunately I did not get much response. |
Hi Xi, I am researching. Thanks, Moe |
Just to mention, the W3C/WCAG is in error in some of the explanations, a fact I am working to correct in WCAG issue 695 among others. Super fast summary: Luminance (Y of CIEXYZ) is LINEAR with no gamma correction. It is NOT perceptually uniform, it is linear like light in the real world. It IS spectrally weighted, so the tristimulus values (R G B) fit to human perception, but the total measure from black to white is linear. Luma (Y´that is, y-prime) has a gamma curve applied for the video system it is used with. L* is perceptual lightness, a perceptually uniform curve that is part of CIELAB and CIELUV. L* a* b* is a perceptually uniform colorspace. 0 and 100 are essentially the same for Y, Y´and L*, but the values in between vary greatly due to the different curves. For a scale 0 to 100:
This is part of WCAG issue 695. Read Charles Poynton's Gamma FAQ and Color FAQ for a great start on a complicated topic. |
I am not completely sure about this, but if I undestand this document and this article correctly, the names of
luma
andluminance
need to be swapped.I understand that fixing this would be a breaking change. However, I feel that less is an important reference for web designers getting into color theory, so fixing this could prevent a lot of confusion.
The text was updated successfully, but these errors were encountered: