import { type Gamut, type Oklch } from './color.js'; type Rgb = [number, number, number]; /** WCAG 2's contrast ratio between two hex colors, 1–21. */ export declare function contrastRatio(a: string, b: string): number; /** Whether a background reads better under white text than black: the theme's mode. */ export declare function isDarkColor(hex: string): boolean; /** APCA lightness contrast of text on a background, as a magnitude 0–~108. */ export declare function apcaContrast(text: string, background: string): number; /** How much contrast a foreground needs: a WCAG 2 ratio and, for text, an APCA Lc. */ export interface ContrastTarget { wcag: number; apca?: number; } /** Whether a foreground meets a target on every background it sits on, in sRGB. */ export declare function meets(fg: string, backgrounds: readonly string[], target: ContrastTarget): boolean; /** A color as a screen shows it: channels in the gamut it's written in. */ export interface Shown { rgb: Rgb; gamut: Gamut; } /** How a generated color shows when written in a gamut: as a hex for sRGB, as `color(display-p3)` for p3. */ export declare function shown(color: Oklch, gamut: Gamut): Shown; /** A translucent fill over a backdrop, composited in the fill's gamut. */ export declare function over(fill: Shown, alpha: number, backdrop: Oklch): Shown; /** Whether a shown foreground meets a target on every shown background. Each is measured in its own gamut. */ export declare function meetsIn(fg: Shown, backgrounds: readonly Shown[], target: ContrastTarget): boolean; /** How a written color shows: a hex in sRGB, or `color(display-p3 …)` in display-p3. */ export declare function shownValue(value: string): Shown | null; /** Both contrasts of a foreground on a background as written, in whichever gamut each is. */ export declare function measure(fg: Shown, bg: Shown): { wcag: number; apca: number; }; /** * The color nearest `start` in lightness, at its hue and chroma, that meets * `target` on every background in sRGB. It moves away from the backgrounds * toward black on light grounds and white on dark ones; a color that already * meets the target comes back unchanged, so a brand color is kept wherever it * reads. */ export declare function solve(start: Oklch, backgrounds: readonly string[], target: ContrastTarget): Oklch; export {};