Color Transforms
Describe the bug If you add color modifier using PRO Token studio Version Color transform based on HSLA calucated/modified values are mostly wrong.
To Reproduce Steps to reproduce the behavior:
- Add a Color Modifier Token
- Choose darken, lighten
- Choose hsl in color model
- Calculated Values are complete wrong based on other color transformer/math or libraries.
- See error
Expected behavior Color Transforms on HLSA should be accurate and do not create falsy values see screenshot color value of hsla(100, 100& 50%, 1) darken by 20% should become hsla(100, 100& 40%, 1)
like here...simply math : Lighten color by 20% is 50%(light) * 0.8 = 40%
Screenshots or Screencasts
It seems that the error is only in displaying the resulting hsl/lch value in the token properties window.
Actual color is correct, save for minimal rounding error.
For example, on this screenshot, when applying lighten 0.5 to #000, TS displays the result as lch(75 0 0), when the value is actually lch(50 0 0), or #777. The resulting hex is correct, both in the token tooltip and when applying the token to objects.
Hey @fokkerone, I see that you're a part of our slack community. Does this thread perhaps address the same issue as the ticket?