npm install culori
What sets Culori apart?
Accurate alpha. On the
alpha channel, the library doesn't equate an
undefined value with an opaque color, but rather with a color for which we don't care about the opacity. This gives you the opportunity to interpret
undefined as you see fit. The hex string #ff0000 should probably be rendered as fully opaque red, but for running functions on colors it's useful to discern #ff0000 from #ff0000ff — the former has an implicit alpha of 1, while for the latter it's explicit.
Comprehensive functionality. Build advanced color tools with Culori's rich collection of color spaces and functions.
Tree-shakeable version available. When you're ready to optimize for bundle size, switch to a tree-shakeable version of the library.