Entry points and exports
Colore has two package imports. Use colore-js for Color objects and theme work, and colore-js/fn for standalone operations.
colore-js
Use the root for the fluent API, parsing and validation, and higher-level workflows.
Export formats (CSS variables, Tailwind v4, shadcn/ui, DTCG, JSON) are methods on the system that generateSystem returns, not separate functions.
import Color, { colore, ensureContrast } from 'colore-js';
const a = new Color('#2563eb');
const b = colore('#2563eb');
console.log(a.equals(b, 0)); // true
console.log(ensureContrast(a, '#ffffff').satisfied); // true
colore-js/fn
Use /fn for named standalone operations. Color transforms return CSS strings, and palettes return arrays of them. Parsers return numeric values. Workflows such as audit and generateSystem return typed results.
Design tokens
generateSystem(...).toDTCG() exports a DTCG 2025.10 document typed as DTCGDocument (exported from the package root).
Type-only exports
Each entry point also exposes TypeScript types appropriate to that surface. Import them with import type so they do not become runtime imports. See Types for the grouped index.