import { n as ColorFormat } from "./color-formats-BDDzxjy6.mjs"; import Color from "colorjs.io"; //#region src/format-color.d.ts interface NormalizedColor { colorSpace: string; components?: readonly (number | null)[]; channels?: readonly (number | null)[]; alpha?: number; hex?: string; } interface FormatColorResult { /** Display string — e.g. `rgb(59 132 246)`, `#3b82f6`. */ value: string; /** True when the requested format can't losslessly represent the color. */ outOfGamut: boolean; } /** * Render a normalized DTCG color payload as a display string in the * requested format, with a gamut flag. The shared rendering kernel behind * the blocks display surface and the MCP server (which add their own thin * wrappers). Pure — never throws; returns the `fallback` for unrecognized * input so callers don't need try/catch. * * `raw` here emits a compact normalized form; consumers that want the full * payload (the MCP server) handle `raw` in their own wrapper. */ declare function formatColor(value: unknown, format: ColorFormat, fallback?: string): FormatColorResult; /** * Construct a colorjs.io `Color` from a normalized DTCG color payload, * applying the space-alias map so wide-gamut spaces (`display-p3`, * `a98-rgb`, `prophoto-rgb`) resolve. Returns null for unrecognized input. * * The shared primitive for consumers that need the color object itself — * perceptual sorting (oklch coords) or a gamut-correct CSS string — rather * than a pre-rendered display string. Replaces the hand-rolled, alias-map- * less colorjs construction that previously lived in each consumer. */ declare function parseColor(value: unknown): Color | null; //#endregion export { FormatColorResult, NormalizedColor, formatColor, parseColor }; //# sourceMappingURL=format-color.d.mts.map