def rgb_to_hsv(r, g ,b):
"""Convert R(0-255) G(0-255) B(0-255) to H(0-360) S(0-255) V(0-255).
"""
rgb = [x / 255.0 for x in (r, g, b)]
h, s, v = colorsys.rgb_to_hsv(*rgb)
return (h * 360, s * 255, v * 255)
文章目录