A Modern JavaScript Color Library

color-box is a set of functions that makes manipulating colors using JavaScript or TypeScript easy.

color-box on GitHub Documentation


color-box enables you to easily adjust, inspect, mix colors and more. It's modular and supports tree shaking - you only bundle what you use! TypeScript types are included and all functions are immutable, always returning a new Color object.


import { Color, darken, hexString } from "@jgleman/color-box";

const myColor = new Color("#336699");
const myDarkerColor = darken(myColor, 20);
// #1a334d

Live Demo

And More!

See the documentation for a complete list of available functions.