Colorzero is a Python library designed for simple and 'pythonic' color manipulation. It features a comprehensive `Color` class capable of converting between various color representations and calculating color differences. The library utilizes immutable `Color` objects, which are descendents of `namedtuple`, necessitating a specific approach to color manipulation. The current version is 2.0, last released in March 2021.
pip install colorzeroVerified import paths — ran on the pinned version, not inferred.
Demonstrates creating `Color` objects using various constructors and manipulating them by producing new instances through arithmetic operations with manipulation classes.
Instead of direct assignment, use arithmetic operators with specific manipulation classes (e.g., `my_color = my_color + Red(0.1)`).
To change color components, use helper classes like `Red`, `Green`, `Blue`, `Lightness`, etc., in conjunction with arithmetic operators, which return a new `Color` object. For example: `c = c + Green(0.1)` or `c = c * Lightness(0.5)`.
Be aware of potential minor discrepancies when converting colors between different representations, especially when high precision is critical.
To change a color, create a new `Color` instance by using arithmetic operators with manipulation classes (e.g., `from colorzero import Red; my_color = my_color + Red(0.1)`).
Refer to the `Color` class documentation for accepted constructor arguments and valid ranges for color components (e.g., RGB floats between 0.0 and 1.0, or byte values between 0 and 255).
No dependency data recorded yet.