Colors-LE

v2.5.0
io.github.nolindnaidoo/colors-le Checked 2 days ago Published 1 month ago

Extract 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.

ParameterTypeDescription
content *stringThe document text to scan.
dedupebooleanCollapse repeated colors to their first occurrence.
filenamestringFilename used to infer the format when `format` is absent, e.g. "theme.scss".
formatstringDocument format. Optional — an unrecognised or absent format is read as raw text and reported as "unknown".
maxResultsintegerCap on returned colors (default 500). meta.truncated reports whether any were dropped.