Colors-LE
v2.5.0Extract colors from stylesheets and code, with their notation and position.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
extract_colors
Extract every color from a stylesheet or document, with its notation and 1-based line and column. Reads CSS, SCSS, LESS, Stylus, HTML, JavaScript, TypeScript, SVG, XML, JSON, YAML, TOML, Markdown and plain text by name, and anything else as raw text, so a format is optional. Reports hex, rgb/rgba, hsl/hsla, hwb, lab, lch, oklab, oklch, color() and named colors as written.
| Parameter | Type | Description |
|---|---|---|
content * | string | The document text to scan. |
dedupe | boolean | Collapse repeated colors to their first occurrence. |
filename | string | Filename used to infer the format when `format` is absent, e.g. "theme.scss". |
format | string | Document format. Optional — an unrecognised or absent format is read as raw text and reported as "unknown". |
maxResults | integer | Cap on returned colors (default 500). meta.truncated reports whether any were dropped. |