1.8 KiB
1.8 KiB
Colour Plugin Ecosystem
Background
@suaveplan/colours (v0.1.0) shipped with core RGB/HSL/HSV/LAB/LCH/OKLAB/OKLCH/XYZ/CMYK support, parsing, mixing, blending, and palette generation. An audit of the ../chromatism/ third-party library revealed several colour-science features that are valuable for design-tool, accessibility, and print-media use cases but were out of scope for the core universal-tier package.
Scope
This change introduces four plugin packages that extend the colour system:
@suaveplan/colour-convert-hsluv— Perceptually uniform HSL variant with gamut mapping via HSLuv.org reference algorithm.@suaveplan/colour-convert-cieluv— CIELUV, xyY, LMS cone response, and Bradford chromatic adaptation with CIE standard illuminants.@suaveplan/colour-filter-cmc— CMC l:c Delta-E colour difference metric (configurable luminance and chroma weights).@suaveplan/colour-filter-cct— Correlated Colour Temperature (CCT) in Kelvin via McCamy's formula, plus CCT-to-RGB approximation.
Out of Scope
- ICC profile parsing / embedding (requires WASM or native bindings)
- CVD / colour-blind simulation (Brettel/Viénot models — future change)
- 1D/3D LUT loading and application (future change)
Acceptance Criteria
- Each plugin package follows the genesis scaffold:
package.json,tsconfig.lib.json,vitest.config.ts,vite.config.ts,README.md. - Folder-per-file structure with explicit barrel exports.
- 100% Istanbul coverage on all
src/**/*.ts. - Sibling
.mddocs for every implementation file (≥200 words, required headings). dep-graph.test.tsandtree-shake.test.tsin every package.sideEffects: falsein everypackage.json.- All error codes use
defineCodesfrom@suaveplan/error. - All packages pass
bunx turbo lint typecheck test build test:coverage.