export type ColorMode = 'light' | 'dark'; export type DatasetColorSpec = string; export interface DatasetColorPair { light?: string; dark?: string; } export type DatasetColor = DatasetColorSpec | DatasetColorPair; export declare const COLOR_MODES: ReadonlyArray; /** * Returns the right hex for the given mode. Falls back to the single * hex when the spec is a string. Returns null when the spec is null * or when the requested mode is missing from a pair. */ export declare function resolveColor(color: DatasetColor | null | undefined, mode: ColorMode): string | null; /** * True when the spec declares an explicit {light, dark} object. */ export declare function isColorPair(color: DatasetColor | null | undefined): color is DatasetColorPair; /** * Validates a color spec. A valid spec is either: * - a string matching /^#[0-9a-fA-F]{3,8}$/ * - an object with `light` and `dark` string fields, each matching * the same pattern * * Returns null when valid, or an error message describing the issue. */ export declare function validateColor(color: DatasetColor | null | undefined): string | null; //# sourceMappingURL=dataset-color.d.ts.map