def rgb_to_hsv(red, green, blue): """Convert an RGB tuple to an HSV tuple.""" hue, saturation, value = colorsys.rgb_to_hsv(red/255, green/255, blue/255) return int(hue*360), int(saturation*100), int(value*100)