Updating base transforms #4303
JaKeenan0922
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Proposal for improvement: Add oklch color space support to less and update transform functions to use oklch instead.
Why?
Less.js transform functions (fade, lighten, darken, etc.) utilize RGB and HSL color spaces when performing transformations. These color spaces are not perceptually uniform, meaning that the intended effect is not consistent across all colors. The OKLCH color space compensates for human perception and adjusts available colors accordingly. See the first link and scroll down to see visual examples.
What is oklch?
OKLCH is a perceptually uniform color space that supports P3 wide color gamut. The support for P3 is important because currently if an OKLCH color is given to less it would then be converted to HSL or RGB which will change the color beyond the intended effect.
Quick Reading
MDN Docs on OKLCH
In depth technical explanation of why oklch is better than alternatives
Beta Was this translation helpful? Give feedback.
All reactions