CLI
The color-map package ships a color-map command next to the library. It is built for agents: output is TOON by default and --format json gives JSON; essential fields print by default and --full adds the rest; empty results say so; every text pair carries its ratio.
npx color-map palette '#3b82f6'The command has no runtime dependencies to install: npx color-map runs it from the same package as the library.
Commands
Section titled “Commands”| Command | Use it to |
|---|---|
convert <color> --to <space> [--gamut <gamut>] |
change space; --gamut maps into a gamut instead of clipping |
mix <a> <b> [--amount 0.5] [--in oklab] |
blend as color-mix() does |
contrast <fg> <bg> |
the WCAG 2 ratio with the AA and AAA verdicts |
find-contrast <bg> --target 4.5 |
find a color that reaches a ratio |
scale <seed> [--preset ...] [--brand] [--targets ...] |
a preset scale, a brand scale, or a contrast scale |
palette <brand> [--mode dark] [--target ...] |
the semantic palette, each pair with its ratio |
harmony <color> --scheme ... |
related hues |
export [color] --to css|tailwind|dtcg |
write CSS variables, a Tailwind v4 theme or DTCG tokens |
schema [command] |
print a command’s JSON Schema |
Colors are any CSS color, including color-mix() and relative colors. Run color-map <command> --help for a command’s options.
Contrast
Section titled “Contrast”Contrast is WCAG 2. The CLI has no option to choose another measure.
Errors
Section titled “Errors”A failed call exits 1 (the work failed) or 2 (the call was wrong) and prints error, code and help on stdout. Nothing prompts, and an unknown option fails instead of being ignored.
Machine-readable help
Section titled “Machine-readable help”- JSON Schemas for every command’s arguments and options ship in the package under
schemas/and print withcolor-map schema <command>. llms.txtin the package maps the commands.