def rgb_to_hsv(r, g, b, a=255): hsv = colorsys.rgb_to_hsv(r / 255.0, g / 255.0, b / 255.0) hsv255 = [int(each * 255) for each in hsv] return hsv255