From 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 7 Apr 2024 13:41:34 -0500 Subject: new repository --- devdocs/python~3.12/library%2Fcolorsys.html | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 devdocs/python~3.12/library%2Fcolorsys.html (limited to 'devdocs/python~3.12/library%2Fcolorsys.html') diff --git a/devdocs/python~3.12/library%2Fcolorsys.html b/devdocs/python~3.12/library%2Fcolorsys.html new file mode 100644 index 00000000..ed442b59 --- /dev/null +++ b/devdocs/python~3.12/library%2Fcolorsys.html @@ -0,0 +1,29 @@ +

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.

See also

More information about color spaces can be found at https://poynton.ca/ColorFAQ.html and https://www.cambridgeincolour.com/tutorials/color-spaces.htm.

The colorsys module defines the following functions:

+colorsys.rgb_to_yiq(r, g, b)
+

Convert the color from RGB coordinates to YIQ coordinates.

+
+colorsys.yiq_to_rgb(y, i, q)
+

Convert the color from YIQ coordinates to RGB coordinates.

+
+colorsys.rgb_to_hls(r, g, b)
+

Convert the color from RGB coordinates to HLS coordinates.

+
+colorsys.hls_to_rgb(h, l, s)
+

Convert the color from HLS coordinates to RGB coordinates.

+
+colorsys.rgb_to_hsv(r, g, b)
+

Convert the color from RGB coordinates to HSV coordinates.

+
+colorsys.hsv_to_rgb(h, s, v)
+

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)
+
+

+ © 2001–2023 Python Software Foundation
Licensed under the PSF License.
+ https://docs.python.org/3.12/library/colorsys.html +

+
-- cgit v1.2.3