What it does
Colour is a Python package of colour-science algorithms and datasets, freely available under BSD-3-Clause terms. Its tutorials connect spectral measurements, standard observers and illuminants with numeric colours and plots.
Install the colour-science package, then represent wavelength/value samples with SpectralDistribution. The tutorial selects a standard observer and D65 illuminant, calculates CIE XYZ values and converts them to a display swatch. This provides a reproducible route from measured samples to a visual comparison.
The numeric domains matter: the demonstrated spectral-to-XYZ calculation returns values on a 0-to-100 scale, while the sRGB conversion expects 0-to-1 input. The example rescales before converting.
Interpolation can change the stored spectral data in place, so copy the distribution before trying another wavelength interval. Optional plotting dependencies provide spectral graphs, colour swatches and chromaticity diagrams; they are separate from the core package requirements.
Strengths
- Algorithms and reference datasets can be combined in repeatable scripts.
- Tutorials show both numeric results and plotted comparisons.
Watch out for
- Calculation inputs and numeric scales require care.
- Interpolation can modify the original data object.
Best for
- Developers and researchers performing repeatable colour calculations
Sources
- Colour Science for Python (Oct 27, 2026)
- Colour installation guide (Oct 27, 2026)
- Colour spectral and colour conversion tutorial (Oct 27, 2026)
