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.
Files changed (366) hide show
  1. package/.claude-plugin/plugin.json +12 -0
  2. package/.codex-plugin/plugin.json +12 -0
  3. package/.cursor-plugin/plugin.json +12 -0
  4. package/CHANGELOG.md +100 -0
  5. package/README.md +71 -8
  6. package/bin/cli-CELmx3Y9.js +6414 -0
  7. package/bin/color-map.js +9 -0
  8. package/bin/index.js +1 -0
  9. package/cjs/color/index.d.ts +5 -0
  10. package/cjs/color/index.js +52 -0
  11. package/cjs/color-wNrkrhC7.js +374 -0
  12. package/cjs/color-wNrkrhC7.js.map +1 -0
  13. package/cjs/contrast-XjF5Rwui.js +293 -0
  14. package/cjs/contrast-XjF5Rwui.js.map +1 -0
  15. package/cjs/gamut-CG1J2aat.d.ts +158 -0
  16. package/cjs/gamut-CG1J2aat.d.ts.map +1 -0
  17. package/cjs/index-BcEqCPHz.d.ts +137 -0
  18. package/cjs/index-BcEqCPHz.d.ts.map +1 -0
  19. package/cjs/index-CGKCqRqD.d.ts +111 -0
  20. package/cjs/index-CGKCqRqD.d.ts.map +1 -0
  21. package/cjs/index-Cv3iUUYE.d.ts +171 -0
  22. package/cjs/index-Cv3iUUYE.d.ts.map +1 -0
  23. package/cjs/index-Dw43Hj4v.d.ts +41 -0
  24. package/cjs/index-Dw43Hj4v.d.ts.map +1 -0
  25. package/cjs/index-Dy8UARqO.d.ts +72 -0
  26. package/cjs/index-Dy8UARqO.d.ts.map +1 -0
  27. package/cjs/index.d.ts +26 -36
  28. package/cjs/index.d.ts.map +1 -1
  29. package/cjs/index.js +83 -62
  30. package/cjs/index.js.map +1 -1
  31. package/cjs/legacy/index.d.ts +2 -0
  32. package/cjs/legacy/index.js +75 -0
  33. package/cjs/legacy/index.js.map +1 -0
  34. package/cjs/mix-Cs4owSbW.js +158 -0
  35. package/cjs/mix-Cs4owSbW.js.map +1 -0
  36. package/cjs/mix-DGlKoUw4.d.ts +31 -0
  37. package/cjs/mix-DGlKoUw4.d.ts.map +1 -0
  38. package/cjs/palette/index.d.ts +3 -0
  39. package/cjs/palette/index.js +8 -0
  40. package/cjs/palette-DyFV_KoJ.js +332 -0
  41. package/cjs/palette-DyFV_KoJ.js.map +1 -0
  42. package/cjs/parse-8mt2OMKf.js +1508 -0
  43. package/cjs/parse-8mt2OMKf.js.map +1 -0
  44. package/cjs/scale/index.d.ts +2 -0
  45. package/cjs/scale/index.js +11 -0
  46. package/cjs/scale-Cq9pXrc1.js +318 -0
  47. package/cjs/scale-Cq9pXrc1.js.map +1 -0
  48. package/cjs/semantic-CrEIo8tS.d.ts +52 -0
  49. package/cjs/semantic-CrEIo8tS.d.ts.map +1 -0
  50. package/cjs/serialize-C69DAmoE.d.ts +25 -0
  51. package/cjs/serialize-C69DAmoE.d.ts.map +1 -0
  52. package/cjs/serialize-Ci2X0cPN.js +103 -0
  53. package/cjs/serialize-Ci2X0cPN.js.map +1 -0
  54. package/cjs/tokens/index.d.ts +2 -0
  55. package/cjs/tokens/index.js +6 -0
  56. package/cjs/tokens-CzXxaMgM.js +168 -0
  57. package/cjs/tokens-CzXxaMgM.js.map +1 -0
  58. package/cjs/tone-BAhu-QzQ.js +118 -0
  59. package/cjs/tone-BAhu-QzQ.js.map +1 -0
  60. package/dist/color-map.es5.js.map +1 -1
  61. package/esm/color/a98-rgb.d.ts +7 -0
  62. package/esm/color/a98-rgb.d.ts.map +1 -0
  63. package/esm/color/a98-rgb.js +13 -0
  64. package/esm/color/a98-rgb.js.map +1 -0
  65. package/esm/color/argb.d.ts +6 -0
  66. package/esm/color/argb.d.ts.map +1 -0
  67. package/esm/color/argb.js +25 -0
  68. package/esm/color/argb.js.map +1 -0
  69. package/esm/color/calc.js +82 -0
  70. package/esm/color/calc.js.map +1 -0
  71. package/esm/color/compare.d.ts +20 -0
  72. package/esm/color/compare.d.ts.map +1 -0
  73. package/esm/color/compare.js +46 -0
  74. package/esm/color/compare.js.map +1 -0
  75. package/esm/color/contrast.d.ts +107 -0
  76. package/esm/color/contrast.d.ts.map +1 -0
  77. package/esm/color/contrast.js +242 -0
  78. package/esm/color/contrast.js.map +1 -0
  79. package/esm/color/convert.d.ts +9 -0
  80. package/esm/color/convert.d.ts.map +1 -0
  81. package/esm/color/convert.js +45 -0
  82. package/esm/color/convert.js.map +1 -0
  83. package/esm/color/display-p3-linear.d.ts +7 -0
  84. package/esm/color/display-p3-linear.d.ts.map +1 -0
  85. package/esm/color/display-p3-linear.js +12 -0
  86. package/esm/color/display-p3-linear.js.map +1 -0
  87. package/esm/color/display-p3.d.ts +7 -0
  88. package/esm/color/display-p3.d.ts.map +1 -0
  89. package/esm/color/display-p3.js +12 -0
  90. package/esm/color/display-p3.js.map +1 -0
  91. package/esm/color/expr.d.ts +43 -0
  92. package/esm/color/expr.d.ts.map +1 -0
  93. package/esm/color/expr.js +160 -0
  94. package/esm/color/expr.js.map +1 -0
  95. package/esm/color/gamut.d.ts +31 -0
  96. package/esm/color/gamut.d.ts.map +1 -0
  97. package/esm/color/gamut.js +210 -0
  98. package/esm/color/gamut.js.map +1 -0
  99. package/esm/color/hsl.d.ts +7 -0
  100. package/esm/color/hsl.d.ts.map +1 -0
  101. package/esm/color/hsl.js +67 -0
  102. package/esm/color/hsl.js.map +1 -0
  103. package/esm/color/hwb.d.ts +7 -0
  104. package/esm/color/hwb.d.ts.map +1 -0
  105. package/esm/color/hwb.js +40 -0
  106. package/esm/color/hwb.js.map +1 -0
  107. package/esm/color/index.d.ts +28 -0
  108. package/esm/color/index.js +27 -0
  109. package/esm/color/lab.d.ts +7 -0
  110. package/esm/color/lab.d.ts.map +1 -0
  111. package/esm/color/lab.js +33 -0
  112. package/esm/color/lab.js.map +1 -0
  113. package/esm/color/lch.d.ts +7 -0
  114. package/esm/color/lch.d.ts.map +1 -0
  115. package/esm/color/lch.js +11 -0
  116. package/esm/color/lch.js.map +1 -0
  117. package/esm/color/math.js +32 -0
  118. package/esm/color/math.js.map +1 -0
  119. package/esm/color/matrices.js +180 -0
  120. package/esm/color/matrices.js.map +1 -0
  121. package/esm/color/mix.d.ts +30 -0
  122. package/esm/color/mix.d.ts.map +1 -0
  123. package/esm/color/mix.js +152 -0
  124. package/esm/color/mix.js.map +1 -0
  125. package/esm/color/named.js +11 -0
  126. package/esm/color/named.js.map +1 -0
  127. package/esm/color/oklab.d.ts +7 -0
  128. package/esm/color/oklab.d.ts.map +1 -0
  129. package/esm/color/oklab.js +21 -0
  130. package/esm/color/oklab.js.map +1 -0
  131. package/esm/color/oklch.d.ts +7 -0
  132. package/esm/color/oklch.d.ts.map +1 -0
  133. package/esm/color/oklch.js +11 -0
  134. package/esm/color/oklch.js.map +1 -0
  135. package/esm/color/parse.d.ts +9 -0
  136. package/esm/color/parse.d.ts.map +1 -0
  137. package/esm/color/parse.js +452 -0
  138. package/esm/color/parse.js.map +1 -0
  139. package/esm/color/polar.js +27 -0
  140. package/esm/color/polar.js.map +1 -0
  141. package/esm/color/prophoto-rgb.d.ts +7 -0
  142. package/esm/color/prophoto-rgb.d.ts.map +1 -0
  143. package/esm/color/prophoto-rgb.js +18 -0
  144. package/esm/color/prophoto-rgb.js.map +1 -0
  145. package/esm/color/rec2020.d.ts +7 -0
  146. package/esm/color/rec2020.d.ts.map +1 -0
  147. package/esm/color/rec2020.js +13 -0
  148. package/esm/color/rec2020.js.map +1 -0
  149. package/esm/color/resolve.d.ts +18 -0
  150. package/esm/color/resolve.d.ts.map +1 -0
  151. package/esm/color/resolve.js +98 -0
  152. package/esm/color/resolve.js.map +1 -0
  153. package/esm/color/rgb.js +20 -0
  154. package/esm/color/rgb.js.map +1 -0
  155. package/esm/color/serialize.d.ts +24 -0
  156. package/esm/color/serialize.d.ts.map +1 -0
  157. package/esm/color/serialize.js +88 -0
  158. package/esm/color/serialize.js.map +1 -0
  159. package/esm/color/spaces.d.ts +6 -0
  160. package/esm/color/spaces.d.ts.map +1 -0
  161. package/esm/color/spaces.js +42 -0
  162. package/esm/color/spaces.js.map +1 -0
  163. package/esm/color/srgb-linear.d.ts +7 -0
  164. package/esm/color/srgb-linear.d.ts.map +1 -0
  165. package/esm/color/srgb-linear.js +12 -0
  166. package/esm/color/srgb-linear.js.map +1 -0
  167. package/esm/color/srgb.d.ts +7 -0
  168. package/esm/color/srgb.d.ts.map +1 -0
  169. package/esm/color/srgb.js +12 -0
  170. package/esm/color/srgb.js.map +1 -0
  171. package/esm/color/transfer.js +11 -0
  172. package/esm/color/transfer.js.map +1 -0
  173. package/esm/color/types.d.ts +23 -0
  174. package/esm/color/types.d.ts.map +1 -0
  175. package/esm/color/unknown-name.js +16 -0
  176. package/esm/color/unknown-name.js.map +1 -0
  177. package/esm/color/xyz-d50.d.ts +7 -0
  178. package/esm/color/xyz-d50.d.ts.map +1 -0
  179. package/esm/color/xyz-d50.js +15 -0
  180. package/esm/color/xyz-d50.js.map +1 -0
  181. package/esm/color/xyz-d65.d.ts +4 -0
  182. package/esm/color/xyz-d65.d.ts.map +1 -0
  183. package/esm/color/xyz-d65.js +10 -0
  184. package/esm/color/xyz-d65.js.map +1 -0
  185. package/esm/index.d.ts +63 -6
  186. package/esm/index.d.ts.map +1 -0
  187. package/esm/index.js +54 -5
  188. package/esm/index.js.map +1 -0
  189. package/esm/legacy/createColors.d.ts +9 -0
  190. package/esm/legacy/createColors.d.ts.map +1 -0
  191. package/esm/{createColors.js → legacy/createColors.js} +7 -2
  192. package/esm/legacy/createColors.js.map +1 -0
  193. package/esm/legacy/createColorsFromMap.d.ts +9 -0
  194. package/esm/legacy/createColorsFromMap.d.ts.map +1 -0
  195. package/esm/{createColorsFromMap.js → legacy/createColorsFromMap.js} +4 -2
  196. package/esm/legacy/createColorsFromMap.js.map +1 -0
  197. package/esm/legacy/index.d.ts +6 -0
  198. package/esm/legacy/index.js +5 -0
  199. package/esm/legacy/interfaces.d.ts +19 -0
  200. package/esm/legacy/interfaces.d.ts.map +1 -0
  201. package/esm/{rgbHex.d.ts → legacy/rgbHex.d.ts} +1 -4
  202. package/esm/legacy/rgbHex.d.ts.map +1 -0
  203. package/esm/{rgbHex.js → legacy/rgbHex.js} +1 -2
  204. package/esm/legacy/rgbHex.js.map +1 -0
  205. package/esm/legacy/rgbaString.d.ts +4 -0
  206. package/esm/{rgbaString.d.ts.map → legacy/rgbaString.d.ts.map} +1 -1
  207. package/esm/legacy/rgbaString.js +8 -0
  208. package/esm/legacy/rgbaString.js.map +1 -0
  209. package/esm/palette/dark.d.ts +23 -0
  210. package/esm/palette/dark.d.ts.map +1 -0
  211. package/esm/palette/dark.js +54 -0
  212. package/esm/palette/dark.js.map +1 -0
  213. package/esm/palette/harmony.d.ts +56 -0
  214. package/esm/palette/harmony.d.ts.map +1 -0
  215. package/esm/palette/harmony.js +115 -0
  216. package/esm/palette/harmony.js.map +1 -0
  217. package/esm/palette/index.d.ts +5 -0
  218. package/esm/palette/index.js +5 -0
  219. package/esm/palette/semantic.d.ts +53 -0
  220. package/esm/palette/semantic.d.ts.map +1 -0
  221. package/esm/palette/semantic.js +96 -0
  222. package/esm/palette/semantic.js.map +1 -0
  223. package/esm/palette/validate.d.ts +39 -0
  224. package/esm/palette/validate.d.ts.map +1 -0
  225. package/esm/palette/validate.js +56 -0
  226. package/esm/palette/validate.js.map +1 -0
  227. package/esm/scale/brand.d.ts +21 -0
  228. package/esm/scale/brand.d.ts.map +1 -0
  229. package/esm/scale/brand.js +63 -0
  230. package/esm/scale/brand.js.map +1 -0
  231. package/esm/scale/contrast-scale.d.ts +33 -0
  232. package/esm/scale/contrast-scale.d.ts.map +1 -0
  233. package/esm/scale/contrast-scale.js +26 -0
  234. package/esm/scale/contrast-scale.js.map +1 -0
  235. package/esm/scale/gradient.d.ts +38 -0
  236. package/esm/scale/gradient.d.ts.map +1 -0
  237. package/esm/scale/gradient.js +73 -0
  238. package/esm/scale/gradient.js.map +1 -0
  239. package/esm/scale/index.d.ts +6 -0
  240. package/esm/scale/index.js +6 -0
  241. package/esm/scale/scale.d.ts +31 -0
  242. package/esm/scale/scale.d.ts.map +1 -0
  243. package/esm/scale/scale.js +152 -0
  244. package/esm/scale/scale.js.map +1 -0
  245. package/esm/scale/tone.d.ts +25 -0
  246. package/esm/scale/tone.d.ts.map +1 -0
  247. package/esm/scale/tone.js +96 -0
  248. package/esm/scale/tone.js.map +1 -0
  249. package/esm/tokens/css.d.ts +18 -0
  250. package/esm/tokens/css.d.ts.map +1 -0
  251. package/esm/tokens/css.js +23 -0
  252. package/esm/tokens/css.js.map +1 -0
  253. package/esm/tokens/dtcg.d.ts +33 -0
  254. package/esm/tokens/dtcg.d.ts.map +1 -0
  255. package/esm/tokens/dtcg.js +42 -0
  256. package/esm/tokens/dtcg.js.map +1 -0
  257. package/esm/tokens/index.d.ts +5 -0
  258. package/esm/tokens/index.js +4 -0
  259. package/esm/tokens/tailwind.d.ts +19 -0
  260. package/esm/tokens/tailwind.d.ts.map +1 -0
  261. package/esm/tokens/tailwind.js +19 -0
  262. package/esm/tokens/tailwind.js.map +1 -0
  263. package/esm/tokens/tokens.d.ts +11 -0
  264. package/esm/tokens/tokens.d.ts.map +1 -0
  265. package/esm/tokens/tokens.js +77 -0
  266. package/esm/tokens/tokens.js.map +1 -0
  267. package/llms.txt +48 -0
  268. package/package.json +277 -64
  269. package/plugin.json +18 -0
  270. package/schemas/contrast.schema.json +24 -0
  271. package/schemas/convert.schema.json +60 -0
  272. package/schemas/export.schema.json +106 -0
  273. package/schemas/find-contrast.schema.json +51 -0
  274. package/schemas/harmony.schema.json +58 -0
  275. package/schemas/mix.schema.json +72 -0
  276. package/schemas/palette.schema.json +56 -0
  277. package/schemas/scale.schema.json +86 -0
  278. package/skills/color-map/SKILL.md +38 -0
  279. package/src/cli/bin.ts +11 -0
  280. package/src/cli/cli.ts +40 -0
  281. package/src/cli/commands/contrast.ts +36 -0
  282. package/src/cli/commands/convert.ts +37 -0
  283. package/src/cli/commands/export.ts +102 -0
  284. package/src/cli/commands/find-contrast.ts +37 -0
  285. package/src/cli/commands/harmony.ts +30 -0
  286. package/src/cli/commands/mix.ts +29 -0
  287. package/src/cli/commands/palette.ts +66 -0
  288. package/src/cli/commands/scale.ts +75 -0
  289. package/src/cli/index.ts +3 -0
  290. package/src/cli/schema-command.ts +31 -0
  291. package/src/cli/schemas.ts +86 -0
  292. package/src/cli/shared.ts +72 -0
  293. package/src/cli/testing.ts +27 -0
  294. package/src/color/a98-rgb.ts +11 -0
  295. package/src/color/argb.ts +21 -0
  296. package/src/color/calc.ts +84 -0
  297. package/src/color/compare.ts +53 -0
  298. package/src/color/contrast.ts +277 -0
  299. package/src/color/convert.ts +43 -0
  300. package/src/color/display-p3-linear.ts +9 -0
  301. package/src/color/display-p3.ts +9 -0
  302. package/src/color/expr.ts +158 -0
  303. package/src/color/gamut.ts +215 -0
  304. package/src/color/hsl.ts +57 -0
  305. package/src/color/hwb.ts +26 -0
  306. package/src/color/index.ts +43 -0
  307. package/src/color/lab.ts +29 -0
  308. package/src/color/lch.ts +8 -0
  309. package/src/color/math.ts +30 -0
  310. package/src/color/matrices.ts +91 -0
  311. package/src/color/mix.ts +158 -0
  312. package/src/color/named.ts +13 -0
  313. package/src/color/oklab.ts +19 -0
  314. package/src/color/oklch.ts +8 -0
  315. package/src/color/parse.ts +355 -0
  316. package/src/color/polar.ts +17 -0
  317. package/src/color/prophoto-rgb.ts +18 -0
  318. package/src/color/rec2020.ts +11 -0
  319. package/src/color/resolve.ts +87 -0
  320. package/src/color/rgb.ts +20 -0
  321. package/src/color/serialize.ts +96 -0
  322. package/src/color/spaces.ts +42 -0
  323. package/src/color/srgb-linear.ts +9 -0
  324. package/src/color/srgb.ts +9 -0
  325. package/src/color/test-utils.ts +10 -0
  326. package/src/color/transfer.ts +14 -0
  327. package/src/color/types.ts +41 -0
  328. package/src/color/unknown-name.ts +15 -0
  329. package/src/color/xyz-d50.ts +13 -0
  330. package/src/color/xyz-d65.ts +8 -0
  331. package/src/index.ts +37 -0
  332. package/{ts → src/legacy}/createColors.ts +6 -0
  333. package/{ts → src/legacy}/createColorsFromMap.ts +3 -0
  334. package/{ts → src/legacy}/interfaces.ts +4 -0
  335. package/{ts → src/legacy}/rgbaString.ts +1 -0
  336. package/src/palette/dark.ts +55 -0
  337. package/src/palette/harmony.ts +107 -0
  338. package/src/palette/index.ts +18 -0
  339. package/src/palette/semantic.ts +120 -0
  340. package/src/palette/validate.ts +82 -0
  341. package/src/scale/brand.ts +50 -0
  342. package/src/scale/contrast-scale.ts +48 -0
  343. package/src/scale/gradient.ts +91 -0
  344. package/src/scale/index.ts +5 -0
  345. package/src/scale/scale.ts +127 -0
  346. package/src/scale/tone.ts +69 -0
  347. package/src/tokens/css.ts +32 -0
  348. package/src/tokens/dtcg.ts +62 -0
  349. package/src/tokens/index.ts +11 -0
  350. package/src/tokens/tailwind.ts +24 -0
  351. package/src/tokens/tokens.ts +82 -0
  352. package/esm/createColors.d.ts +0 -6
  353. package/esm/createColors.d.ts.map +0 -1
  354. package/esm/createColors.js.map +0 -1
  355. package/esm/createColorsFromMap.d.ts +0 -9
  356. package/esm/createColorsFromMap.d.ts.map +0 -1
  357. package/esm/createColorsFromMap.js.map +0 -1
  358. package/esm/interfaces.d.ts +0 -18
  359. package/esm/interfaces.d.ts.map +0 -1
  360. package/esm/rgbHex.d.ts.map +0 -1
  361. package/esm/rgbHex.js.map +0 -1
  362. package/esm/rgbaString.d.ts +0 -6
  363. package/esm/rgbaString.js +0 -8
  364. package/esm/rgbaString.js.map +0 -1
  365. /package/{ts → src/legacy}/index.ts +0 -0
  366. /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
