Lots of us do color work. Maybe you're writing a full-fledged Photoshop killer, or you just want a utility to do some bulk conversions or color scheme generations. Well, in any case, you might find the often-forgotten colorsys module handy.
You can easily convert between different color component systems with these included functions:
hls_to_rgb(h, l, s)
hsv_to_rgb(h, s, v)
rgb_to_hls(r, g, b)
rgb_to_hsv(r, g, b)
rgb_to_yiq(r, g, b)
yiq_to_rgb(y, i, q)
You can easily convert between different color component systems with these included functions:
hls_to_rgb(h, l, s)
hsv_to_rgb(h, s, v)
rgb_to_hls(r, g, b)
rgb_to_hsv(r, g, b)
rgb_to_yiq(r, g, b)
yiq_to_rgb(y, i, q)
Comments