/** * The CSS named-colour table. * * A static table rather than a `getComputedStyle` probe, for three reasons that * all matter to a grid: it works with no DOM at all (server-side rendering, * tests, a worker), it costs no layout read on the render path, and it gives the * same answer on every platform. Probing the DOM would mean a style write and a * computed-style read per distinct value — a forced synchronous style * recalculation in the middle of rendering a viewport, which is precisely the * cost `CLAUDE.md` rules out. * * Values are stored as bare six-digit hex — no `#`, lower case — because that is * the form {@link parseColor} consumes, and skipping the prefix keeps the table * a little under 3 KB in the bundle. * * @packageDocumentation */ /** * The hex digits for a CSS colour keyword, or `undefined` when the name is not * one. * * @param name - A colour keyword. Matched case-insensitively, since `Red`, * `RED` and `red` are the same colour to CSS and all three turn up in real * data. * @returns Six lower-case hex digits, without a leading `#`. */ export declare function hexForName(name: string): string | undefined; /** * The CSS keyword for a colour, or `undefined` when it has no name. * * The inverse is one-to-many — `#00ffff` is both `aqua` and `cyan`, `#808080` * both `gray` and `grey` — and this answers with whichever the table lists * first, so the result is stable rather than merely arbitrary. The `gray` * spellings precede the `grey` ones in the table, which makes the American * spelling the canonical answer, matching the CSS specification's own ordering. * * @param hex - Six hex digits, with or without a leading `#`. Case-insensitive. * @returns The keyword, or `undefined` when no named colour has that value. */ export declare function nameForHex(hex: string): string | undefined; /** `true` when `name` is a CSS colour keyword. Case-insensitive. */ export declare function isColorName(name: string): boolean; /** * Every supported colour keyword, lower case, in specification order. * * The list a colour picker's "named colours" palette or a column filter's * autocomplete would be built from. */ export declare function colorNames(): readonly string[]; //# sourceMappingURL=color-names.d.ts.map