import { Color } from "./Color"; /** * OKLCH color helpers. * * OKLCH is a perceptually-uniform cylindrical color space (lightness, chroma, * hue) derived from Björn Ottosson's OKLab. Unlike HSL, equal steps in OKLCH * lightness/hue look equally different to the eye, which makes it ideal for * generating balanced categorical palettes from a single seed color. * * This module is a small, dependency-free converter (sRGB <> OKLab <> OKLCH) * plus an sRGB gamut clamp. It is additive: nothing in the existing color * pipeline changes. Themes that need perceptual palettes import it to * pre-compute a `colors` array. * * Ranges: * - `l` (lightness): 0 (black) .. 1 (white) * - `c` (chroma): 0 (gray) .. ~0.37 (most saturated sRGB) * - `h` (hue): 0 .. 360 degrees * * @see {@link https://bottosson.github.io/posts/oklab/} for the source math */ export interface IOKLCH { /** Lightness, 0 .. 1 */ l: number; /** Chroma, 0 .. ~0.37 */ c: number; /** Hue, 0 .. 360 degrees */ h: number; } /** * Converts a [[Color]] to its OKLCH components. * * @param color Source color * @return `{ l, c, h }` */ export declare function colorToOKLCH(color: Color): IOKLCH; /** * Converts OKLCH components to a [[Color]]. * * By default, colors that fall outside the sRGB gamut are brought back in by * reducing chroma while holding lightness and hue constant (a binary search), * which preserves the intended color far better than a naive per-channel clip. * * @param l Lightness, 0 .. 1 * @param c Chroma, 0 .. ~0.37 * @param h Hue, 0 .. 360 degrees * @param clamp Reduce chroma to fit sRGB (default `true`) * @return Color */ export declare function oklchToColor(l: number, c: number, h: number, clamp?: boolean): Color; //# sourceMappingURL=OKLCH.d.ts.map