-
-
Notifications
You must be signed in to change notification settings - Fork 209
-
-
Notifications
You must be signed in to change notification settings - Fork 209
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
parseToRgb / parseToHsl float precision expected by the regex #634
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
polished
version: 4.2.2The bug looks similar to the #610 with the
alpha
which fail from a 3-digit decimal. But this bug is about the hue/saturation/lightness values.polished/src/color/parseToRgb.js
Line 14 in a6c55c8
Because the
parseToHsl
can return a "long" float decimal, using it as a literal string can generate error.The code below is in a bug reproduction logic, because the lib allow to use the hsl as an object (
HslColor | HslColor
types).Additional context
But my goal is to get/generate
hsl
props programmatically from a hex/rgb value without doing extra work like Math.round() / parseFloat() / .toFixed() since the polished lib looks to already do it for other functions/methods.Exemple of expected result from using the
parseToHsl
result:Mixin/Helper/Shorthand Usage
What You Are Seeing
What You Expected To See
or possible
parseToHsl
return:Reproduction
Runkit example
The text was updated successfully, but these errors were encountered: