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

HSL to HSV conversion incorrect #27

Closed
matthew-banning opened this issue Jan 29, 2021 · 1 comment
Closed

HSL to HSV conversion incorrect #27

matthew-banning opened this issue Jan 29, 2021 · 1 comment

Comments

@matthew-banning
Copy link

The conversion from HSL to HSV appears incorrect:

echo Factory::init("hsv(0, 50%, 50%)")->toHsl() // hsl(0, 33%, 38%) (correct values)
echo Factory::init("hsv(0, 50%, 50%)")->toHsl()->toHsv() // hsv(0,100%,76%) (wrong values)
@ozdemirburak
Copy link
Owner

You are right. Thanks for reporting this. I'll patch it now. But the second example will probably give an error because of rounding as 50.5 will become 51. So, try: "hsv(0, 50%, 51%)". See a related discussion here. I am open to any solutions, though.

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