Colour engine
@prismora/color generates perceptually even 12-step scales in OKLCH, maps them into the sRGB gamut, and checks every text and boundary pair against WCAG 2.x. APCA is reported for information.
Scale roles
| Steps | Use |
|---|---|
| 1–2 | App and subtle backgrounds |
| 3–5 | Component backgrounds: normal, hover, active |
| 6–8 | Borders: subtle, normal, strong (8 meets 3:1) |
| 9–10 | Solid fills: normal, hover |
| 11 | Low-contrast text (≥ 4.5:1) |
| 12 | High-contrast text (≥ 7:1) |
Generated from #7c5cff
Light
accent secondary neutral success warning danger info
Dark
accent secondary neutral success warning danger info
API
Why generated in JavaScript?
Browsers do not yet gamut-map relative colours, so deriving tints with oklch(from …) in CSS gives unpredictable results for vivid seeds. Prismora computes scales ahead of time (at build time or in the generator) with proper gamut mapping, and only uses color-mix(in oklab, …) at runtime for translucency.