color is a JavaScript library for immutable color conversion and manipulation with support for CSS color strings.
The library solves the problem of working with colors across different color spaces and formats in JavaScript applications. It provides an immutable API where color objects maintain their state and return new instances when modified. The tool supports conversion between multiple color models including RGB, HSL, HSV, CMYK, and others, and can parse CSS color strings as input. Users can access individual channel values, convert to different representations like hex or array formats, and generate CSS-compatible string output with configurable precision.
Developers should choose this library when building applications that need flexible color manipulation without mutating state. It suits projects requiring color space conversions, accessibility calculations like WCAG luminosity and contrast ratios, or color transformations such as lightening, darkening, saturating, and rotating hue. The immutable design makes it predictable for functional programming patterns. The library's API was inspired by color-js, with manipulation functions drawing from CSS preprocessing tools like Sass, LESS, and Stylus, making it familiar to developers accustomed to those ecosystems.
The project maintains a stable codebase with infrequent but deliberate updates. Pull requests receive responses and are merged when appropriate, indicating active maintenance. Issues are acknowledged and addressed, though the pace of resolution varies. The maintainer engages with the community on feature requests and bug reports, suggesting a project that prioritizes reliability over rapid feature expansion.