@reopt-ai/opt-palette
v1.0.0
Published
OKLCH-based color engine — harmony rules, palette generation, dark mode inversion, WCAG auto-repair.
Maintainers
Readme
@reopt-ai/opt-palette
OKLCH-based palette generation for the reopt design system. The package turns a seed color and harmony rule into light/dark design tokens with WCAG-aware contrast repair.
Install
bun add @reopt-ai/opt-paletteThe runtime has no DOM dependency and can run in Node, SSR, and browser contexts.
Example
import { generatePalette } from "@reopt-ai/opt-palette";
const palette = generatePalette({
seed: "#2563eb",
harmony: "analogous",
});
console.log(palette.tokens["--opt-primary"]);Modules
color-spaces: OKLCH, RGB, and HSL conversion helpersharmony: supported color harmony rulespalette-generator: token generation from a seed colordark-mode: dark-mode L-axis inversionaccessibility: WCAG contrast repair
Development
bun run --filter @reopt-ai/opt-palette typecheck
bun run --filter @reopt-ai/opt-palette test
bun run --filter @reopt-ai/opt-palette build