export declare enum ColorMode { DEFAULT = 0, P16 = 1, P256 = 2, RGB = 3, } export declare class ContrastCache { private _rgb clear(): void setCss(bg: number, fg: number, value: string | null): void getCss(bg: number, fg: number): string | null | undefined } export declare function toCss(rgb: number): string export declare function toRgb(r: number, g: number, b: number): number export declare function relativeLuminance(rgb: number): number /** @return rgba */ export declare function blend(fg_rgba: number, bg_rgba: number): number export declare function contrastRatio(l1: number, l2: number): number export declare function ensureContrastRatio(fg_rgb: number, bg_rgb: number, ratio: number): number | undefined export declare function reduceLuminance(fg_rgb: number, bg_rgb: number, ratio: number): number export declare function increaseLuminance(fg_rgb: number, bg_rgb: number, ratio: number): number export interface ColorObject { rgb: number css: string } export declare function parseColor(value: string): number | null export declare function toColorObject(value: string): ColorObject | null export interface Theme { /** color: hex, rgb */ foreground?: string /** color: hex, rgb */ background?: string /** color: hex, rgb */ black?: string /** color: hex, rgb */ red?: string /** color: hex, rgb */ green?: string /** color: hex, rgb */ yellow?: string /** color: hex, rgb */ blue?: string /** color: hex, rgb */ magenta?: string /** color: hex, rgb */ cyan?: string /** color: hex, rgb */ white?: string /** color: hex, rgb */ gray?: string /** color: hex, rgb */ brightRed?: string /** color: hex, rgb */ brightGreen?: string /** color: hex, rgb */ brightYellow?: string /** color: hex, rgb */ brightBlue?: string /** color: hex, rgb */ brightMagenta?: string /** color: hex, rgb */ brightCyan?: string /** color: hex, rgb */ brightWhite?: string } export interface Palette { foreground?: ColorObject | null background?: ColorObject | null colors: (ColorObject | null)[] } export declare function createPalette(theme?: Theme): Palette