/** * @license * Copyright 2025 Steven Roussey * SPDX-License-Identifier: Apache-2.0 */ export interface ColorObject { readonly r: number; readonly g: number; readonly b: number; readonly a: number; } /** * Parse a `#RGB` / `#RGBA` / `#RRGGBB` / `#RRGGBBAA` hex color into a {@link ColorObject}. * Case-insensitive on input. No whitespace tolerance. Shorthand nibbles are doubled. * Throws on any malformed input. */ export declare function parseHexColor(hex: string): ColorObject; /** * Emit a {@link ColorObject} as `#RRGGBB` when `a === 255`, otherwise `#RRGGBBAA`. * Always lowercase, never shorthand. Throws on non-integer or out-of-range channels. */ export declare function toHexColor(c: ColorObject): string; /** * Type guard for a {@link ColorObject}-shaped value (alpha optional). * Does not reject extra properties — JSON Schema validation handles that separately. */ export declare function isColorObject(value: unknown): value is ColorObject; /** Type guard for a hex color string (same regex as `parseHexColor`). */ export declare function isHexColor(value: unknown): value is string; /** * Normalize any accepted wire form to a full {@link ColorObject}. Object inputs * default `a` to 255; CSS `rgb(...)` / `rgba(...)` strings use 0-1 alpha. * Throws on anything that's not an accepted color value. */ export declare function resolveColor(value: string | { r: number; g: number; b: number; a?: number; }): ColorObject; //# sourceMappingURL=color.d.ts.map