/** * WCAG 2.2 contrast maths, kept dependency-free and side-effect-free so it can be exercised from a * plain node-environment vitest run (the `unit` project in vite.config.ts) with no DOM. * * Only the colour notations the theme CSS actually uses are supported — `#rgb` / `#rgba` / * `#rrggbb` / `#rrggbbaa`, `rgb()` / `rgba()` (comma or space separated), and the `white` / `black` * / `transparent` keywords. Anything else returns `null` rather than guessing, so an unparsed value * surfaces as a loud failure instead of a silently-skipped assertion. * * @see https://www.w3.org/TR/WCAG22/#dfn-relative-luminance * @see https://www.w3.org/TR/WCAG22/#dfn-contrast-ratio */ export interface Rgba { readonly r: number; readonly g: number; readonly b: number; /** 0–1. */ readonly a: number; } export declare const parseCssColor: (value: string) => Rgba | null; /** Source-over compositing. `backdrop` must be opaque; the result always is. */ export declare const compositeOver: (source: Rgba, backdrop: Rgba) => Rgba; export declare const relativeLuminance: ({ r, g, b }: Rgba) => number; /** * Contrast ratio of two opaque colours, truncated to two decimals. * * Truncated rather than rounded, for two reasons. It is conservative at the threshold — rounding * would report a true 4.4951:1 as "4.5" and let a failing pair through — and it is what axe-core * reports, so a ratio quoted in docs/a11y-contrast.md is digit-for-digit the same number as the * one in the axe baseline in docs/a11y-allowlist.md. */ export declare const contrastRatio: (first: Rgba, second: Rgba) => number;