Skip to content

Introduction

What is ColorAide?

ColorAide is a pure Python, object oriented approach to colors.

>>> from coloraide import Color
>>> Color.steps(['lch(75% 50 0)', 'lch(75% 50 300)'], steps=8, space='lch', hue='longer')
[color(--lch 75 50 0 / 1), color(--lch 75 50 42.857 / 1), color(--lch 75 50 85.714 / 1), color(--lch 75 50 128.57 / 1), color(--lch 75 50 171.43 / 1), color(--lch 75 50 214.29 / 1), color(--lch 75 50 257.14 / 1), color(--lch 75 50 300 / 1)]

ColorAide particularly has a focus on the following:

  • Accurate colors.

  • Proper round tripping (where reasonable).

  • Be generally easy to pick up for the average user.

  • Support modern CSS color spaces and syntax.

  • Make accessible many new and old non-CSS color spaces.

  • Provide a number of useful utilities such as interpolation, color distancing, blending, gamut mapping, filters, correlated color temperature, color vision deficiency simulation, color harmonies, etc.

  • Provide a plugin API to extend supported color spaces and approaches to various utilities.

  • Allow users to configure defaults to their liking.

ColorAide is not meant to be the one library to replace all other color libraries. There are many great libraries out there such such as: Colour Science, Colorio, Python Color Math, and many others. Some focus on the scientific aspects of colors and provide a wealth of various spaces, illuminants, access to complex color space visualizers, and numerous esoteric tools. Some are highly focused on speed. Some are powerful, but can be more complex to pick up by the average user.

At its heart, ColorAide was designed for convenience, flexibility, and to be very easy to pick up and work with. There are, of course, some trade offs with speed when using a pure Python, object oriented approach, but there are also many advantages as well. ColorAide might not always be the tool for every job, but hopefully it is a great tool all the same.

Installation

ColorAide can be installed via Python's pip:

$ pip install coloraide