-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
feat: transform hsl
to hsla
#3850
Conversation
const [r, g, b, a] = toRgba(color) | ||
const isHSL = color.startsWith('hsl') | ||
|
||
const [i, j, k, a] = isHSL ? toHsla(color) : toRgba(color) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use generic component names because we don't know if it will be rgb
or hsl
Looking good, I noticed you still have this set as a draft so just let me know when you'd like me to look into merging 👍🏻 Thanks! |
Yess, I saw that |
e6e8d4e
to
7d48da0
Compare
7d48da0
to
74e496b
Compare
@adamwathan it should be ready to be merged if it passes the tests |
Codecov Report
@@ Coverage Diff @@
## master #3850 +/- ##
==========================================
+ Coverage 93.34% 93.37% +0.02%
==========================================
Files 178 178
Lines 1849 1857 +8
Branches 332 342 +10
==========================================
+ Hits 1726 1734 +8
Misses 105 105
Partials 18 18
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't quite right. The saturation and lightness parameters in hsl()
or hsla()
colors are percentages, not numbers, so they need to be followed by the %
symbol. The tests pass, but the tests are expecting the wrong values. (See MDN description)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me 😎 (Thank you @fedeci !)
Hey @adamwathan, any way to get this merged this week or next? It'd be really helpful 🙏 |
Thanks! Will try get this out in a patch soon. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #3850 +/- ##
==========================================
+ Coverage 93.34% 93.37% +0.02%
==========================================
Files 178 178
Lines 1849 1857 +8
Branches 332 342 +10
==========================================
+ Hits 1726 1734 +8
Misses 105 105
Partials 18 18 ☔ View full report in Codecov by Sentry. |
This fixes #3834
We preserve the
hsl
colors by converting it tohsla
instead ofrgba
.e.g.