/** * Contrast Checker Utility * * WCAG-compliant contrast ratio checking and accessibility validation. * * @since v1.57.2 */ import type { SemanticColors } from './theme-types.js'; /** * WCAG compliance level */ export type WCAGLevel = 'AAA' | 'AA' | 'fail'; /** * WCAG compliance thresholds */ export declare const WCAG_THRESHOLDS: { readonly AAA_NORMAL: 7; readonly AA_NORMAL: 4.5; readonly AAA_LARGE: 4.5; readonly AA_LARGE: 3; readonly AA_UI: 3; }; /** * Contrast check result */ export interface ContrastResult { /** Contrast ratio (1.0 to 21.0) */ ratio: number; /** WCAG level for normal text */ normalText: WCAGLevel; /** WCAG level for large text */ largeText: WCAGLevel; /** WCAG level for UI components */ uiComponents: WCAGLevel; /** Whether the combination is accessible */ isAccessible: boolean; /** Human-readable summary */ summary: string; } /** * Check contrast between two colors */ export declare function checkContrast(foreground: string, background: string): ContrastResult; /** * Theme contrast check result for a specific pair */ export interface ThemeContrastPair { name: string; foreground: string; background: string; result: ContrastResult; } /** * Full theme accessibility report */ export interface ThemeAccessibilityReport { /** Overall accessibility score (0-100) */ score: number; /** All contrast checks */ pairs: ThemeContrastPair[]; /** Pairs that fail WCAG AA */ failures: ThemeContrastPair[]; /** Pairs that pass AA but not AAA */ warnings: ThemeContrastPair[]; /** Summary text */ summary: string; /** Whether theme passes minimum requirements */ passesMinimum: boolean; } /** * Check accessibility of a complete theme */ export declare function checkThemeAccessibility(colors: SemanticColors): ThemeAccessibilityReport; /** * Get a text representation of contrast ratio */ export declare function formatContrastRatio(ratio: number): string; /** * Get a visual progress bar for contrast */ export declare function getContrastProgressBar(ratio: number, width?: number): string; /** * Suggest improvements for a failing contrast */ export declare function suggestContrastFix(foreground: string, background: string, targetRatio?: number): { foreground: string; background: string; } | null; /** * Check if a color pair is considered "high contrast" */ export declare function isHighContrast(foreground: string, background: string): boolean; /** * Get color pair issues for terminal display */ export declare function getAccessibilityIssues(colors: SemanticColors): string[]; //# sourceMappingURL=contrast-checker.d.ts.map