colorsys
â Conversions between color systems¶
Source code: Lib/colorsys.py
The colorsys
module defines bidirectional conversions of color values between colors expressed in the RGB (Red Green Blue) color space used in computer monitors and three other coordinate systems: YIQ, HLS (Hue Lightness Saturation) and HSV (Hue Saturation Value). Coordinates in all of these color spaces are floating-point values. In the YIQ space, the Y coordinate is between 0 and 1, but the I and Q coordinates can be positive or negative. In all other spaces, the coordinates are all between 0 and 1.
The colorsys
module defines the following functions:
Convert the color from RGB coordinates to YIQ coordinates.
Convert the color from YIQ coordinates to RGB coordinates.
Convert the color from RGB coordinates to HLS coordinates.
Convert the color from HLS coordinates to RGB coordinates.
Convert the color from RGB coordinates to HSV coordinates.
Convert the color from HSV coordinates to RGB coordinates.
Example:
>>> import colorsys >>> colorsys.rgb_to_hsv(0.2, 0.4, 0.4) (0.5, 0.5, 0.4) >>> colorsys.hsv_to_rgb(0.5, 0.5, 0.4) (0.2, 0.4, 0.4)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4