Skip to content
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

asHSLColor() not working as expected #5

Closed
nicolas-t opened this issue Feb 12, 2017 · 1 comment
Closed

asHSLColor() not working as expected #5

nicolas-t opened this issue Feb 12, 2017 · 1 comment

Comments

@nicolas-t
Copy link

nicolas-t commented Feb 12, 2017

Hello !

thanks for this library, i've tried a lot of color extraction php libs and this one is by far the best.

But there's a problem when converting a color to HSL the hue value seems wrong.

$color = new \marijnvdwerf\palette\Color\RGBColor(0.8, 0.5, 0.2)

(string) $color
// => "rgb(204, 128, 51)"
// this is right

(string) $color->asHSLColor()
// => "hsl(0.000000, 60.000000%, 50.000000%)"
// this is wrong

(string) $color->asHSLColor()->asRGBColor()
// => "rgb(204, 51, 51)"
// this is different from the color we entered in the constructor

Best regards,

@marijnvdwerf
Copy link
Owner

Thanks for the report and sorry for the late reply. I managed to fix the bug, and started adding tests because of it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants