export type Rgb = { r: number; g: number; b: number; }; export type Hsl = { h: number; s: number; l: number; }; export declare function hexToRgb(hex: string): Rgb; /** Alpha in 0..1. `#rgb`/`#rrggbb` read as fully opaque (`a: 1`); `#rgba`/`#rrggbbaa` carry their alpha. */ export declare function hexToRgba(hex: string): Rgb & { a: number; }; export declare function compositeOver(foreground: string, backdrop: string): string; export declare function rgbToHex({ r, g, b }: Rgb): string; export declare function rgbToHsl({ r, g, b }: Rgb): Hsl; export declare function hslToRgb({ h, s, l }: Hsl): Rgb; export declare const hexToHsl: (hex: string) => Hsl; export declare const hslToHex: (hsl: Hsl) => string; /** Re-lights a color while keeping its hue (and, unless overridden, its saturation). */ export declare function withLightness(hex: string, lightness: number, saturation?: number): string; /** Linear RGB blend. `weight` is how much of `b` to take (0 → a, 1 → b). */ export declare function mix(a: string, b: string, weight: number): string; /** WCAG 2.1 relative luminance. */ export declare function relativeLuminance(hex: string): number; /** WCAG 2.1 contrast ratio, 1–21. AA body text needs >= 4.5. */ export declare function contrastRatio(a: string, b: string): number;