- "name": "color-map",
3
- "version": "2.2.0",
4
- "description": "Color map generator",
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
- "exports": {
20
- "types": "./esm/index.d.ts",
21
- "import": "./esm/index.js",
22
- "require": "./cjs/index.js",
23
- "default": "./cjs/index.js"
24
- },
25
- "main": "./cjs/index.js",
26
- "types": "./esm/index.d.ts",
27
- "files": [
28
- "cjs",
29
- "dist",
30
- "esm",
31
- "ts",
32
- "!**/*.spec.*"
33
- ],
34
- "scripts": {
35
- "build": "tsdown",
36
- "build:watch": "tsdown --watch",
37
- "clean": "rimraf .reports cjs coverage dist esm",
38
- "coverage": "jest --coverage",
39
- "depcheck": "depcheck",
40
- "nuke": "pnpm clean && rimraf node_modules",
41
- "test": "jest",
42
- "typecheck": "tsc",
43
- "verify": "npm-run-all -p build depcheck typecheck coverage",
44
- "watch": "jest --watch"
45
- },
46
- "devDependencies": {
47
- "@repobuddy/jest": "^5.0.0",
48
- "@types/jest": "^30.0.0",
49
- "@types/node": "^26.2.0",
50
- "assertron": "^11.0.0",
51
- "depcheck": "^1.4.3",
52
- "jest": "^30.4.2",
53
- "jest-watch-suspend": "^1.1.2",
54
- "jest-watch-toggle-config-2": "^2.1.0",
55
- "jest-watch-typeahead": "^2.0.0",
56
- "npm-run-all2": "^9.0.3",
57
- "rimraf": "^6.1.3",
58
- "ts-jest": "^29.0.0",
59
- "tsdown": "^0.22.14",
60
- "typescript": "^7.0.2"
61
- },
62
- "engines": {
63
- "node": ">= 20"
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
+ }