hue-python-rgb-converter icon indicating copy to clipboard operation
hue-python-rgb-converter copied to clipboard

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

Open WizBangCrash opened this issue 7 years ago • 0 comments

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 :-)

WizBangCrash avatar Jul 15 '17 19:07 WizBangCrash