Getting Started
npm i colord
import { colord } from "colord";
colord("#ff0000").grayscale().toRgbString();
colord("rgb(192, 192, 192)").isLight();
colord("hsl(0, 50%, 50%)").darken(0.25).toHex();
Why Colord?
📦 Small
Just 1.7 KB gzipped (3x+ lighter than color and tinycolor2)💨 Dependency-free
Fast CI and no vulnerability risks🚀 Fast
3x+ faster than color and tinycolor2😍 Simple
Chainable API and familiar patterns🛡 Bulletproof
Written in strict TypeScript and has 100% test coverage🗂 Typed
Ships with types included🏗 Extendable
Built-in plugin system to add new functionality📚 CSS-compliant
Strictly follows CSS Color Level specifications👫 Works everywhere
Supports all browsers and Node.js💪 Immutable
No need to worry about data mutations