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.
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.
|
andronocean
left a comment
There was a problem hiding this comment.
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)
andronocean
left a comment
There was a problem hiding this comment.
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
hslcolors by converting it tohslainstead ofrgba.e.g.