export interface BranchPalette { id: string; name: string; /** Hex colors cycled across top-level branches, in display order. */ colors: string[]; } export declare const BUILTIN_PALETTES: readonly BranchPalette[]; /** * Resolve a palette by id from a combined list of built-ins and * user-defined custom palettes. Falls back to the default palette * if `id` is missing or points at a deleted custom palette. Pure * — no DOM, no reactive deps — so it can be called from a computed * or a watch. */ export declare function resolvePalette(id: string, customPalettes?: readonly BranchPalette[]): BranchPalette; /** * Parse a free-form text blob into a cleaned color array. Accepts: * * 1. **Hex codes** — `#rgb` / `#rgba` / `#rrggbb` / `#rrggbbaa`, * with or without the leading `#`. The alpha channel on * 4- or 8-digit hex is silently dropped. * 2. **`rgb()` / `rgba()` functions** — `rgb(255, 99, 71)`, * `rgba(255,99,71,0.5)`. Whitespace and percentage values * are both accepted (matches CSS rules). Alpha dropped. * 3. **CSS named colors** — the 30 most common (`red`, `tomato`, * `coral`, `teal`, …). A small curated set keeps the parser * from silently accepting typos that look color-ish * (`tan`, `peru` are in; `chartreuse1` is not). * 4. **JSON / JS array** — `['#f87171', 'red']`, * `["#f87171","rgb(0,0,255)"]`, even a single-line * `["red","blue"]`. Bracket and quote chars are tolerated * so a copy-pasted `[…]` round-trips cleanly. * 5. **Any-delimiter blob** — the parser scans the raw text for * color-shaped substrings rather than splitting on commas, * so a user can paste `rgb(255, 0, 0), #0f0, blue` and every * piece lands. * * Malformed tokens are dropped silently (consistent with the * rest of the canvas's "paste messy text" UX). Returns at most * `maxColors` entries; output is lowercased `#rrggbb` for stable * dedup and direct comparison with `BUILTIN_PALETTES`. */ export declare function parsePaletteInput(text: string, maxColors?: number): string[];