Skip to content
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

Color Transforms #2946

Open
fokkerone opened this issue Jul 1, 2024 · 2 comments
Open

Color Transforms #2946

fokkerone opened this issue Jul 1, 2024 · 2 comments
Assignees

Comments

@fokkerone
Copy link
Contributor

fokkerone commented Jul 1, 2024

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:

  1. Add a Color Modifier Token
  2. Choose darken, lighten
  3. Choose hsl in color model
  4. Calculated Values are complete wrong based on other color transformer/math or libraries.
  5. 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
Bildschirmfoto 2024-07-01 um 13 14 28

@sheila-semrush
Copy link

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.

image image

@keeganedwin
Copy link
Collaborator

Hey @fokkerone, I see that you're a part of our slack community. Does this thread perhaps address the same issue as the ticket?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 📥 Triage
Development

No branches or pull requests

4 participants