-
Notifications
You must be signed in to change notification settings - Fork 3.4k
CIE Lab color conversion, for the L component #1182
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
Comments
we already have alot of colour functions... it really depends if it will be useful for lots of people. If it is a minority I would suggest it should be a plugin - though our support for plugins is limited ;( |
The argument about a minority is irrelevant. This function would be much more valuable than the existing lightness(@color) function. |
While Lab is more accurate, it's definitely less valuable in that it's not specifically needed by anything. Lightness and toHSL are used in a lot of places. L in Lab isn't the same thing as L in HSL (your point), but it's not a meaningful replacement either. |
There exists the luma function which is better than lightness and looks similar to the L component of Lab, but why is HSL used for the lighten and darken functions? |
And the same issue with the spin function. Equidistant colors obtained with it have different perceived brightness. |
Luma only gets the perceptual lightness of a color, by using simple math on the RGB components. |
"going from a color and changing the L (from CIELab) component has a complex effect on saturation, hue and brightness" Yes, it has, and this effect is much more nice-looking than the effect of changing Lightness in HSL. |
@thorn0 actually I agree with you about lighten/darken and spin. There's no particular reason to use HSL for them other than convenience since the HSL implementation was already there. One other factor is that there is no browser support for Lab, whereas all the other spaces are supported, so no matter what you do in Lab, you'll need to convert back to some other space. |
I was thinking about doing different math : let's suppose we start with |
Actually all the maths is already implemented in chroma.js, and I don't think it's worth reimplementing it. It would rather be cool if Less just used chroma.js to do color maths. Also would be great to have color scales as first-class citizens. |
Implement as a plugin (first). See #1853 for more on the current "new color functions" approach. |
For reference, Lab and LCH colors in the CSS spec draft: |
Hi,
Would adding CIELab conversion in order to benefit from the L channel be out of scope for Less ? HSL or HSV are convenient and simple, but perceptually, changing L/S ot V/S is often far less efficient than moving the L channel.
I happen to rely on the Lab color space very often in web design and digital painting.
I'm considering adding such a feature to Less but won't if you believe it has no practical use.
Thanks.
The text was updated successfully, but these errors were encountered: