Registry / data / coloraide

coloraide

JSON →
library8.8.1pypypi✓ verified 87d ago

ColorAide is a comprehensive color library for Python, providing advanced color space conversions, manipulation, interpolation, and gamut mapping. It supports a wide range of color models and offers precise control over color operations. The library is actively maintained with frequent releases, currently at version 8.8.1.

pip install coloraide
INSTALL
IMPORT
SIG · COLORAIDE
C
coloraide
datapythonv8.8.1
Install
1.8s avg
Import
415ms
Disk
19MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v8.8.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.422s · 20.6MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 1.8s · import 0.408s · 21MB
19MB installed
● package 19MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Color
from coloraide import Color
import coloraide; c = coloraide.Color('red')
The primary Color class is typically imported directly from the top-level package.

Demonstrates creating colors, converting between color spaces, mixing colors, checking gamut, and fitting colors to a target gamut using the `Color` class.

from coloraide import Color # Create a color from a name or hex string c = Color('red') print(f"Initial color: {c.to_string()}") # Convert to another color space and print srgb_color = c.convert('srgb') print(f"sRGB: {srgb_color.to_string(hex=True)}") # Mix two colors c1 = Color('blue') c2 = Color('green') mixed_color = c1.mix(c2, space='srgb', amount=0.5) print(f"Mixed color: {mixed_color.to_string(hex=True)}") # Check if a color is in gamut p3_color = Color('color(--display-p3 0.9 0.1 0.5)') print(f"Is P3 color in sRGB gamut? {p3_color.in_gamut('srgb')}") # Fit a color to a gamut out_of_gamut = Color('color(--rec2020 0.9 0.1 0.5)') fit_srgb = out_of_gamut.fit('srgb') print(f"Out of gamut: {out_of_gamut.to_string()}, Fit to sRGB: {fit_srgb.to_string()}")
Debug
Known issues
breakingColorAide v8.7 dropped support for Python 3.9. Projects using older Python versions will encounter installation errors or runtime issues.
fix
Upgrade your Python environment to 3.10 or newer before installing ColorAide v8.7+.
affects: >=8.7
deprecatedThe methods `in_pointer_gamut()` and `fit_pointer_gamut()` were deprecated in v8.1 and are now removed. Attempting to use them will raise an `AttributeError`.
fix
Use `color.in_gamut('pointer-gamut')` and `color.fit('pointer-gamut')` respectively for checking and fitting to the Pointer Gamut.
affects: >=8.1
gotchaAs of v8.8, `luminance()` returns luminance relative to D65 by default (WCAG recommended), while the new `Y()` method returns luminance relative to the current color space's white point.
fix
Be mindful of which luminance function you use. If you need luminance relative to the current color space's white point, use `color.Y()`. For D65-relative luminance, `color.luminance()` remains the correct choice.
affects: >=8.8
gotchaIn v8.7, spline interpolation `monotone` end point conditions were changed to `not-a-knot` by default to prevent overshoot. This might subtly alter interpolation results if you relied on the previous behavior.
fix
If specific end point conditions are critical for your interpolation, explicitly configure them using the `end_conditions` parameter in interpolation methods.
affects: >=8.7
gotchaThe new `scale` gamut mapping method introduced in v8.4 is now used by default for conversions from `from_wavelengths()`, `blackbody()`, and `chromaticity()`. This changes how out-of-gamut colors are handled in these specific conversions.
fix
Review results from these conversion functions. If previous gamut mapping behavior is desired, or custom `scale` options are needed, explicitly pass the relevant parameters to these functions.
affects: >=8.4
Errors
Common errors & fixes
AttributeError: module 'coloraide' has no attribute 'Color'
Attempting to access the `Color` class via `coloraide.Color` after `import coloraide`, when `Color` is intended for direct import.
fix
Change your import statement from `import coloraide` to `from coloraide import Color`.
AttributeError: 'Color' object has no attribute 'in_pointer_gamut'
Using the deprecated `in_pointer_gamut()` method, which was removed in ColorAide v8.1 and later.
fix
Replace `color_object.in_pointer_gamut()` with `color_object.in_gamut('pointer-gamut')`.
ERROR: Package 'coloraide' requires a different Python version: >=3.10 but your Python is 3.9.x
Attempting to install or run ColorAide v8.7 or newer with an unsupported Python version (e.g., Python 3.9).
fix
Upgrade your Python environment to version 3.10 or newer.
Upgrade
Version history
8.8.1latest on PyPI · released Mar 22, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
18 hits · last 30 days
node
16
OpenAI (training)
1
Resources
coloraide — pip install coloraide · libregistry