Colour maths in a design system — convert, mix, and (crucially) check WCAG contrast for readability.
Overview
Parse hex/rgb/hsl, convert between them, lighten/darken/mix/alpha/rotate — and, crucially, check WCAG contrast so your UI is actually readable (isReadable, readableTextColor). The colour toolkit every app rebuilds, dependency-free.
Install
$ npm install @lacspace/color
Quick example
@lacspace/colorts
contrast("#000", "#fff")
Returns 21
Tips
`isReadable()` / `readableTextColor()` help you pick accessible text colours programmatically.
Zero-dependency and isomorphic — safe to import on the server, in the browser, on the edge and in React Native. It tree-shakes, so you only ship what you import.
Looking for the complete API and more examples? The npm page and GitHub README carry the full reference — or grab the PDF.