/** * Colour-accessibility checks for the design system's data-visualisation * palettes. * * These run in CI against the shipped tokens (see `chart.validate.test.ts`) so a * palette edit that breaks colour-vision separation fails the build instead of * shipping. The maths is ported in-repo deliberately: CI must not depend on a * script outside the package. * * ΔE is Euclidean distance in OKLab x100. The CVD thresholds are calibrated to * the Machado-Oliveira-Fernandes (2009) severity-1.0 simulation below — the * model is part of the standard, not an implementation detail. Swapping in a * different simulation would move borderline pairs and require recalibrating * the numbers. */ export type CvdKind = 'protan' | 'deutan' | 'tritan'; export type PaletteMode = 'light' | 'dark'; export interface CheckResult { ok: boolean; report: readonly (readonly [name: string, ok: boolean, detail: string])[]; } export declare function contrast(a: string, b: string): number; /** OKLCH lightness and chroma. */ export declare function oklch(hex: string): [number, number]; /** OKLCH hue in degrees, 0-360. */ export declare function okhue(hex: string): number; export declare function deltaE(a: string, b: string, kind?: CvdKind): number; export declare function validateCategorical(palette: readonly string[], { mode, surface, pairs, }: { mode: PaletteMode; surface: string; pairs?: 'adjacent' | 'all'; }): CheckResult; export declare function validateOrdinal(palette: readonly string[], { mode, surface }: { mode: PaletteMode; surface: string; }): CheckResult;