Color handling made simple.
Chroma is a Python module for handling colors with ease.
Manipulating colors can quickly escalate into a tedious and complicated task, particularly when you become concerned with color systems beyond RGB. Chroma is here to provide a simple API to do the heavy lifting, so that you can stay focused on the important parts of your projects.
Before you ask, Chroma is BSD licensed, available on Github and PyPI.
- Hex (#rrggbb, #rrggbbaa)
- CMY, CMYK
- Color Blending: additive and subtractive mixing
- Coordinates (sRGB, YIQ, CIE, LAB and more)
- Color harmonies: complementary, analogous, triad
- Color difference
- Color detection in images
Getting started with the power of Chroma is meant to be straightforward
import chroma # Create a color object color = chroma.Color('#00FF00') # Handling different color systems color.cmy = (0.3, 0.7, 0.8) color.rgb # (0.7, 0.3, 0.2) color.hls # (0.0333, 0.45, 0.5556) # Alpha color.alpha = 0.5 color.hsv # (0.03333, 0.7143, 0.7, 0.5) # Color blending color + chroma.Color("#FF00FF") # #FF4DFF
And there you have it. The documentation describes Chroma’s functionality and usage in detail.
Installation is as easy as
pip install chroma
Or if you’re an easy_install-er
Chroma does not yet support Python 3, but, if you’re interested, contribute!
Chroma is under active development and could use your support. Even bug reports, feature suggestions and feedback can help push Chroma forward in the right direction.
(Breaks backwards compatibility)
- CMY, CMYK Support
- Color Blending (Additive and Subtractive Mixing)
- Comparison (eq, ne)
- Remove color coordinate properties (direct modification)
Major Bug Fixes
- Hex rounding
- Force alpha between 0 and 1
- Hue (HLS, HSV) in degrees not percent of degrees
- RGB256 alpha in range 0-1, not 0-255
- Force Hex to output in uppercase
- ValueError on bad input
- Extensive documentation on Read the Docs
- Direct modification of color coordinates
- Remove HLS256, HSV256 (critical bug)
- Alpha support
- Add RGB, RGB256, HLS, HSV as formats for Color initialization
- Bug fixes
- HLS, HSV Support
- API changes (setter methods)
- Bug Fixes
- Update to README
- Initial Release
- RGB and Hex support