colorsys.rgb_to_hsv()
colorsys.rgb_to_hsv() is a Python function in the Colorsys Module category. Converts RGB to HSV (hue, saturation, value). The syntax is colorsys.rgb_to_hsv(r, g, b). Returns: (h, s, v) tuple. A typical example: colorsys.rgb_to_hsv(0.0, 1.0, 0.0) # (0.333, 1.0, 1.0) — green as HSV. A close sibling is colorsys.rgb_to_hls(), which converts RGB color values (0-1) to HLS (hue, lightness, saturation). A close sibling is colorsys.hls_to_rgb(), which converts HLS color values back to RGB. A close sibling is colorsys.hsv_to_rgb(), which converts HSV back to RGB. A close sibling is colorsys.rgb_to_yiq(), which converts RGB to YIQ (used in NTSC TV). More about this category: Color system conversions — rgb_to_hls, hls_to_rgb, rgb_to_hsv, hsv_to_rgb. Related Colorsys Module entries: colorsys.rgb_to_hls(), colorsys.hls_to_rgb(), colorsys.hsv_to_rgb(), colorsys.rgb_to_yiq(). This page is part of the free Python Reference documentation covering 978+ functions, methods, and modules with examples and parameter details. You can try colorsys.rgb_to_hsv() immediately in the Python playground, look up unfamiliar terms in the glossary, or return to the Python Reference homepage.