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)
I write here about programming, how to program better, things I think are neat and are related to programming. I might write other things at my personal website.
- ► 2014 (52)
- ► 2012 (19)
- ► 2011 (19)
- ► 2010 (32)
- ► 2008 (28)
- Minimal Working Examples: How to, Why, and Who car...
- Standard Gems: SimpleHTTPServer.test()
- Standard Gems: colorsys
- Book Review: Practices of an Agile Developer
- RTFM Not Just a Disgruntled Reply
- Pure Functions in the Python Standard Library?
- PyCon Recordings?
- Standard Gems: shlex.split()
- Standard Gems: calendar.month_name
- Extreme Code - Version Control For One FileYou sho...
- Extreme Code - Examining Software Development Thro...
- ▼ February (11)