/** An sRGB colour, 0-255 per channel. */ export interface Rgb { r: number; g: number; b: number; } /** Parses `#abc` or `#aabbcc` (with or without the hash). Returns null for anything else. */ export declare function parseHex(colour: string): Rgb | null; /** `{r,g,b}` back to a `#rrggbb` string. */ export declare function toHex({ r, g, b }: Rgb): string; /** * Straight sRGB interpolation between two hex colours, `t` clamped to 0..1. * * sRGB rather than a perceptual space is deliberate: both endpoints are colours an operator * picked in a colour input, so the midpoint should be the one they would predict from mixing * them. Falls back to whichever endpoint parses when the other is malformed. */ export declare function lerpHex(from: string, to: string, t: number): string; /** WCAG relative luminance, 0 (black) to 1 (white). Returns null for an unparseable colour. */ export declare function relativeLuminance(colour: string): number | null; /** * Black or white, whichever reads better on the given background. * * Needed wherever a value ramp is used as a fill behind text: a ramp runs from dark to light by * design, so no single fixed text colour stays legible across it. */ export declare function readableTextColour(background: string): string; /** A hex colour as `rgba(...)` at the given alpha, for glows and washes. */ export declare function withAlpha(colour: string, alpha: number): string; //# sourceMappingURL=colourUtils.d.ts.map