hue-python-rgb-converter
hue-python-rgb-converter copied to clipboard
RGB value of (0,0,0) causes divide by zero error
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 :-)