Skip to content

v2.8 • UI • 5kb gzipped • MIT

ColorForge

Palette generation and contrast checking in perceptual colour space, built for design tokens.

★ 5.7kGitHub
↓ 9.6k / week● MIT● TS 5.0+
colorforge-preview.png
Abstract preview graphic for ColorForge

// why colorforge

Perceptual, not hexadecimal

Works in OKLCH, so a lightness ramp looks even to a person rather than only to the arithmetic.

● 6ms render● 60fps● 0 deps

// stack

Contrast built in

Every generated step reports its contrast against your surfaces, so a failing token never reaches a build.

ColorForge started as a single file in a client project and stayed small on purpose. It does one job, it does it in 5kb gzipped, and it has no runtime dependencies.

Getting started

Install it, import it, call it:

npm i colorforge-js

Works in OKLCH, so a lightness ramp looks even to a person rather than only to the arithmetic.

What it does not do

It does not manage your state, style your components or ship a plugin system. Those are your decisions, and keeping them out is what keeps the bundle honest.

  • OKLCH ramps
  • Contrast assertions
  • MIT licensed, commercially friendly

Features

OKLCH ramps

Generate a tonal scale that stays perceptually even across the whole range.

Contrast assertions

Assert a minimum ratio in tests and fail the build when a token regresses.

Container aware

Adapts to the box it is given rather than the viewport, so it works in a sidebar.

Accessibility audited

Tested against screen readers on three platforms, with the findings published in the repository.

ESM and types

Ships module and CommonJS builds with hand-written type definitions and source maps.

Styling stays yours

ColorForge sets no colours and no spacing. Every visual decision belongs to your design system.

Get ColorForge v2.8

9 files • .min.js 5kb • .zip 56kb • sha384 verified

Changelog

v2.8 Oct 15 2025 • latest
  • OKLCH ramp generation
  • Contrast assertions for CI
  • Colour-vision simulation
v2.7 Sep 11 2025
  • Node 18 is now the minimum supported version
  • CommonJS build restored for older bundlers
v2.6.4 Jul 27 2025
  • Reworked the public API for consistency
  • Deprecated helpers removed
View full archive →

// related

Related products

Sep 10 • v2.0

ChartForge

Canvas charts in twelve lines. Responsive, accessible and dark-mode ready, with no D3 learning curve.

View →
Aug 30 • v3.2.1

MotionEase

Physics-based micro-animations with a single call. Spring curves that feel right without a tuning session.

View →
Aug 19 • v1.9.4

FormFlow

Validation and multi-step logic that works the same in React, Vue and vanilla. Your markup stays yours.

View →

Ship the interface today.

MIT licensed. Commercial friendly. Five-minute setup.