@suaveplan/colour-convert-cmyk - Bidirectional RGB <-> CMYK colour space conversion with black generation for print workflows
Bidirectional conversion between RGB and CMYK colour spaces using the standard Euclidean algorithm with black generation. CMYK is the subtractive model used in professional printing; these conversions are essential for print preview, pre-press workflows, and bridging screen colours with physical output.
Documentation tree
- cmyk —
cmyk.tsprovides bidirectional conversion between RGB and CMYK colour spaces. CMYK is the subtractive model used in p…- cmyk —
cmyk.tsprovides bidirectional conversion between RGB and CMYK colour spaces. CMYK is the subtractive model used in p…
- cmyk —
Installation
bun add @suaveplan/colour-convert-cmyk
Quick Start
import { rgbToCmyk, cmykToRgb } from "@suaveplan/colour-convert-cmyk";
const ink = rgbToCmyk({ r: 59, g: 130, b: 246 });
console.log(ink); // { c: 76, m: 47, y: 0, k: 4 }
const screen = cmykToRgb(ink);
console.log(screen); // { r: 59, g: 130, b: 246, a: 1 }
Modules
src/cmyk/cmyk.md— RGB↔CMYK conversion implementation and API reference