-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
Incorrect conversion from HEX to HSL* with this color. #56
Comments
I just found another conversion issue from hsl to hex or rgb but I think it's better to open another issue for that. |
The maths used for HEX/RGB to HSL conversion does sometimes output a negative value for hue, but However, the hue could be normalised before being so that it is always between 0 and 360.
edit: I just saw that the markdown preview for |
I just created a pull-request with a fix for this issue, it simply normalizes the negative value for the hue. |
Thanks for the PR! 🙌 |
Hi, I just found this issue trying to convert
#DC3545
to an hsl value, thehue
returned is-5.748502994012
instead of354
.You can try this method inside FactoryTest::class:
This is part of the tests output:
Maybe the issue is here
color/src/Convert.php
Line 104 in fafbf89
The hex to rgb conversion is fine, the rgb value returned is 220, 53, 69, so it should be only the rgb to hsl in the line above.
The text was updated successfully, but these errors were encountered: