What it does
Culori is a JavaScript library for converting and manipulating colours, including CSS Color Level 4 formats and additional spaces. Colours are plain objects passed through functions, with explicit handling of alpha values.
Install culori, import the functions you need and pass a colour name, colour string or object into them. The getting-started example converts a named colour into an RGB object. Browser prototypes can also load the library from a CDN, a hosted package service.
For colours outside a display’s gamut, its reproducible range, clampChroma reduces chroma while seeking to preserve lightness and hue. It returns the result in the original colour space. If that search cannot find a displayable value, it falls back to RGB clamping; the search is not guaranteed to find an optimal result in every space.
After prototyping, the culori/fn entry point supports builds that include only selected functions. Pin the package version in reproducible notebooks. The project is free under the MIT licence.
Strengths
- Missing alpha is kept distinct from an explicitly opaque colour.
Watch out for
- Chroma clamping can fall back to a different method when no suitable colour is found.
Best for
- Developers implementing colour editors or format-conversion utilities
Sources
- Culori colour functions for JavaScript (Oct 27, 2026)
- Getting Started with Culori (Oct 27, 2026)
- Culori API reference (Oct 27, 2026)
- Culori MIT licence (Oct 27, 2026)
