/**
 * @file color.ts
 * @input CSS color strings (hex, rgb()/rgba(), a small set of named colors)
 * @output Shared color parsing/formatting primitives used across the design system
 * @position Package utility; backs theme token resolution, HCT color math, and chart/WebGL rendering
 *
 * A single home for the color parsers that were previously duplicated across
 * the theme layer, charts, and lab. Consumers get one well-tested definition of
 * "parse this color" rather than several subtly different regexes.
 */
/** A color decomposed into 0-255 RGB channels and a 0-1 alpha. */
export interface RGBA {
    r: number;
    g: number;
    b: number;
    a: number;
}
/**
 * Parse a hex color into {@link RGBA}. Accepts `#rgb`, `#rgba`, `#rrggbb`, and
 * `#rrggbbaa`, with or without the leading `#`. Returns null for anything else.
 */
export declare function parseHex(hex: string): RGBA | null;
/**
 * Parse an `rgb()`/`rgba()` color into {@link RGBA}. Accepts comma- or
 * space-separated channels, an optional `/ alpha`, and percentage channels.
 */
export declare function parseRgb(value: string): RGBA | null;
/**
 * Parse a concrete CSS color string into {@link RGBA}. Supports hex,
 * `rgb()`/`rgba()`, and the named colors used in token expressions. Returns
 * null for anything it can't evaluate (e.g. `var()`, `oklch()`, unknown names)
 * so callers can preserve the original expression rather than guessing.
 */
export declare function parseColor(value: string): RGBA | null;
/** Format RGB channels (0-255) as an uppercase `#RRGGBB` string. */
export declare function formatHex(r: number, g: number, b: number): string;
/**
 * Serialize {@link RGBA} to a compact, JS-usable CSS color: `#RRGGBB` when
 * fully opaque, otherwise `rgba(r, g, b, a)`.
 */
export declare function formatColor({ r, g, b, a }: RGBA): string;
/**
 * Convert a parsed {@link RGBA} to `[r, g, b]` floats in 0-1 for WebGL
 * uniforms and attributes.
 *
 * Takes the parsed type rather than a raw string so every caller goes through
 * one validation path ({@link parseHex} / {@link parseColor}) — compose as
 * `toGLFloats(parseHex(color))`. Unparseable input (null) and non-finite
 * channels return a neutral mid-grey fallback, so the GPU never receives a
 * NaN uniform. Alpha is intentionally dropped — GL chart paths blend with
 * their own alpha.
 */
export declare function toGLFloats(color: RGBA | null): [number, number, number];
//# sourceMappingURL=color.d.ts.map