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

RGB value of (0,0,0) causes divide by zero error #6

Open
WizBangCrash opened this issue Jul 15, 2017 · 0 comments
Open

RGB value of (0,0,0) causes divide by zero error #6

WizBangCrash opened this issue Jul 15, 2017 · 0 comments

Comments

@WizBangCrash
Copy link

Hi Ben,
I am using your RGB Converter in a project I am doing and noticed that if your rgb_to_xy() method is called with an RGB value of (0,0,0), a divide by zero error occurs.
I have made the following change to the method:
if not (red or green or blue):
point = XYPoint(0,0)
else:
point = self.color.get_xy_point_from_rgb(red, green, blue)
return (point.x, point.y)

I thought you'd like to know.
Thanks for the classes they are very useful :-)

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