Generate an HTML “colour palette” report from a codebase by scanning for hard-coded colour literals.
The script recursively scans a directory for common colour formats (hex, rgb()/rgba(), hsl()/hsla()) in these file types:
.css.js.ts.html.svelteIt outputs a single HTML file showing swatches grouped by similar colours. Clicking a swatch opens a details panel listing every place that colour was found (file + line number + the full line of code).
python3)Scan a directory and write colour-palette.html in the current directory:
python3 generate_color_palette.py path/to/your/repo
Choose an output path/name:
python3 generate_color_palette.py path/to/your/repo --out ./colour-palette.html
Open the generated HTML file in your browser.
node_modules, dist, build, .git, virtualenv folders).