summaryrefslogtreecommitdiff
path: root/devdocs/python~3.12/library%2Fcolorsys.html
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
committerCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
commit754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch)
treef1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/python~3.12/library%2Fcolorsys.html
new repository
Diffstat (limited to 'devdocs/python~3.12/library%2Fcolorsys.html')
-rw-r--r--devdocs/python~3.12/library%2Fcolorsys.html29
1 files changed, 29 insertions, 0 deletions
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 @@
+ <span id="colorsys-conversions-between-color-systems"></span><h1>colorsys — Conversions between color systems</h1> <p><strong>Source code:</strong> <a class="reference external" href="https://github.com/python/cpython/tree/3.12/Lib/colorsys.py">Lib/colorsys.py</a></p> <p>The <a class="reference internal" href="#module-colorsys" title="colorsys: Conversion functions between RGB and other color systems."><code>colorsys</code></a> 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.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p>More information about color spaces can be found at <a class="reference external" href="https://poynton.ca/ColorFAQ.html">https://poynton.ca/ColorFAQ.html</a> and <a class="reference external" href="https://www.cambridgeincolour.com/tutorials/color-spaces.htm">https://www.cambridgeincolour.com/tutorials/color-spaces.htm</a>.</p> </div> <p>The <a class="reference internal" href="#module-colorsys" title="colorsys: Conversion functions between RGB and other color systems."><code>colorsys</code></a> module defines the following functions:</p> <dl class="py function"> <dt class="sig sig-object py" id="colorsys.rgb_to_yiq">
+<code>colorsys.rgb_to_yiq(r, g, b)</code> </dt> <dd>
+<p>Convert the color from RGB coordinates to YIQ coordinates.</p> </dd>
+</dl> <dl class="py function"> <dt class="sig sig-object py" id="colorsys.yiq_to_rgb">
+<code>colorsys.yiq_to_rgb(y, i, q)</code> </dt> <dd>
+<p>Convert the color from YIQ coordinates to RGB coordinates.</p> </dd>
+</dl> <dl class="py function"> <dt class="sig sig-object py" id="colorsys.rgb_to_hls">
+<code>colorsys.rgb_to_hls(r, g, b)</code> </dt> <dd>
+<p>Convert the color from RGB coordinates to HLS coordinates.</p> </dd>
+</dl> <dl class="py function"> <dt class="sig sig-object py" id="colorsys.hls_to_rgb">
+<code>colorsys.hls_to_rgb(h, l, s)</code> </dt> <dd>
+<p>Convert the color from HLS coordinates to RGB coordinates.</p> </dd>
+</dl> <dl class="py function"> <dt class="sig sig-object py" id="colorsys.rgb_to_hsv">
+<code>colorsys.rgb_to_hsv(r, g, b)</code> </dt> <dd>
+<p>Convert the color from RGB coordinates to HSV coordinates.</p> </dd>
+</dl> <dl class="py function"> <dt class="sig sig-object py" id="colorsys.hsv_to_rgb">
+<code>colorsys.hsv_to_rgb(h, s, v)</code> </dt> <dd>
+<p>Convert the color from HSV coordinates to RGB coordinates.</p> </dd>
+</dl> <p>Example:</p> <pre data-language="python">&gt;&gt;&gt; import colorsys
+&gt;&gt;&gt; colorsys.rgb_to_hsv(0.2, 0.4, 0.4)
+(0.5, 0.5, 0.4)
+&gt;&gt;&gt; colorsys.hsv_to_rgb(0.5, 0.5, 0.4)
+(0.2, 0.4, 0.4)
+</pre> <div class="_attribution">
+ <p class="_attribution-p">
+ &copy; 2001&ndash;2023 Python Software Foundation<br>Licensed under the PSF License.<br>
+ <a href="https://docs.python.org/3.12/library/colorsys.html" class="_attribution-link">https://docs.python.org/3.12/library/colorsys.html</a>
+ </p>
+</div>