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

ZeroDivisionError in Python-2.7.3/Lib/colorsys.py #7

Open
valawilliams opened this issue Jul 17, 2018 · 0 comments
Open

ZeroDivisionError in Python-2.7.3/Lib/colorsys.py #7

valawilliams opened this issue Jul 17, 2018 · 0 comments

Comments

@valawilliams
Copy link

line 77 in rgb_to_hls divides by 2.0-maxc-minc which is sometimes zero.
Fix by inserting before line 74
if (2.0-maxc-minc) == 0:
return(0.0, l, 0.0)
similar to lines 72-73.
Error also exists in python 3 library.

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

1 participant