import { Color } from "./Color"; /** * OKLCH color helpers. * * OKLCH describes a color by lightness, chroma and hue, derived from Björn * Ottosson's OKLab. Unlike in HSL, equal steps of lightness or hue look * equally different to the eye, which suits balanced palettes built from one * color. * * 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, from `0` (black) to `1` (white). */ l: number; /** Chroma, from `0` (gray) to about `0.37` (most saturated). */ c: number; /** Hue, from `0` to `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, a color outside the * sRGB range is brought into it by reducing its chroma, keeping lightness and * hue. * * @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; /** * WCAG contrast ratio of two colors, from `1` (none) to `21` (black on white). * * @ignore */ export declare function contrastRatio(a: Color, b: Color): number; /** * Returns `color` with its lightness moved away from the background's, just * far enough for `ratio` contrast against it, keeping its hue. A color that * already has it is returned as is. * * @ignore */ export declare function withContrast(color: Color, background: Color, ratio?: number): Color; /** * A mid shade of a color for large fills such as map land, about as light as * the land in the light and dark themes. * * @ignore */ export declare function fillShade(color: IOKLCH, dark: boolean): Color; //# sourceMappingURL=OKLCH.d.ts.map