/** Returns true if the string is a valid 3- or 6-digit hex color (with optional `#`). */
export declare function isValidHexColor(hex: string): boolean;
export declare type RgbColor = {
  r: number;
  g: number;
  b: number;
};
export declare type ParsedTokenValue = {
  rgb: RgbColor;
  a: number;
};
export declare type OklabColor = {
  L: number;
  a: number;
  b: number;
};
/** OKLCH — cylindrical OKLab. `h` is in degrees. */
export declare type OklchColor = {
  L: number;
  C: number;
  h: number;
};
/**
 * Calculate the contrast ratio between two colors per WCAG 2.0. The operation is
 * symmetric, so callers don't need to sort the arguments.
 *
 * @param {RgbColor} a - First color.
 * @param {RgbColor} b - Second color.
 * @returns {number} WCAG contrast ratio.
 * @see https://www.w3.org/TR/WCAG20/#contrast-ratiodef
 */
export declare function getContrastRatio(a: RgbColor, b: RgbColor): number;
/**
 * Composite a semi-transparent foreground color over an opaque background using the
 * standard alpha compositing formula.
 *
 * @param {RgbColor} fg - Foreground color.
 * @param {number} fgAlpha - Foreground alpha (0–1).
 * @param {RgbColor} bg - Background color.
 * @returns {RgbColor} Composited opaque color.
 */
export declare function alphaComposite(fg: RgbColor, fgAlpha: number, bg: RgbColor): RgbColor;
/**
 * Convert an RGB color to its hex string representation.
 *
 * @param {RgbColor} color - RGB color to convert.
 * @returns {string} Hex color string with leading `#`.
 */
export declare function rgbToHex(color: RgbColor): string;
/**
 * Parse a 3- or 6-char hex string into an RGB triplet.
 *
 * Throws on malformed input rather than returning a silently-NaN-poisoned color — a bad
 * hex here is a programmer error (invalid `actionColor` on `VegaThemeOverrideColors`) and
 * a fail-fast surface is easier to debug than garbage-propagating contrast ratios.
 *
 * @param {string} hex - Hex color string (3 or 6 digits, optional `#` prefix).
 * @returns {RgbColor} Parsed RGB triplet.
 */
export declare function hexToRgb(hex: string): RgbColor;
/**
 * Format a token value back to the `r g b / a` shape consumed by the theme layer.
 *
 * @param {RgbColor} rgb - RGB color.
 * @param {number} alpha - Alpha value (0–1).
 * @returns {string} Formatted token value string.
 */
export declare function formatTokenValue(rgb: RgbColor, alpha: number): string;
/**
 * Inverse of {@link formatTokenValue}. Returns `null` on unparseable input.
 *
 * @param {string} value - Token value string in `r g b / a` format.
 * @returns {ParsedTokenValue | null} Parsed result or null.
 */
export declare function parseTokenValue(value: string): ParsedTokenValue | null;
/**
 * Convert an RGB color to its OKLab representation.
 *
 * @param {RgbColor} rgb - RGB color to convert.
 * @returns {OklabColor} OKLab color.
 */
export declare function rgbToOklab(rgb: RgbColor): OklabColor;
/**
 * Convert an OKLab color to its RGB representation.
 *
 * @param {OklabColor} lab - OKLab color to convert.
 * @returns {RgbColor} RGB color.
 */
export declare function oklabToRgb(lab: OklabColor): RgbColor;
/**
 * Convert an OKLab color to its OKLCH (cylindrical) representation.
 *
 * @param {OklabColor} lab - OKLab color to convert.
 * @returns {OklchColor} OKLCH color.
 */
export declare function oklabToOklch(lab: OklabColor): OklchColor;
/**
 * Convert an OKLCH color to its OKLab (Cartesian) representation.
 *
 * @param {OklchColor} lch - OKLCH color to convert.
 * @returns {OklabColor} OKLab color.
 */
export declare function oklchToOklab(lch: OklchColor): OklabColor;
/**
 * Perceptual color distance in OKLab (Euclidean ΔE, since OKLab is designed to be uniform).
 *
 * @param {OklabColor} a - First OKLab color.
 * @param {OklabColor} b - Second OKLab color.
 * @returns {number} Euclidean distance in OKLab space.
 */
export declare function oklabDeltaE(a: OklabColor, b: OklabColor): number;
