/** * Grid3 Color Utilities * * Comprehensive color handling for Grid3 format, including: * - CSS color name lookup (147 named colors) * - Color format conversion (hex, RGB, RGBA, named colors) * - Color manipulation (darkening, normalization) * - Grid3-specific color formatting (8-digit ARGB hex) */ /** * Get RGB values for a CSS color name * @param name - CSS color name (case-insensitive) * @returns RGB tuple [r, g, b] or undefined if not found */ export declare function getNamedColor(name: string): [number, number, number] | undefined; /** * Convert RGBA values to hex format * @param r - Red channel (0-255) * @param g - Green channel (0-255) * @param b - Blue channel (0-255) * @param a - Alpha channel (0-1) * @returns Hex color string in format #RRGGBBAA */ export declare function rgbaToHex(r: number, g: number, b: number, a: number): string; /** * Convert a single color channel value to hex * @param value - Channel value (0-255) * @returns Two-digit hex string */ export declare function channelToHex(value: number): string; /** * Clamp RGB channel value to valid range * @param value - Channel value * @returns Clamped value (0-255) */ export declare function clampColorChannel(value: number): number; /** * Clamp alpha value to valid range * @param value - Alpha value * @returns Clamped value (0-1) */ export declare function clampAlpha(value: number): number; /** * Convert any color format to hex * Supports: hex (#RGB, #RRGGBB, #RRGGBBAA), RGB/RGBA, and CSS color names * @param value - Color string in any supported format * @returns Hex color string (#RRGGBBAA) or undefined if invalid */ export declare function toHexColor(value: string): string | undefined; /** * Darken a hex color by a specified amount * @param hex - Hex color string * @param amount - Amount to darken (0-255) * @returns Darkened hex color */ export declare function darkenColor(hex: string, amount: number): string; /** * Lighten a hex color by a specified amount * @param hex - Hex color string * @param amount - Amount to lighten (0-255) * @returns Lightened hex color */ export declare function lightenColor(hex: string, amount: number): string; /** * Convert hex color to RGBA object * @param hex - Hex color string (#RRGGBB or #RRGGBBAA) * @returns RGBA object with r, g, b, a properties (0-1 for alpha) */ export declare function hexToRgba(hex: string): { r: number; g: number; b: number; a: number; }; /** * Normalize any color format to Grid3's 8-digit hex format * @param input - Color string in any supported format * @param fallback - Fallback color if input is invalid (default: white) * @returns Normalized color in format #AARRGGBBFF */ export declare function normalizeColor(input: string, fallback?: string): string; /** * Ensure a color has an alpha channel (Grid3 format requires 8-digit ARGB) * @param color - Color string (hex format) * @returns Color with alpha channel in format #AARRGGBBFF */ export declare function ensureAlphaChannel(color: string | undefined): string;