PyDocs

Multimedia Services

Multimedia Services

colorsys

Conversion functions between RGB and other color systems.

This modules provides two functions for each color system ABC:

  rgb_to_abc(r, g, b) --> a, b, c
  abc_to_rgb(a, b, c) --> r, g, b

All inputs and outputs are triples of floats in the range [0.0...1.0]
(with the exception of I and Q, which covers a slightly larger range).
Inputs outside the valid range may cause exceptions or invalid outputs.

Supported color systems:
RGB: Red, Green, Blue components
YIQ: Luminance, Chrominance (used by composite video signals)
HLS: Hue, Luminance, Saturation
HSV: Hue, Saturation, Value
Symbols in colorsys

h

hls_to_rgb
Convert the color from HLS coordinates to RGB coordinates.
hsv_to_rgb
Convert the color from HSV coordinates to RGB coordinates.

r

rgb_to_hls
Convert the color from RGB coordinates to HLS coordinates.
rgb_to_hsv
Convert the color from RGB coordinates to HSV coordinates.
rgb_to_yiq
Convert the color from RGB coordinates to YIQ coordinates.

y

yiq_to_rgb
Convert the color from YIQ coordinates to RGB coordinates.