"colorsys" --- 色体系間の変換
*****************************

**ソースコード:** 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.

参考:

  色空間に関するより詳細な情報は https://poynton.ca/ColorFAQ.html と
  https://www.cambridgeincolour.com/tutorials/color-spaces.htm にあり
  ます。

"colorsys" モジュールでは、以下の関数が定義されています:

colorsys.rgb_to_yiq(r, g, b)

   RGB から YIQ に変換します。

colorsys.yiq_to_rgb(y, i, q)

   YIQ から RGB に変換します。

colorsys.rgb_to_hls(r, g, b)

   RGB から HLS に変換します。

colorsys.hls_to_rgb(h, l, s)

   HLS から RGB に変換します。

colorsys.rgb_to_hsv(r, g, b)

   RGB から HSV に変換します。

colorsys.hsv_to_rgb(h, s, v)

   HSV から RGB に変換します。

以下はプログラム例です:

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