color-map 2.2.0 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +12 -0
- package/.codex-plugin/plugin.json +12 -0
- package/.cursor-plugin/plugin.json +12 -0
- package/CHANGELOG.md +100 -0
- package/README.md +71 -8
- package/bin/cli-CELmx3Y9.js +6414 -0
- package/bin/color-map.js +9 -0
- package/bin/index.js +1 -0
- package/cjs/color/index.d.ts +5 -0
- package/cjs/color/index.js +52 -0
- package/cjs/color-wNrkrhC7.js +374 -0
- package/cjs/color-wNrkrhC7.js.map +1 -0
- package/cjs/contrast-XjF5Rwui.js +293 -0
- package/cjs/contrast-XjF5Rwui.js.map +1 -0
- package/cjs/gamut-CG1J2aat.d.ts +158 -0
- package/cjs/gamut-CG1J2aat.d.ts.map +1 -0
- package/cjs/index-BcEqCPHz.d.ts +137 -0
- package/cjs/index-BcEqCPHz.d.ts.map +1 -0
- package/cjs/index-CGKCqRqD.d.ts +111 -0
- package/cjs/index-CGKCqRqD.d.ts.map +1 -0
- package/cjs/index-Cv3iUUYE.d.ts +171 -0
- package/cjs/index-Cv3iUUYE.d.ts.map +1 -0
- package/cjs/index-Dw43Hj4v.d.ts +41 -0
- package/cjs/index-Dw43Hj4v.d.ts.map +1 -0
- package/cjs/index-Dy8UARqO.d.ts +72 -0
- package/cjs/index-Dy8UARqO.d.ts.map +1 -0
- package/cjs/index.d.ts +26 -36
- package/cjs/index.d.ts.map +1 -1
- package/cjs/index.js +83 -62
- package/cjs/index.js.map +1 -1
- package/cjs/legacy/index.d.ts +2 -0
- package/cjs/legacy/index.js +75 -0
- package/cjs/legacy/index.js.map +1 -0
- package/cjs/mix-Cs4owSbW.js +158 -0
- package/cjs/mix-Cs4owSbW.js.map +1 -0
- package/cjs/mix-DGlKoUw4.d.ts +31 -0
- package/cjs/mix-DGlKoUw4.d.ts.map +1 -0
- package/cjs/palette/index.d.ts +3 -0
- package/cjs/palette/index.js +8 -0
- package/cjs/palette-DyFV_KoJ.js +332 -0
- package/cjs/palette-DyFV_KoJ.js.map +1 -0
- package/cjs/parse-8mt2OMKf.js +1508 -0
- package/cjs/parse-8mt2OMKf.js.map +1 -0
- package/cjs/scale/index.d.ts +2 -0
- package/cjs/scale/index.js +11 -0
- package/cjs/scale-Cq9pXrc1.js +318 -0
- package/cjs/scale-Cq9pXrc1.js.map +1 -0
- package/cjs/semantic-CrEIo8tS.d.ts +52 -0
- package/cjs/semantic-CrEIo8tS.d.ts.map +1 -0
- package/cjs/serialize-C69DAmoE.d.ts +25 -0
- package/cjs/serialize-C69DAmoE.d.ts.map +1 -0
- package/cjs/serialize-Ci2X0cPN.js +103 -0
- package/cjs/serialize-Ci2X0cPN.js.map +1 -0
- package/cjs/tokens/index.d.ts +2 -0
- package/cjs/tokens/index.js +6 -0
- package/cjs/tokens-CzXxaMgM.js +168 -0
- package/cjs/tokens-CzXxaMgM.js.map +1 -0
- package/cjs/tone-BAhu-QzQ.js +118 -0
- package/cjs/tone-BAhu-QzQ.js.map +1 -0
- package/dist/color-map.es5.js.map +1 -1
- package/esm/color/a98-rgb.d.ts +7 -0
- package/esm/color/a98-rgb.d.ts.map +1 -0
- package/esm/color/a98-rgb.js +13 -0
- package/esm/color/a98-rgb.js.map +1 -0
- package/esm/color/argb.d.ts +6 -0
- package/esm/color/argb.d.ts.map +1 -0
- package/esm/color/argb.js +25 -0
- package/esm/color/argb.js.map +1 -0
- package/esm/color/calc.js +82 -0
- package/esm/color/calc.js.map +1 -0
- package/esm/color/compare.d.ts +20 -0
- package/esm/color/compare.d.ts.map +1 -0
- package/esm/color/compare.js +46 -0
- package/esm/color/compare.js.map +1 -0
- package/esm/color/contrast.d.ts +107 -0
- package/esm/color/contrast.d.ts.map +1 -0
- package/esm/color/contrast.js +242 -0
- package/esm/color/contrast.js.map +1 -0
- package/esm/color/convert.d.ts +9 -0
- package/esm/color/convert.d.ts.map +1 -0
- package/esm/color/convert.js +45 -0
- package/esm/color/convert.js.map +1 -0
- package/esm/color/display-p3-linear.d.ts +7 -0
- package/esm/color/display-p3-linear.d.ts.map +1 -0
- package/esm/color/display-p3-linear.js +12 -0
- package/esm/color/display-p3-linear.js.map +1 -0
- package/esm/color/display-p3.d.ts +7 -0
- package/esm/color/display-p3.d.ts.map +1 -0
- package/esm/color/display-p3.js +12 -0
- package/esm/color/display-p3.js.map +1 -0
- package/esm/color/expr.d.ts +43 -0
- package/esm/color/expr.d.ts.map +1 -0
- package/esm/color/expr.js +160 -0
- package/esm/color/expr.js.map +1 -0
- package/esm/color/gamut.d.ts +31 -0
- package/esm/color/gamut.d.ts.map +1 -0
- package/esm/color/gamut.js +210 -0
- package/esm/color/gamut.js.map +1 -0
- package/esm/color/hsl.d.ts +7 -0
- package/esm/color/hsl.d.ts.map +1 -0
- package/esm/color/hsl.js +67 -0
- package/esm/color/hsl.js.map +1 -0
- package/esm/color/hwb.d.ts +7 -0
- package/esm/color/hwb.d.ts.map +1 -0
- package/esm/color/hwb.js +40 -0
- package/esm/color/hwb.js.map +1 -0
- package/esm/color/index.d.ts +28 -0
- package/esm/color/index.js +27 -0
- package/esm/color/lab.d.ts +7 -0
- package/esm/color/lab.d.ts.map +1 -0
- package/esm/color/lab.js +33 -0
- package/esm/color/lab.js.map +1 -0
- package/esm/color/lch.d.ts +7 -0
- package/esm/color/lch.d.ts.map +1 -0
- package/esm/color/lch.js +11 -0
- package/esm/color/lch.js.map +1 -0
- package/esm/color/math.js +32 -0
- package/esm/color/math.js.map +1 -0
- package/esm/color/matrices.js +180 -0
- package/esm/color/matrices.js.map +1 -0
- package/esm/color/mix.d.ts +30 -0
- package/esm/color/mix.d.ts.map +1 -0
- package/esm/color/mix.js +152 -0
- package/esm/color/mix.js.map +1 -0
- package/esm/color/named.js +11 -0
- package/esm/color/named.js.map +1 -0
- package/esm/color/oklab.d.ts +7 -0
- package/esm/color/oklab.d.ts.map +1 -0
- package/esm/color/oklab.js +21 -0
- package/esm/color/oklab.js.map +1 -0
- package/esm/color/oklch.d.ts +7 -0
- package/esm/color/oklch.d.ts.map +1 -0
- package/esm/color/oklch.js +11 -0
- package/esm/color/oklch.js.map +1 -0
- package/esm/color/parse.d.ts +9 -0
- package/esm/color/parse.d.ts.map +1 -0
- package/esm/color/parse.js +452 -0
- package/esm/color/parse.js.map +1 -0
- package/esm/color/polar.js +27 -0
- package/esm/color/polar.js.map +1 -0
- package/esm/color/prophoto-rgb.d.ts +7 -0
- package/esm/color/prophoto-rgb.d.ts.map +1 -0
- package/esm/color/prophoto-rgb.js +18 -0
- package/esm/color/prophoto-rgb.js.map +1 -0
- package/esm/color/rec2020.d.ts +7 -0
- package/esm/color/rec2020.d.ts.map +1 -0
- package/esm/color/rec2020.js +13 -0
- package/esm/color/rec2020.js.map +1 -0
- package/esm/color/resolve.d.ts +18 -0
- package/esm/color/resolve.d.ts.map +1 -0
- package/esm/color/resolve.js +98 -0
- package/esm/color/resolve.js.map +1 -0
- package/esm/color/rgb.js +20 -0
- package/esm/color/rgb.js.map +1 -0
- package/esm/color/serialize.d.ts +24 -0
- package/esm/color/serialize.d.ts.map +1 -0
- package/esm/color/serialize.js +88 -0
- package/esm/color/serialize.js.map +1 -0
- package/esm/color/spaces.d.ts +6 -0
- package/esm/color/spaces.d.ts.map +1 -0
- package/esm/color/spaces.js +42 -0
- package/esm/color/spaces.js.map +1 -0
- package/esm/color/srgb-linear.d.ts +7 -0
- package/esm/color/srgb-linear.d.ts.map +1 -0
- package/esm/color/srgb-linear.js +12 -0
- package/esm/color/srgb-linear.js.map +1 -0
- package/esm/color/srgb.d.ts +7 -0
- package/esm/color/srgb.d.ts.map +1 -0
- package/esm/color/srgb.js +12 -0
- package/esm/color/srgb.js.map +1 -0
- package/esm/color/transfer.js +11 -0
- package/esm/color/transfer.js.map +1 -0
- package/esm/color/types.d.ts +23 -0
- package/esm/color/types.d.ts.map +1 -0
- package/esm/color/unknown-name.js +16 -0
- package/esm/color/unknown-name.js.map +1 -0
- package/esm/color/xyz-d50.d.ts +7 -0
- package/esm/color/xyz-d50.d.ts.map +1 -0
- package/esm/color/xyz-d50.js +15 -0
- package/esm/color/xyz-d50.js.map +1 -0
- package/esm/color/xyz-d65.d.ts +4 -0
- package/esm/color/xyz-d65.d.ts.map +1 -0
- package/esm/color/xyz-d65.js +10 -0
- package/esm/color/xyz-d65.js.map +1 -0
- package/esm/index.d.ts +63 -6
- package/esm/index.d.ts.map +1 -0
- package/esm/index.js +54 -5
- package/esm/index.js.map +1 -0
- package/esm/legacy/createColors.d.ts +9 -0
- package/esm/legacy/createColors.d.ts.map +1 -0
- package/esm/{createColors.js → legacy/createColors.js} +7 -2
- package/esm/legacy/createColors.js.map +1 -0
- package/esm/legacy/createColorsFromMap.d.ts +9 -0
- package/esm/legacy/createColorsFromMap.d.ts.map +1 -0
- package/esm/{createColorsFromMap.js → legacy/createColorsFromMap.js} +4 -2
- package/esm/legacy/createColorsFromMap.js.map +1 -0
- package/esm/legacy/index.d.ts +6 -0
- package/esm/legacy/index.js +5 -0
- package/esm/legacy/interfaces.d.ts +19 -0
- package/esm/legacy/interfaces.d.ts.map +1 -0
- package/esm/{rgbHex.d.ts → legacy/rgbHex.d.ts} +1 -4
- package/esm/legacy/rgbHex.d.ts.map +1 -0
- package/esm/{rgbHex.js → legacy/rgbHex.js} +1 -2
- package/esm/legacy/rgbHex.js.map +1 -0
- package/esm/legacy/rgbaString.d.ts +4 -0
- package/esm/{rgbaString.d.ts.map → legacy/rgbaString.d.ts.map} +1 -1
- package/esm/legacy/rgbaString.js +8 -0
- package/esm/legacy/rgbaString.js.map +1 -0
- package/esm/palette/dark.d.ts +23 -0
- package/esm/palette/dark.d.ts.map +1 -0
- package/esm/palette/dark.js +54 -0
- package/esm/palette/dark.js.map +1 -0
- package/esm/palette/harmony.d.ts +56 -0
- package/esm/palette/harmony.d.ts.map +1 -0
- package/esm/palette/harmony.js +115 -0
- package/esm/palette/harmony.js.map +1 -0
- package/esm/palette/index.d.ts +5 -0
- package/esm/palette/index.js +5 -0
- package/esm/palette/semantic.d.ts +53 -0
- package/esm/palette/semantic.d.ts.map +1 -0
- package/esm/palette/semantic.js +96 -0
- package/esm/palette/semantic.js.map +1 -0
- package/esm/palette/validate.d.ts +39 -0
- package/esm/palette/validate.d.ts.map +1 -0
- package/esm/palette/validate.js +56 -0
- package/esm/palette/validate.js.map +1 -0
- package/esm/scale/brand.d.ts +21 -0
- package/esm/scale/brand.d.ts.map +1 -0
- package/esm/scale/brand.js +63 -0
- package/esm/scale/brand.js.map +1 -0
- package/esm/scale/contrast-scale.d.ts +33 -0
- package/esm/scale/contrast-scale.d.ts.map +1 -0
- package/esm/scale/contrast-scale.js +26 -0
- package/esm/scale/contrast-scale.js.map +1 -0
- package/esm/scale/gradient.d.ts +38 -0
- package/esm/scale/gradient.d.ts.map +1 -0
- package/esm/scale/gradient.js +73 -0
- package/esm/scale/gradient.js.map +1 -0
- package/esm/scale/index.d.ts +6 -0
- package/esm/scale/index.js +6 -0
- package/esm/scale/scale.d.ts +31 -0
- package/esm/scale/scale.d.ts.map +1 -0
- package/esm/scale/scale.js +152 -0
- package/esm/scale/scale.js.map +1 -0
- package/esm/scale/tone.d.ts +25 -0
- package/esm/scale/tone.d.ts.map +1 -0
- package/esm/scale/tone.js +96 -0
- package/esm/scale/tone.js.map +1 -0
- package/esm/tokens/css.d.ts +18 -0
- package/esm/tokens/css.d.ts.map +1 -0
- package/esm/tokens/css.js +23 -0
- package/esm/tokens/css.js.map +1 -0
- package/esm/tokens/dtcg.d.ts +33 -0
- package/esm/tokens/dtcg.d.ts.map +1 -0
- package/esm/tokens/dtcg.js +42 -0
- package/esm/tokens/dtcg.js.map +1 -0
- package/esm/tokens/index.d.ts +5 -0
- package/esm/tokens/index.js +4 -0
- package/esm/tokens/tailwind.d.ts +19 -0
- package/esm/tokens/tailwind.d.ts.map +1 -0
- package/esm/tokens/tailwind.js +19 -0
- package/esm/tokens/tailwind.js.map +1 -0
- package/esm/tokens/tokens.d.ts +11 -0
- package/esm/tokens/tokens.d.ts.map +1 -0
- package/esm/tokens/tokens.js +77 -0
- package/esm/tokens/tokens.js.map +1 -0
- package/llms.txt +48 -0
- package/package.json +277 -64
- package/plugin.json +18 -0
- package/schemas/contrast.schema.json +24 -0
- package/schemas/convert.schema.json +60 -0
- package/schemas/export.schema.json +106 -0
- package/schemas/find-contrast.schema.json +51 -0
- package/schemas/harmony.schema.json +58 -0
- package/schemas/mix.schema.json +72 -0
- package/schemas/palette.schema.json +56 -0
- package/schemas/scale.schema.json +86 -0
- package/skills/color-map/SKILL.md +38 -0
- package/src/cli/bin.ts +11 -0
- package/src/cli/cli.ts +40 -0
- package/src/cli/commands/contrast.ts +36 -0
- package/src/cli/commands/convert.ts +37 -0
- package/src/cli/commands/export.ts +102 -0
- package/src/cli/commands/find-contrast.ts +37 -0
- package/src/cli/commands/harmony.ts +30 -0
- package/src/cli/commands/mix.ts +29 -0
- package/src/cli/commands/palette.ts +66 -0
- package/src/cli/commands/scale.ts +75 -0
- package/src/cli/index.ts +3 -0
- package/src/cli/schema-command.ts +31 -0
- package/src/cli/schemas.ts +86 -0
- package/src/cli/shared.ts +72 -0
- package/src/cli/testing.ts +27 -0
- package/src/color/a98-rgb.ts +11 -0
- package/src/color/argb.ts +21 -0
- package/src/color/calc.ts +84 -0
- package/src/color/compare.ts +53 -0
- package/src/color/contrast.ts +277 -0
- package/src/color/convert.ts +43 -0
- package/src/color/display-p3-linear.ts +9 -0
- package/src/color/display-p3.ts +9 -0
- package/src/color/expr.ts +158 -0
- package/src/color/gamut.ts +215 -0
- package/src/color/hsl.ts +57 -0
- package/src/color/hwb.ts +26 -0
- package/src/color/index.ts +43 -0
- package/src/color/lab.ts +29 -0
- package/src/color/lch.ts +8 -0
- package/src/color/math.ts +30 -0
- package/src/color/matrices.ts +91 -0
- package/src/color/mix.ts +158 -0
- package/src/color/named.ts +13 -0
- package/src/color/oklab.ts +19 -0
- package/src/color/oklch.ts +8 -0
- package/src/color/parse.ts +355 -0
- package/src/color/polar.ts +17 -0
- package/src/color/prophoto-rgb.ts +18 -0
- package/src/color/rec2020.ts +11 -0
- package/src/color/resolve.ts +87 -0
- package/src/color/rgb.ts +20 -0
- package/src/color/serialize.ts +96 -0
- package/src/color/spaces.ts +42 -0
- package/src/color/srgb-linear.ts +9 -0
- package/src/color/srgb.ts +9 -0
- package/src/color/test-utils.ts +10 -0
- package/src/color/transfer.ts +14 -0
- package/src/color/types.ts +41 -0
- package/src/color/unknown-name.ts +15 -0
- package/src/color/xyz-d50.ts +13 -0
- package/src/color/xyz-d65.ts +8 -0
- package/src/index.ts +37 -0
- package/{ts → src/legacy}/createColors.ts +6 -0
- package/{ts → src/legacy}/createColorsFromMap.ts +3 -0
- package/{ts → src/legacy}/interfaces.ts +4 -0
- package/{ts → src/legacy}/rgbaString.ts +1 -0
- package/src/palette/dark.ts +55 -0
- package/src/palette/harmony.ts +107 -0
- package/src/palette/index.ts +18 -0
- package/src/palette/semantic.ts +120 -0
- package/src/palette/validate.ts +82 -0
- package/src/scale/brand.ts +50 -0
- package/src/scale/contrast-scale.ts +48 -0
- package/src/scale/gradient.ts +91 -0
- package/src/scale/index.ts +5 -0
- package/src/scale/scale.ts +127 -0
- package/src/scale/tone.ts +69 -0
- package/src/tokens/css.ts +32 -0
- package/src/tokens/dtcg.ts +62 -0
- package/src/tokens/index.ts +11 -0
- package/src/tokens/tailwind.ts +24 -0
- package/src/tokens/tokens.ts +82 -0
- package/esm/createColors.d.ts +0 -6
- package/esm/createColors.d.ts.map +0 -1
- package/esm/createColors.js.map +0 -1
- package/esm/createColorsFromMap.d.ts +0 -9
- package/esm/createColorsFromMap.d.ts.map +0 -1
- package/esm/createColorsFromMap.js.map +0 -1
- package/esm/interfaces.d.ts +0 -18
- package/esm/interfaces.d.ts.map +0 -1
- package/esm/rgbHex.d.ts.map +0 -1
- package/esm/rgbHex.js.map +0 -1
- package/esm/rgbaString.d.ts +0 -6
- package/esm/rgbaString.js +0 -8
- package/esm/rgbaString.js.map +0 -1
- /package/{ts → src/legacy}/index.ts +0 -0
- /package/{ts → src/legacy}/rgbHex.ts +0 -0
package/llms.txt
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# color-map
|
|
2
|
+
|
|
3
|
+
> Parse, convert, mix and serialize every CSS color, check WCAG 2 contrast, and build scales, semantic palettes and design tokens from one brand color. One package holds a TypeScript library, the `color-map` command and an agent skill.
|
|
4
|
+
|
|
5
|
+
This file is generated by `scripts/generate-llms-txt.mjs` from the package exports and the command table. Do not edit it.
|
|
6
|
+
|
|
7
|
+
Conventions that hold for the library:
|
|
8
|
+
|
|
9
|
+
- No runtime dependencies, and `"sideEffects": false`, so a bundler keeps only what you import.
|
|
10
|
+
- `color-map` re-exports `color-map/color`, `color-map/palette`, `color-map/scale` and `color-map/tokens`. Without a bundler it loads every module, so import from a subpath to load less.
|
|
11
|
+
- `Color` is `{ colorSpace, components, alpha? }`. A color as plain JSON. Component ranges follow CSS: `srgb` is 0 to 1, `hsl` and `hwb` take hue in degrees and the rest in 0 to 100, `lab` and `lch` take L in 0 to 100, `oklab` and `oklch` take L in 0 to 1. A missing `alpha` is 1. `Component` is `number | null`. A component value. `null` stands for the CSS keyword `none`.
|
|
12
|
+
- `deltaEOk`, `equals`, `contrast`, `findContrast`, `meets`, `onColor`, `inGamut`, `toGamut`, `mix` and `toHex` each have a narrow form named `create` plus the name. It takes the spaces your colors are in and returns the helper over just those, so a bundle does not carry all 15 spaces. `createConverter` does the same for `convert`.
|
|
13
|
+
- `contrast`, `findContrast`, `meets`, `onColor` and `mix` also take a CSS color string; the other helpers above take a `Color`, so run strings through `parse` first. Every narrow form takes `Color` objects only.
|
|
14
|
+
|
|
15
|
+
Conventions that hold for every command:
|
|
16
|
+
|
|
17
|
+
- Output is TOON on stdout by default; `--format json` gives JSON. Diagnostics go to stderr.
|
|
18
|
+
- Colors are any CSS color string, including `color-mix()` and relative colors.
|
|
19
|
+
- Contrast is WCAG 2. There is no other contrast algorithm.
|
|
20
|
+
- `--full` adds every field. Empty results say so explicitly.
|
|
21
|
+
- A failure exits 1 or 2 with `error`, `code` and `help` fields on stdout. Nothing prompts; unknown options fail.
|
|
22
|
+
- Run it with `npx color-map <command>`, or install the `color-map` agent skill from this package.
|
|
23
|
+
|
|
24
|
+
## Library
|
|
25
|
+
|
|
26
|
+
- [color-map](https://cyberuni.github.io/color-map/library/): re-exports `color-map/color`, `color-map/palette`, `color-map/scale` and `color-map/tokens`. It also exports `Alpha`, `ColorMap`, `createColors`, `createColorsFromMap`, `RGB`, `RGBA`, `rgbaString`, `rgbHex`, deprecated: import them from `color-map/legacy`.
|
|
27
|
+
- [color-map/color](https://cyberuni.github.io/color-map/library/#color-mapcolor): `a98Rgb`, `contrast`, `convert`, `convertComponents`, `createContrast`, `createConverter`, `createDeltaEOk`, `createEquals`, `createFindContrast`, `createInGamut`, `createMeets`, `createMix`, `createOnColor`, `createToGamut`, `createToHex`, `deltaEOk`, `displayP3`, `displayP3Linear`, `equals`, `findContrast`, `fromArgb`, `hsl`, `hwb`, `inGamut`, `lab`, `lch`, `meets`, `mix`, `oklab`, `oklch`, `onColor`, `parse`, `parseExpr`, `prophotoRgb`, `rec2020`, `resolve`, `spaces`, `srgb`, `srgbLinear`, `toArgb`, `toCss`, `toGamut`, `toHex`, `wcag2`, `xyzD50`, `xyzD65`. Types: `Color`, `ColorExpr`, `ColorSpaceId`, `Component`, `ContrastAlgorithm`, `ContrastFn`, `ContrastOption`, `FindContrastOptions`, `FoundContrast`, `GamutId`, `HueMethod`, `MixOptions`, `OnColorOptions`, `ResolveContext`, `Space`, `ToCssOptions`, `ToGamutOptions`, `Vec3`.
|
|
28
|
+
- [color-map/legacy](https://cyberuni.github.io/color-map/library/#color-maplegacy): `createColors`, `createColorsFromMap`, `rgbaString`, `rgbHex`. Types: `Alpha`, `ColorMap`, `RGB`, `RGBA`.
|
|
29
|
+
- [color-map/palette](https://cyberuni.github.io/color-map/library/#color-mappalette): `darkVariant`, `harmonize`, `harmony`, `inverse`, `semanticPalette`, `validate`. Types: `DarkStrategy`, `DarkVariantOptions`, `HarmonizeOptions`, `HarmonyOptions`, `HarmonyScheme`, `HarmonySpace`, `PaletteIssue`, `PaletteLike`, `RolePair`, `SemanticPalette`, `SemanticPaletteOptions`, `SemanticRole`, `ValidateOptions`, `ValidateResult`.
|
|
30
|
+
- [color-map/scale](https://cyberuni.github.io/color-map/library/#color-mapscale): `createContrastScale`, `createGradient`, `createScale`, `lstar`, `MATERIAL_TONES`, `scaleFromBrand`, `tonalPalette`, `toneColor`. Types: `BrandScaleOptions`, `ContrastScaleOptions`, `ContrastStep`, `GradientOptions`, `GradientStop`, `ScaleOptions`, `ScalePreset`, `TonalPaletteOptions`.
|
|
31
|
+
- [color-map/tokens](https://cyberuni.github.io/color-map/library/#color-maptokens): `toCssVariables`, `toDtcg`, `toDtcgValue`, `toTailwindTheme`. Types: `CssVariablesOptions`, `DtcgColorValue`, `DtcgGroup`, `DtcgOptions`, `DtcgToken`, `TailwindThemeOptions`, `TokenTree`.
|
|
32
|
+
|
|
33
|
+
## Commands
|
|
34
|
+
|
|
35
|
+
- [convert](https://unpkg.com/color-map/schemas/convert.schema.json): Convert a CSS color to another color space. Usage: `color-map convert <color>` with --to, --gamut, --full.
|
|
36
|
+
- [mix](https://unpkg.com/color-map/schemas/mix.schema.json): Mix two CSS colors, as color-mix() does. Usage: `color-map mix <a> <b>` with --amount, --in, --hue, --full.
|
|
37
|
+
- [contrast](https://unpkg.com/color-map/schemas/contrast.schema.json): WCAG 2 contrast ratio of a text color on a background, with the AA and AAA verdicts. Usage: `color-map contrast <fg> <bg>` with no options.
|
|
38
|
+
- [find-contrast](https://unpkg.com/color-map/schemas/find-contrast.schema.json): Find the color closest in lightness to a background that reaches a WCAG 2 contrast target. Usage: `color-map find-contrast <bg>` with --target, --hue, --chroma, --direction, --full.
|
|
39
|
+
- [scale](https://unpkg.com/color-map/schemas/scale.schema.json): Build a color scale from a seed color: a preset, a Radix-style brand scale, or contrast targets. Usage: `color-map scale <seed>` with --preset, --steps, --brand, --mode, --background, --targets, --gamut, --full.
|
|
40
|
+
- [palette](https://unpkg.com/color-map/schemas/palette.schema.json): A semantic palette from one brand color: primary, status colors, surface and outline, each with a text color and its WCAG 2 ratio. Usage: `color-map palette <brand>` with --mode, --target, --gamut, --full.
|
|
41
|
+
- [harmony](https://unpkg.com/color-map/schemas/harmony.schema.json): The colors of a harmony scheme: the color rotated around the hue wheel. Usage: `color-map harmony <color>` with --scheme, --space, --gamut.
|
|
42
|
+
- [export](https://unpkg.com/color-map/schemas/export.schema.json): Write a palette, a scale or your own tokens as DTCG JSON, CSS variables or a Tailwind v4 theme. Usage: `color-map export [color]` with --to, --source, --mode, --tokens, --space, --prefix, --selector, --namespace, --inline, --precision, --hex.
|
|
43
|
+
- [schema](https://cyberuni.github.io/color-map/cli/#machine-readable-help): Print the JSON Schema of a command's arguments and options. Usage: `color-map schema [command]` with no options.
|
|
44
|
+
|
|
45
|
+
## Optional
|
|
46
|
+
|
|
47
|
+
- [Source and README](https://github.com/cyberuni/color-map): the color-map library and CLI.
|
|
48
|
+
- [Generator](https://github.com/cyberuni/color-map/blob/main/packages/color-map/scripts/generate-llms-txt.mjs): run it with `--gaps` to list the 0 exports that have no doc comment.
|
package/package.json
CHANGED
|
@@ -1,65 +1,278 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
2
|
+
"name": "color-map",
|
|
3
|
+
"version": "2.3.1",
|
|
4
|
+
"description": "Color map generator and color toolkit: a library, a CLI and an agent skill",
|
|
5
|
+
"homepage": "https://github.com/cyberuni/color-map",
|
|
6
|
+
"bugs": {
|
|
7
|
+
"url": "https://github.com/cyberuni/color-map/issues"
|
|
8
|
+
},
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "https://github.com/cyberuni/color-map.git"
|
|
12
|
+
},
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"author": {
|
|
15
|
+
"name": "Homa Wong (unional)",
|
|
16
|
+
"email": "homawong@gmail.com"
|
|
17
|
+
},
|
|
18
|
+
"type": "module",
|
|
19
|
+
"sideEffects": false,
|
|
20
|
+
"exports": {
|
|
21
|
+
".": {
|
|
22
|
+
"types": "./esm/index.d.ts",
|
|
23
|
+
"import": "./esm/index.js",
|
|
24
|
+
"require": "./cjs/index.js",
|
|
25
|
+
"default": "./cjs/index.js"
|
|
26
|
+
},
|
|
27
|
+
"./color": {
|
|
28
|
+
"types": "./esm/color/index.d.ts",
|
|
29
|
+
"import": "./esm/color/index.js",
|
|
30
|
+
"require": "./cjs/color/index.js",
|
|
31
|
+
"default": "./cjs/color/index.js"
|
|
32
|
+
},
|
|
33
|
+
"./legacy": {
|
|
34
|
+
"types": "./esm/legacy/index.d.ts",
|
|
35
|
+
"import": "./esm/legacy/index.js",
|
|
36
|
+
"require": "./cjs/legacy/index.js",
|
|
37
|
+
"default": "./cjs/legacy/index.js"
|
|
38
|
+
},
|
|
39
|
+
"./palette": {
|
|
40
|
+
"types": "./esm/palette/index.d.ts",
|
|
41
|
+
"import": "./esm/palette/index.js",
|
|
42
|
+
"require": "./cjs/palette/index.js",
|
|
43
|
+
"default": "./cjs/palette/index.js"
|
|
44
|
+
},
|
|
45
|
+
"./scale": {
|
|
46
|
+
"types": "./esm/scale/index.d.ts",
|
|
47
|
+
"import": "./esm/scale/index.js",
|
|
48
|
+
"require": "./cjs/scale/index.js",
|
|
49
|
+
"default": "./cjs/scale/index.js"
|
|
50
|
+
},
|
|
51
|
+
"./tokens": {
|
|
52
|
+
"types": "./esm/tokens/index.d.ts",
|
|
53
|
+
"import": "./esm/tokens/index.js",
|
|
54
|
+
"require": "./cjs/tokens/index.js",
|
|
55
|
+
"default": "./cjs/tokens/index.js"
|
|
56
|
+
},
|
|
57
|
+
"./schemas/*": "./schemas/*",
|
|
58
|
+
"./package.json": "./package.json"
|
|
59
|
+
},
|
|
60
|
+
"main": "./cjs/index.js",
|
|
61
|
+
"types": "./esm/index.d.ts",
|
|
62
|
+
"files": [
|
|
63
|
+
"bin",
|
|
64
|
+
"cjs",
|
|
65
|
+
"dist",
|
|
66
|
+
"esm",
|
|
67
|
+
"schemas",
|
|
68
|
+
"skills",
|
|
69
|
+
"src",
|
|
70
|
+
"llms.txt",
|
|
71
|
+
"plugin.json",
|
|
72
|
+
".claude-plugin",
|
|
73
|
+
".codex-plugin",
|
|
74
|
+
".cursor-plugin",
|
|
75
|
+
"!**/*.spec.*",
|
|
76
|
+
"CHANGELOG.md"
|
|
77
|
+
],
|
|
78
|
+
"devDependencies": {
|
|
79
|
+
"@colordx/core": "7.3.0",
|
|
80
|
+
"@size-limit/preset-small-lib": "^14.3.0",
|
|
81
|
+
"@types/culori": "^4.0.1",
|
|
82
|
+
"@types/node": "^26.2.0",
|
|
83
|
+
"@vitest/coverage-v8": "^5.0.0",
|
|
84
|
+
"assertron": "^11.0.0",
|
|
85
|
+
"clibuilder": "~12.1.0",
|
|
86
|
+
"colorjs.io": "0.7.1",
|
|
87
|
+
"culori": "4.0.2",
|
|
88
|
+
"depcheck": "^1.4.3",
|
|
89
|
+
"npm-run-all2": "^9.0.3",
|
|
90
|
+
"rimraf": "^6.1.3",
|
|
91
|
+
"size-limit": "^14.3.0",
|
|
92
|
+
"ts-6.0": "npm:typescript@6.0.3",
|
|
93
|
+
"tsdown": "^0.23.0",
|
|
94
|
+
"typescript": "^7.0.2",
|
|
95
|
+
"vitest": "^5.0.0"
|
|
96
|
+
},
|
|
97
|
+
"engines": {
|
|
98
|
+
"node": ">= 20.19"
|
|
99
|
+
},
|
|
100
|
+
"size-limit": [
|
|
101
|
+
{
|
|
102
|
+
"name": "existing API",
|
|
103
|
+
"path": "esm/legacy/index.js",
|
|
104
|
+
"import": "{ createColors, createColorsFromMap, rgbHex, rgbaString }",
|
|
105
|
+
"limit": "0.45 kB",
|
|
106
|
+
"gzip": true
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"name": "existing API from the root",
|
|
110
|
+
"path": "esm/index.js",
|
|
111
|
+
"import": "{ createColors, createColorsFromMap, rgbHex, rgbaString }",
|
|
112
|
+
"limit": "0.45 kB",
|
|
113
|
+
"gzip": true
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"name": "convert between two spaces",
|
|
117
|
+
"path": "esm/color/index.js",
|
|
118
|
+
"import": "{ createConverter, srgb, oklch }",
|
|
119
|
+
"limit": "1.22 kB",
|
|
120
|
+
"gzip": true
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"name": "parse and convert between two spaces",
|
|
124
|
+
"path": "esm/color/index.js",
|
|
125
|
+
"import": "{ parse, createConverter, srgb, oklch }",
|
|
126
|
+
"limit": "4.85 kB",
|
|
127
|
+
"gzip": true
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"name": "toHex over every space",
|
|
131
|
+
"path": "esm/color/index.js",
|
|
132
|
+
"import": "{ toHex }",
|
|
133
|
+
"limit": "3.01 kB",
|
|
134
|
+
"gzip": true
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"name": "toHex from oklch, narrow",
|
|
138
|
+
"path": "esm/color/index.js",
|
|
139
|
+
"import": "{ createToHex, oklch }",
|
|
140
|
+
"limit": "1.31 kB",
|
|
141
|
+
"gzip": true
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"name": "toGamut over every space",
|
|
145
|
+
"path": "esm/color/index.js",
|
|
146
|
+
"import": "{ toGamut }",
|
|
147
|
+
"limit": "3.86 kB",
|
|
148
|
+
"gzip": true
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"name": "toGamut, narrow",
|
|
152
|
+
"path": "esm/color/index.js",
|
|
153
|
+
"import": "{ createToGamut }",
|
|
154
|
+
"limit": "2.19 kB",
|
|
155
|
+
"gzip": true
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"name": "mix over every space",
|
|
159
|
+
"path": "esm/color/index.js",
|
|
160
|
+
"import": "{ mix }",
|
|
161
|
+
"limit": "7.18 kB",
|
|
162
|
+
"gzip": true
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"name": "mix, narrow",
|
|
166
|
+
"path": "esm/color/index.js",
|
|
167
|
+
"import": "{ createMix }",
|
|
168
|
+
"limit": "1.57 kB",
|
|
169
|
+
"gzip": true
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"name": "contrast helpers over every space",
|
|
173
|
+
"path": "esm/color/index.js",
|
|
174
|
+
"import": "{ contrast, meets, onColor, findContrast }",
|
|
175
|
+
"limit": "8.22 kB",
|
|
176
|
+
"gzip": true
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"name": "contrast helpers, narrow",
|
|
180
|
+
"path": "esm/color/index.js",
|
|
181
|
+
"import": "{ createContrast, createMeets, createOnColor, createFindContrast }",
|
|
182
|
+
"limit": "2.96 kB",
|
|
183
|
+
"gzip": true
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
"name": "every converting helper over every space",
|
|
187
|
+
"path": "esm/color/index.js",
|
|
188
|
+
"import": "{ toHex, toGamut, inGamut, deltaEOk, equals, mix, contrast, meets, onColor, findContrast }",
|
|
189
|
+
"limit": "9.09 kB",
|
|
190
|
+
"gzip": true
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
"name": "every converting helper, narrow",
|
|
194
|
+
"path": "esm/color/index.js",
|
|
195
|
+
"import": "{ createToHex, createToGamut, createInGamut, createDeltaEOk, createEquals, createMix, createContrast, createMeets, createOnColor, createFindContrast }",
|
|
196
|
+
"limit": "3.89 kB",
|
|
197
|
+
"gzip": true
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"name": "full color core",
|
|
201
|
+
"path": "esm/color/index.js",
|
|
202
|
+
"import": "{ parse, toCss, toHex, toGamut, inGamut, deltaEOk, equals, fromArgb, toArgb, convert, spaces }",
|
|
203
|
+
"limit": "8.21 kB",
|
|
204
|
+
"gzip": true
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
"name": "core with mix",
|
|
208
|
+
"path": "esm/color/index.js",
|
|
209
|
+
"import": "{ parse, toCss, toGamut, mix }",
|
|
210
|
+
"limit": "8.5 kB",
|
|
211
|
+
"gzip": true
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
"name": "core with mix and contrast",
|
|
215
|
+
"path": "esm/color/index.js",
|
|
216
|
+
"import": "{ parse, toCss, toGamut, mix, contrast, meets, onColor, findContrast }",
|
|
217
|
+
"limit": "9.23 kB",
|
|
218
|
+
"gzip": true
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"name": "scales",
|
|
222
|
+
"path": "esm/scale/index.js",
|
|
223
|
+
"import": "*",
|
|
224
|
+
"limit": "10.55 kB",
|
|
225
|
+
"gzip": true
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
"name": "palette",
|
|
229
|
+
"path": "esm/palette/index.js",
|
|
230
|
+
"import": "*",
|
|
231
|
+
"limit": "9.9 kB",
|
|
232
|
+
"gzip": true
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
"name": "tokens",
|
|
236
|
+
"path": "esm/tokens/index.js",
|
|
237
|
+
"import": "*",
|
|
238
|
+
"limit": "9.03 kB",
|
|
239
|
+
"gzip": true
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
"name": "everything",
|
|
243
|
+
"path": "esm/color/index.js",
|
|
244
|
+
"import": "*",
|
|
245
|
+
"limit": "12.13 kB",
|
|
246
|
+
"gzip": true
|
|
247
|
+
}
|
|
248
|
+
],
|
|
249
|
+
"keywords": [
|
|
250
|
+
"agent",
|
|
251
|
+
"axi",
|
|
252
|
+
"cli",
|
|
253
|
+
"color",
|
|
254
|
+
"design-system",
|
|
255
|
+
"palette"
|
|
256
|
+
],
|
|
257
|
+
"bin": {
|
|
258
|
+
"color-map": "./bin/color-map.js"
|
|
259
|
+
},
|
|
260
|
+
"scripts": {
|
|
261
|
+
"build": "tsdown && node scripts/write-schemas.mjs",
|
|
262
|
+
"bench": "node scripts/bench.mjs",
|
|
263
|
+
"build:watch": "tsdown --watch",
|
|
264
|
+
"clean": "rimraf .reports bin cjs coverage dist esm",
|
|
265
|
+
"coverage": "vitest run --coverage",
|
|
266
|
+
"depcheck": "depcheck",
|
|
267
|
+
"llms": "node scripts/generate-llms-txt.mjs",
|
|
268
|
+
"llms:check": "node scripts/generate-llms-txt.mjs --check",
|
|
269
|
+
"nuke": "pnpm clean && rimraf node_modules",
|
|
270
|
+
"pack:check": "node scripts/check-pack.mjs && node scripts/sync-plugin-version.mjs --check",
|
|
271
|
+
"schemas": "node scripts/write-schemas.mjs",
|
|
272
|
+
"size": "size-limit",
|
|
273
|
+
"test": "vitest run",
|
|
274
|
+
"typecheck": "tsc",
|
|
275
|
+
"verify": "npm-run-all build -p depcheck typecheck coverage size llms:check pack:check",
|
|
276
|
+
"watch": "vitest"
|
|
277
|
+
}
|
|
278
|
+
}
|
package/plugin.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
|
|
3
|
+
"name": "color-map",
|
|
4
|
+
"version": "2.3.1",
|
|
5
|
+
"description": "Generate WCAG-checked color palettes, scales and design tokens with the color-map CLI",
|
|
6
|
+
"author": {
|
|
7
|
+
"name": "Homa Wong (unional)"
|
|
8
|
+
},
|
|
9
|
+
"homepage": "https://github.com/cyberuni/color-map",
|
|
10
|
+
"repository": "https://github.com/cyberuni/color-map",
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"keywords": ["color", "palette", "design-system", "contrast", "css"],
|
|
13
|
+
"extensions": {
|
|
14
|
+
"org.cyberuni.universal-plugin": {
|
|
15
|
+
"vendors": ["claude-code", "cursor", "codex", "copilot-cli"]
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://unpkg.com/color-map/schemas/contrast.schema.json",
|
|
4
|
+
"title": "color-map contrast",
|
|
5
|
+
"description": "WCAG 2 contrast ratio of a text color on a background, with the AA and AAA verdicts",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"fg": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "The text (foreground) color",
|
|
11
|
+
"x-kind": "argument"
|
|
12
|
+
},
|
|
13
|
+
"bg": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"description": "The background color",
|
|
16
|
+
"x-kind": "argument"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"required": [
|
|
20
|
+
"fg",
|
|
21
|
+
"bg"
|
|
22
|
+
],
|
|
23
|
+
"additionalProperties": false
|
|
24
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://unpkg.com/color-map/schemas/convert.schema.json",
|
|
4
|
+
"title": "color-map convert",
|
|
5
|
+
"description": "Convert a CSS color to another color space",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"color": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "Any CSS color, such as \"#3b82f6\" or \"oklch(0.7 0.15 250)\"",
|
|
11
|
+
"x-kind": "argument"
|
|
12
|
+
},
|
|
13
|
+
"to": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"enum": [
|
|
16
|
+
"srgb",
|
|
17
|
+
"srgb-linear",
|
|
18
|
+
"hsl",
|
|
19
|
+
"hwb",
|
|
20
|
+
"lab",
|
|
21
|
+
"lch",
|
|
22
|
+
"oklab",
|
|
23
|
+
"oklch",
|
|
24
|
+
"display-p3",
|
|
25
|
+
"display-p3-linear",
|
|
26
|
+
"a98-rgb",
|
|
27
|
+
"prophoto-rgb",
|
|
28
|
+
"rec2020",
|
|
29
|
+
"xyz-d50",
|
|
30
|
+
"xyz-d65"
|
|
31
|
+
],
|
|
32
|
+
"description": "Target color space",
|
|
33
|
+
"default": "srgb",
|
|
34
|
+
"x-kind": "option"
|
|
35
|
+
},
|
|
36
|
+
"gamut": {
|
|
37
|
+
"type": "string",
|
|
38
|
+
"enum": [
|
|
39
|
+
"srgb",
|
|
40
|
+
"srgb-linear",
|
|
41
|
+
"display-p3",
|
|
42
|
+
"display-p3-linear",
|
|
43
|
+
"a98-rgb",
|
|
44
|
+
"prophoto-rgb",
|
|
45
|
+
"rec2020"
|
|
46
|
+
],
|
|
47
|
+
"description": "Map the result into this gamut (CSS gamut mapping) when it falls outside",
|
|
48
|
+
"x-kind": "option"
|
|
49
|
+
},
|
|
50
|
+
"full": {
|
|
51
|
+
"type": "boolean",
|
|
52
|
+
"description": "Show the complete output instead of truncating it",
|
|
53
|
+
"x-kind": "option"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"required": [
|
|
57
|
+
"color"
|
|
58
|
+
],
|
|
59
|
+
"additionalProperties": false
|
|
60
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://unpkg.com/color-map/schemas/export.schema.json",
|
|
4
|
+
"title": "color-map export",
|
|
5
|
+
"description": "Write a palette, a scale or your own tokens as DTCG JSON, CSS variables or a Tailwind v4 theme",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"color": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "The brand color to build tokens from; leave out with --tokens",
|
|
11
|
+
"x-kind": "argument"
|
|
12
|
+
},
|
|
13
|
+
"to": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"enum": [
|
|
16
|
+
"dtcg",
|
|
17
|
+
"css",
|
|
18
|
+
"tailwind"
|
|
19
|
+
],
|
|
20
|
+
"description": "Output format",
|
|
21
|
+
"default": "css",
|
|
22
|
+
"x-kind": "option"
|
|
23
|
+
},
|
|
24
|
+
"source": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"enum": [
|
|
27
|
+
"palette",
|
|
28
|
+
"scale"
|
|
29
|
+
],
|
|
30
|
+
"description": "What to build from the color",
|
|
31
|
+
"default": "palette",
|
|
32
|
+
"x-kind": "option"
|
|
33
|
+
},
|
|
34
|
+
"mode": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"enum": [
|
|
37
|
+
"light",
|
|
38
|
+
"dark"
|
|
39
|
+
],
|
|
40
|
+
"description": "light or dark, for --source palette",
|
|
41
|
+
"default": "light",
|
|
42
|
+
"x-kind": "option"
|
|
43
|
+
},
|
|
44
|
+
"tokens": {
|
|
45
|
+
"type": "string",
|
|
46
|
+
"description": "A JSON file of CSS color strings, nested as you like, instead of a color",
|
|
47
|
+
"x-kind": "option"
|
|
48
|
+
},
|
|
49
|
+
"space": {
|
|
50
|
+
"type": "string",
|
|
51
|
+
"enum": [
|
|
52
|
+
"srgb",
|
|
53
|
+
"srgb-linear",
|
|
54
|
+
"hsl",
|
|
55
|
+
"hwb",
|
|
56
|
+
"lab",
|
|
57
|
+
"lch",
|
|
58
|
+
"oklab",
|
|
59
|
+
"oklch",
|
|
60
|
+
"display-p3",
|
|
61
|
+
"display-p3-linear",
|
|
62
|
+
"a98-rgb",
|
|
63
|
+
"prophoto-rgb",
|
|
64
|
+
"rec2020",
|
|
65
|
+
"xyz-d50",
|
|
66
|
+
"xyz-d65"
|
|
67
|
+
],
|
|
68
|
+
"description": "Convert every color to this space (css, tailwind)",
|
|
69
|
+
"x-kind": "option"
|
|
70
|
+
},
|
|
71
|
+
"prefix": {
|
|
72
|
+
"type": "string",
|
|
73
|
+
"description": "Variable name prefix (css; tailwind uses --namespace)",
|
|
74
|
+
"x-kind": "option"
|
|
75
|
+
},
|
|
76
|
+
"selector": {
|
|
77
|
+
"type": "string",
|
|
78
|
+
"description": "The CSS rule selector (css)",
|
|
79
|
+
"x-kind": "option"
|
|
80
|
+
},
|
|
81
|
+
"namespace": {
|
|
82
|
+
"type": "string",
|
|
83
|
+
"description": "The Tailwind theme namespace (tailwind)",
|
|
84
|
+
"x-kind": "option"
|
|
85
|
+
},
|
|
86
|
+
"inline": {
|
|
87
|
+
"type": "boolean",
|
|
88
|
+
"description": "Write @theme inline (tailwind)",
|
|
89
|
+
"x-kind": "option"
|
|
90
|
+
},
|
|
91
|
+
"precision": {
|
|
92
|
+
"type": "integer",
|
|
93
|
+
"minimum": 0,
|
|
94
|
+
"maximum": 10,
|
|
95
|
+
"description": "Decimal places in printed numbers",
|
|
96
|
+
"x-kind": "option"
|
|
97
|
+
},
|
|
98
|
+
"hex": {
|
|
99
|
+
"type": "boolean",
|
|
100
|
+
"description": "Add the hex fallback to DTCG values; --hex=false drops it",
|
|
101
|
+
"x-kind": "option"
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
"required": [],
|
|
105
|
+
"additionalProperties": false
|
|
106
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://unpkg.com/color-map/schemas/find-contrast.schema.json",
|
|
4
|
+
"title": "color-map find-contrast",
|
|
5
|
+
"description": "Find the color closest in lightness to a background that reaches a WCAG 2 contrast target",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"bg": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "The background color",
|
|
11
|
+
"x-kind": "argument"
|
|
12
|
+
},
|
|
13
|
+
"target": {
|
|
14
|
+
"type": "number",
|
|
15
|
+
"minimum": 1,
|
|
16
|
+
"maximum": 21,
|
|
17
|
+
"description": "The contrast ratio to reach, 1 to 21",
|
|
18
|
+
"default": 4.5,
|
|
19
|
+
"x-kind": "option"
|
|
20
|
+
},
|
|
21
|
+
"hue": {
|
|
22
|
+
"type": "number",
|
|
23
|
+
"description": "OKLCH hue of the result in degrees (default: the background's hue)",
|
|
24
|
+
"x-kind": "option"
|
|
25
|
+
},
|
|
26
|
+
"chroma": {
|
|
27
|
+
"type": "number",
|
|
28
|
+
"minimum": 0,
|
|
29
|
+
"description": "OKLCH chroma of the result (default 0, a gray)",
|
|
30
|
+
"x-kind": "option"
|
|
31
|
+
},
|
|
32
|
+
"direction": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"enum": [
|
|
35
|
+
"lighter",
|
|
36
|
+
"darker"
|
|
37
|
+
],
|
|
38
|
+
"description": "Which way to look first",
|
|
39
|
+
"x-kind": "option"
|
|
40
|
+
},
|
|
41
|
+
"full": {
|
|
42
|
+
"type": "boolean",
|
|
43
|
+
"description": "Show the complete output instead of truncating it",
|
|
44
|
+
"x-kind": "option"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"required": [
|
|
48
|
+
"bg"
|
|
49
|
+
],
|
|
50
|
+
"additionalProperties": false
|
|
51
|
+
}
|