export interface Rgb { r: number; g: number; b: number; } export interface Hsl { h: number; s: number; l: number; } export interface Theme { primary: string; onPrimary: string; primaryContainer: string; onPrimaryContainer: string; secondary: string; onSecondary: string; secondaryContainer: string; onSecondaryContainer: string; tertiary: string; onTertiary: string; tertiaryContainer: string; onTertiaryContainer: string; error: string; onError: string; errorContainer: string; onErrorContainer: string; background: string; onBackground: string; surface: string; onSurface: string; surfaceVariant: string; onSurfaceVariant: string; outline: string; outlineVariant: string; shadow: string; scrim: string; inverseSurface: string; inverseOnSurface: string; inversePrimary: string; surfaceDim: string; surfaceBright: string; surfaceContainerLowest: string; surfaceContainerLow: string; surfaceContainer: string; surfaceContainerHigh: string; surfaceContainerHighest: string; } /** * Parse a CSS color string into an {@link Rgb}. * * Accepts 6-digit hex (`#rrggbb`), 3-digit shorthand hex (`#rgb`, expanded by * doubling each nibble), and functional `rgb()` / `rgba()` notation (commas or * spaces, integer or percentage channels). Named colors and other formats are * not supported and yield `{ r: NaN, g: NaN, b: NaN }`; callers that accept * arbitrary input should validate before relying on the result. * * The leading `#` is optional for hex input. */ export declare function hexToRgb(hex: string): Rgb; export declare function rgbToHex(r: number, g: number, b: number): string; /** * Calculate relative luminance of a color per WCAG 2.1 * https://www.w3.org/WAI/GL/wiki/Relative_luminance */ export declare function getLuminance(rgb: Rgb): number; /** * Calculate contrast ratio between two colors per WCAG 2.1 * Returns a value between 1 and 21 */ export declare function getContrastRatio(fg: Rgb, bg: Rgb): number; /** * Check if contrast meets WCAG AA standard (4.5:1 for normal text, 3:1 for large text) */ export declare function meetsContrastAA(fg: string | Rgb, bg: string | Rgb, largeText?: boolean): boolean; /** * Check if contrast meets WCAG AAA standard (7:1 for normal text, 4.5:1 for large text) */ export declare function meetsContrastAAA(fg: string | Rgb, bg: string | Rgb, largeText?: boolean): boolean; export declare function generateTheme(seedColor: string, mode?: 'light' | 'dark'): Theme; //# sourceMappingURL=color.d.ts.map