{"id":9613,"library":"coloraide","title":"ColorAide","description":"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.","status":"active","version":"8.8.1","language":"en","source_language":"en","source_url":"https://github.com/facelessuser/coloraide","tags":["color","color-management","graphics","image-processing","design"],"install":[{"cmd":"pip install coloraide","lang":"bash","label":"Install stable version"}],"dependencies":[],"imports":[{"note":"The primary Color class is typically imported directly from the top-level package.","wrong":"import coloraide; c = coloraide.Color('red')","symbol":"Color","correct":"from coloraide import Color"}],"quickstart":{"code":"from coloraide import Color\n\n# Create a color from a name or hex string\nc = Color('red')\nprint(f\"Initial color: {c.to_string()}\")\n\n# Convert to another color space and print\nsrgb_color = c.convert('srgb')\nprint(f\"sRGB: {srgb_color.to_string(hex=True)}\")\n\n# Mix two colors\nc1 = Color('blue')\nc2 = Color('green')\nmixed_color = c1.mix(c2, space='srgb', amount=0.5)\nprint(f\"Mixed color: {mixed_color.to_string(hex=True)}\")\n\n# Check if a color is in gamut\np3_color = Color('color(--display-p3 0.9 0.1 0.5)')\nprint(f\"Is P3 color in sRGB gamut? {p3_color.in_gamut('srgb')}\")\n\n# Fit a color to a gamut\nout_of_gamut = Color('color(--rec2020 0.9 0.1 0.5)')\nfit_srgb = out_of_gamut.fit('srgb')\nprint(f\"Out of gamut: {out_of_gamut.to_string()}, Fit to sRGB: {fit_srgb.to_string()}\")","lang":"python","description":"Demonstrates creating colors, converting between color spaces, mixing colors, checking gamut, and fitting colors to a target gamut using the `Color` class."},"warnings":[{"fix":"Upgrade your Python environment to 3.10 or newer before installing ColorAide v8.7+.","message":"ColorAide v8.7 dropped support for Python 3.9. Projects using older Python versions will encounter installation errors or runtime issues.","severity":"breaking","affected_versions":">=8.7"},{"fix":"Use `color.in_gamut('pointer-gamut')` and `color.fit('pointer-gamut')` respectively for checking and fitting to the Pointer Gamut.","message":"The 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`.","severity":"deprecated","affected_versions":">=8.1"},{"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.","message":"As 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.","severity":"gotcha","affected_versions":">=8.8"},{"fix":"If specific end point conditions are critical for your interpolation, explicitly configure them using the `end_conditions` parameter in interpolation methods.","message":"In 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.","severity":"gotcha","affected_versions":">=8.7"},{"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.","message":"The 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.","severity":"gotcha","affected_versions":">=8.4"}],"env_vars":null,"last_verified":"2026-04-17T00:00:00.000Z","next_check":"2026-07-16T00:00:00.000Z","problems":[{"fix":"Change your import statement from `import coloraide` to `from coloraide import Color`.","cause":"Attempting to access the `Color` class via `coloraide.Color` after `import coloraide`, when `Color` is intended for direct import.","error":"AttributeError: module 'coloraide' has no attribute 'Color'"},{"fix":"Replace `color_object.in_pointer_gamut()` with `color_object.in_gamut('pointer-gamut')`.","cause":"Using the deprecated `in_pointer_gamut()` method, which was removed in ColorAide v8.1 and later.","error":"AttributeError: 'Color' object has no attribute 'in_pointer_gamut'"},{"fix":"Upgrade your Python environment to version 3.10 or newer.","cause":"Attempting to install or run ColorAide v8.7 or newer with an unsupported Python version (e.g., Python 3.9).","error":"ERROR: Package 'coloraide' requires a different Python version: >=3.10 but your Python is 3.9.x"}]}