/** * Calculates the contrast ratio of two different hex colors. */ export declare function calculateContrastRatio(hexColor: string, secondHexColor: string): number; /** * Calculates the luminance of a given Hex color. */ export declare function calculateLuminance(hexColor: string): number; /** * Calculates a corresponding rgb color (EX: rgb(0, 0, 0, 0.5)) based on the given canvas color and transparency value. */ export declare function calculateShadow(foregroundColor: string, opacity: number): string; /** * Calculates a corresponding hex color (EX: #fffff) based on the given background color and transparency value. */ export declare function calculateTransparentColor(foregroundColor: string, backgroundColor: string, opacity: number): string; /** * Converts a given hex color (EX: #fffff) to RGB (EX: rgb(255,255,255)) */ export declare function colorHexToRGB(hexColor: string): { r: number; g: number; b: number; } | undefined; /** * Converts a given RGB color (EX: rgb(255,255,255)) to its corresponding Hex value (EX: #fffff). */ export declare function colorRGBToHex(red: number, green: number, blue: number): string | undefined; /** * The subset collection of semantic colors and their different states. * Example: brand, brandPressed, brandHover, ... */ export declare type ColorSet = { [key in ColorSetKey | 'elevate' | 'hoverShadow']: string; }; declare type ColorSetKey = T | `${T}Hover` | `${T}Pressed` | `${T}Disabled` | `${T}ForegroundHover` | `${T}ForegroundPressed` | `${T}Background` | `${T}BackgroundDisabled`; /** * Generates a set of semantic color values that correspond with the given colors. */ export declare const createSemanticColor: (semanticColors: SemanticColors, canvasColor: string) => ColorSet; /** * Formats a given hex value */ export declare function formatHex(value: string): string; /** * Inverts the given hex color. * Example: #ffffff becomes #000000 */ export declare function invertColor(hexColor: string): string; declare type SemanticColorKey = T; /** * The collection of SemanticColors (brand, secondary, success, ...). */ export declare type SemanticColors = { [key in SemanticColorKey]: string; }; export declare function themeGenerator(props: ThemeGeneratorProps): { textColor: string; canvasColor: string; } & ColorSet; export declare type ThemeGeneratorProps = { /** * The color of your site's canvas. */ canvasColor: string; /** * The set of semantic colors to generate various states for. * * - Example: brand: '#2060CF' * - Returns: brand: '#2060CF', brandHover: '...', brandPressed: '...', ... */ semanticColors: SemanticColors; }; /** * Generates a set of Tokens (A map of CSS variable names) based on the provided Theme object. */ export declare function tokenGenerator(theme: TTheme): Record; export { }