Palette export
@slashclone/palette-export
Turn your design tokens into a downloadable color palette: a swatch sheet (SVG), JSON, CSS variables, and a GIMP palette that Krita and Inkscape also open. Handy for briefing designers or image models with your exact colors. Reads one colors file and writes only to an out folder.
- Activity
- New: be the first to try it
- Installs
- 0 installs
- Likes
- 0 likes
- Clones
- 0 clones
- 1---
- 2name: palette-export
- 3description: Export a project's colors as a shareable palette (SVG swatch sheet, JSON, CSS variables, GIMP palette). Use when someone asks for a download of their color palette, wants to brief a designer or an image model with exact brand colors, or needs their tokens in a design tool.
- 4---
- 6# Palette export
- 8Goal: the project's real colors, in files people can open anywhere, without retyping a single hex.
- 10## Steps
- 121. **Find the source of truth.** Look for the design tokens (a `tokens.ts`, `theme.ts`, Tailwind config, or CSS variables). Use the values the product actually ships, never colors guessed from screenshots.
- 132. **Write `data/colors.json`.** Group the colors the way the team talks about them (neutrals, brand, accents, status), with a short note on what each group is for. Format: see `examples/colors.json`. A flat `{ "name": "#RRGGBB" }` map works too.
- 143. **Run it:**
- 15 `node scripts/export-palette.mjs --in data/colors.json --name "Brand" --out out`
- 16 It writes `out/palette.json`, `palette.css`, `palette.gpl`, and `palette.svg`.
- 174. **Need a PNG?** Convert the SVG with whatever the machine has (on macOS, `qlmanage -t -s 2400 out/palette.svg`; elsewhere `rsvg-convert` or a browser screenshot). Say which tool you used.
- 185. **Hand it over.** Point to the files and name the few colors that set the look, with a note on proportions if the brand has one (for example, how much of a frame the accent should cover).
- 20## Rules
- 22- Every hex comes from the project's own tokens. If two sources disagree, say so and ask which wins.
- 23- Keep text and non-text colors labeled: a brand green that is only for marks must not be handed over as a text color.
- 24- Do not commit the exports unless the person asks; they are generated files.

