-
Notifications
You must be signed in to change notification settings - Fork 574
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
Fix: Fix colorHex to handle alpha values #1441
base: main
Are you sure you want to change the base?
Conversation
This pull request is automatically being deployed by Amplify Hosting (learn more). |
3ce1ed3
to
edabe47
Compare
Hi, I think this is mostly an oversight to be honest, I actually would prefer if we didn't have 2 transforms in the first place and just have 1 that handles both hex8 but also uses hex6 when the alpha channel is set 1. And can we add some tests to the PR? |
@jorenbroekema Thank you for the info and feedback.
|
Issue #, if available:
Description of changes:
By default, when using the
js
transformGroup, all tokens are converted into hex values (for example,#000000
) before additional transforms are applied. Forrgba
tokens, this causes the color values to lose the transparency value, resulting in all tokens to default to#xxxxxxFF
(full opacity).This PR fixes the default transform to use
hex8
to account for RGBA transforms.I'm not entirely sure if there is a historical reason for using
colorHex
instead ofcolorHex8
forjs
transforms, but if this is not an oversight, I would appreciate if someone can share some details. Otherwise, I hope this PR helps. 🙇By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.