colorsys.rgb_to_yiq()
colorsys.rgb_to_yiq() is a Python function in the Colorsys Module category. Converts RGB to YIQ (used in NTSC TV). The syntax is colorsys.rgb_to_yiq(r, g, b). Returns: (y, i, q) tuple. A typical example: colorsys.rgb_to_yiq(1.0, 0.0, 0.0) # (0.299, 0.596, 0.212). 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.rgb_to_hsv(), which converts RGB to HSV (hue, saturation, value). A close sibling is colorsys.hsv_to_rgb(), which converts HSV back to RGB. 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.rgb_to_hsv(), colorsys.hsv_to_rgb(). 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_yiq() immediately in the Python playground, look up unfamiliar terms in the glossary, or return to the Python Reference homepage.