export declare enum BrightnessDirection { Light = 1, Dark = 2 } type ForegroundContentCandidates = { dark: T; light: T; }; export declare const yiqContrastedThreshold = 180; export declare class ColorHelpers { /** * Computes and returns the optimal foreground content for a given background color, * ensuring there is high contrast between them. * This function uses the YIQ formula to determine the brightness of the background color * and then chooses the best contrast option (i.e., the value that will stand out most clearly on this background) * from the provided content candidates. * * @template FOREGROUND_CONTENT_T - The type of the foreground content. * * @param {string} backgroundColor - The color code of the background, on top of which the content will appear. * @param {ForegroundContentCandidates} contentCandidates - The two potential candidates for foreground content. One optimized for light backgrounds, another one for dark backgrounds. * * @returns {FOREGROUND_CONTENT_T} - If the background is dark (closer to black), returns the "light" foreground content. If the background is light (closer to white), returns the "dark" foreground content. */ static getHighContrastContentOnBackgroundColor(backgroundColor: string, contentCandidates: ForegroundContentCandidates): FOREGROUND_CONTENT_T; /** * Determines the brightness direction (i.e., light or dark) of a given hex color. * * This function uses the YIQ formula to calculate the color's "brightness score". * Then, it compares this score to the predefined YIQ contrast threshold to determine whether * the color is closer to white (light) or black (dark). * * @param {string} hexColor - The hexadecimal color code to evaluate. * * @returns {BrightnessDirection} - The brightness direction of the color - either "light" or "dark". */ static getColorBrightnessDirectionByHexColor(hexColor: string): BrightnessDirection; /** * Calculates the YIQ contrast score of a given hex color. * * The YIQ score is a measure of the color's brightness, calculated from its RGB components. * Lower scores indicate darker colors, while higher scores indicate lighter colors. * * @param {string} hexColor - The hexadecimal color code to convert to a YIQ contrast score. * * @returns {number} - The YIQ contrast score of the color. */ static getYiqContrastScoreByHexColor(hexColor: string): number; /** * Get a normalized hex color from any hex color string * * f1f1f1f -> f1f1f1 * f1f1f1 -> f1f1f1 * f1f1f -> f1f1f0 * f1f -> ff11ff * f1 -> ff1100 * f -> ff0000 * '' -> 000000 * #ffffff -> ffffff * * @param color original color * @returns normalized hexadecimal color with format RRGGBB */ static normalizeHexColor(color: string): string; } export {}; //# sourceMappingURL=color-helpers.d.ts.map