@tokens-studio/tokenscript-schemas 0.0.11 → 0.0.13

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 (307) hide show
  1. package/dist/cli/index.cjs +31 -8
  2. package/dist/cli/index.cjs.map +1 -1
  3. package/dist/cli/index.js +30 -8
  4. package/dist/cli/index.js.map +1 -1
  5. package/package.json +2 -1
  6. package/src/bundler/bundle-schema.ts +146 -0
  7. package/src/bundler/index.ts +151 -0
  8. package/src/bundler/schema-dependency-resolver.ts +299 -0
  9. package/src/bundler/selective-bundler.test.ts +94 -0
  10. package/src/bundler/selective-bundler.ts +159 -0
  11. package/src/bundler/types.ts +93 -0
  12. package/src/bundler/utils.ts +74 -0
  13. package/src/cli/commands/bundle.integration.test.ts +153 -0
  14. package/src/cli/commands/bundle.test.ts +57 -0
  15. package/src/cli/commands/bundle.ts +237 -0
  16. package/src/cli/commands/list.ts +109 -0
  17. package/src/cli/config-schema.ts +36 -0
  18. package/src/cli/index.ts +50 -0
  19. package/src/cli/output-generator.ts +63 -0
  20. package/src/downloader/index.ts +248 -0
  21. package/src/downloader/types.ts +48 -0
  22. package/src/index.ts +8 -0
  23. package/src/schemas/functions/adjust_chroma/adjust-chroma.tokenscript +27 -0
  24. package/src/schemas/functions/adjust_chroma/schema.json +48 -0
  25. package/src/schemas/functions/adjust_chroma/unit.test.ts +76 -0
  26. package/src/schemas/functions/adjust_hue/adjust-hue.tokenscript +32 -0
  27. package/src/schemas/functions/adjust_hue/schema.json +48 -0
  28. package/src/schemas/functions/adjust_hue/unit.test.ts +68 -0
  29. package/src/schemas/functions/adjust_lightness/adjust-lightness.tokenscript +31 -0
  30. package/src/schemas/functions/adjust_lightness/schema.json +48 -0
  31. package/src/schemas/functions/adjust_lightness/unit.test.ts +88 -0
  32. package/src/schemas/functions/adjust_to_contrast/adjust-to-contrast.tokenscript +131 -0
  33. package/src/schemas/functions/adjust_to_contrast/schema.json +56 -0
  34. package/src/schemas/functions/adjust_to_contrast/unit.test.ts +81 -0
  35. package/src/schemas/functions/alpha_blend/alpha-blend.tokenscript +46 -0
  36. package/src/schemas/functions/alpha_blend/schema.json +28 -0
  37. package/src/schemas/functions/alpha_blend/unit.test.ts +135 -0
  38. package/src/schemas/functions/alpha_scale/alpha-scale.tokenscript +38 -0
  39. package/src/schemas/functions/alpha_scale/schema.json +24 -0
  40. package/src/schemas/functions/alpha_scale/unit.test.ts +50 -0
  41. package/src/schemas/functions/analogous/analogous.tokenscript +47 -0
  42. package/src/schemas/functions/analogous/schema.json +28 -0
  43. package/src/schemas/functions/analogous/unit.test.ts +64 -0
  44. package/src/schemas/functions/apca_contrast/apca-contrast.tokenscript +129 -0
  45. package/src/schemas/functions/apca_contrast/schema.json +24 -0
  46. package/src/schemas/functions/apca_contrast/unit.test.ts +259 -0
  47. package/src/schemas/functions/are_similar/are-similar.tokenscript +24 -0
  48. package/src/schemas/functions/are_similar/schema.json +57 -0
  49. package/src/schemas/functions/are_similar/unit.test.ts +57 -0
  50. package/src/schemas/functions/auto_text_color/auto-text-color.tokenscript +41 -0
  51. package/src/schemas/functions/auto_text_color/schema.json +53 -0
  52. package/src/schemas/functions/auto_text_color/unit.test.ts +122 -0
  53. package/src/schemas/functions/best_contrast/best-contrast.tokenscript +66 -0
  54. package/src/schemas/functions/best_contrast/schema.json +24 -0
  55. package/src/schemas/functions/best_contrast/unit.test.ts +64 -0
  56. package/src/schemas/functions/chroma/chroma.tokenscript +12 -0
  57. package/src/schemas/functions/chroma/schema.json +44 -0
  58. package/src/schemas/functions/chroma/unit.test.ts +86 -0
  59. package/src/schemas/functions/clamp_chroma/clamp-chroma.tokenscript +21 -0
  60. package/src/schemas/functions/clamp_chroma/schema.json +52 -0
  61. package/src/schemas/functions/clamp_chroma/unit.test.ts +60 -0
  62. package/src/schemas/functions/clamp_lightness/clamp-lightness.tokenscript +21 -0
  63. package/src/schemas/functions/clamp_lightness/schema.json +52 -0
  64. package/src/schemas/functions/clamp_lightness/unit.test.ts +76 -0
  65. package/src/schemas/functions/clamp_to_gamut/clamp-to-gamut.tokenscript +41 -0
  66. package/src/schemas/functions/clamp_to_gamut/schema.json +20 -0
  67. package/src/schemas/functions/clamp_to_gamut/unit.test.ts +167 -0
  68. package/src/schemas/functions/complement/complement.tokenscript +21 -0
  69. package/src/schemas/functions/complement/schema.json +20 -0
  70. package/src/schemas/functions/complement/unit.test.ts +81 -0
  71. package/src/schemas/functions/contrast_ratio/contrast-ratio.tokenscript +36 -0
  72. package/src/schemas/functions/contrast_ratio/schema.json +24 -0
  73. package/src/schemas/functions/contrast_ratio/unit.test.ts +91 -0
  74. package/src/schemas/functions/cooler/cooler.tokenscript +45 -0
  75. package/src/schemas/functions/cooler/schema.json +43 -0
  76. package/src/schemas/functions/cooler/unit.test.ts +69 -0
  77. package/src/schemas/functions/darken/darken.tokenscript +37 -0
  78. package/src/schemas/functions/darken/schema.json +24 -0
  79. package/src/schemas/functions/darken/unit.test.ts +105 -0
  80. package/src/schemas/functions/delta_e_2000/delta-e-2000.tokenscript +184 -0
  81. package/src/schemas/functions/delta_e_2000/schema.json +36 -0
  82. package/src/schemas/functions/delta_e_2000/unit.test.ts +243 -0
  83. package/src/schemas/functions/delta_e_76/delta-e-76.tokenscript +45 -0
  84. package/src/schemas/functions/delta_e_76/schema.json +24 -0
  85. package/src/schemas/functions/delta_e_76/unit.test.ts +123 -0
  86. package/src/schemas/functions/delta_e_ok/delta-e-ok.tokenscript +43 -0
  87. package/src/schemas/functions/delta_e_ok/schema.json +24 -0
  88. package/src/schemas/functions/delta_e_ok/unit.test.ts +235 -0
  89. package/src/schemas/functions/desaturate/desaturate.tokenscript +32 -0
  90. package/src/schemas/functions/desaturate/schema.json +24 -0
  91. package/src/schemas/functions/desaturate/unit.test.ts +54 -0
  92. package/src/schemas/functions/distributed/distributed.tokenscript +54 -0
  93. package/src/schemas/functions/distributed/schema.json +32 -0
  94. package/src/schemas/functions/distributed/unit.test.ts +58 -0
  95. package/src/schemas/functions/diverging/diverging.tokenscript +58 -0
  96. package/src/schemas/functions/diverging/schema.json +32 -0
  97. package/src/schemas/functions/diverging/unit.test.ts +70 -0
  98. package/src/schemas/functions/grayscale/grayscale.tokenscript +17 -0
  99. package/src/schemas/functions/grayscale/schema.json +20 -0
  100. package/src/schemas/functions/grayscale/unit.test.ts +79 -0
  101. package/src/schemas/functions/harmonize/harmonize.tokenscript +61 -0
  102. package/src/schemas/functions/harmonize/schema.json +52 -0
  103. package/src/schemas/functions/harmonize/unit.test.ts +56 -0
  104. package/src/schemas/functions/hue/hue.tokenscript +12 -0
  105. package/src/schemas/functions/hue/schema.json +44 -0
  106. package/src/schemas/functions/hue/unit.test.ts +75 -0
  107. package/src/schemas/functions/hue_difference/hue-difference.tokenscript +42 -0
  108. package/src/schemas/functions/hue_difference/schema.json +24 -0
  109. package/src/schemas/functions/hue_difference/unit.test.ts +125 -0
  110. package/src/schemas/functions/in_gamut/in-gamut.tokenscript +51 -0
  111. package/src/schemas/functions/in_gamut/schema.json +24 -0
  112. package/src/schemas/functions/in_gamut/unit.test.ts +178 -0
  113. package/src/schemas/functions/interpolate/interpolate.tokenscript +61 -0
  114. package/src/schemas/functions/interpolate/schema.json +52 -0
  115. package/src/schemas/functions/interpolate/unit.test.ts +96 -0
  116. package/src/schemas/functions/invert/invert-initializer.tokenscript +29 -0
  117. package/src/schemas/functions/invert/schema.json +20 -0
  118. package/src/schemas/functions/invert/unit.test.ts +216 -0
  119. package/src/schemas/functions/is_cool/is-cool.tokenscript +41 -0
  120. package/src/schemas/functions/is_cool/schema.json +20 -0
  121. package/src/schemas/functions/is_cool/unit.test.ts +189 -0
  122. package/src/schemas/functions/is_dark/is-dark.tokenscript +16 -0
  123. package/src/schemas/functions/is_dark/schema.json +24 -0
  124. package/src/schemas/functions/is_dark/unit.test.ts +87 -0
  125. package/src/schemas/functions/is_light/is-light.tokenscript +16 -0
  126. package/src/schemas/functions/is_light/schema.json +24 -0
  127. package/src/schemas/functions/is_light/unit.test.ts +86 -0
  128. package/src/schemas/functions/is_neutral/is-neutral.tokenscript +16 -0
  129. package/src/schemas/functions/is_neutral/schema.json +53 -0
  130. package/src/schemas/functions/is_neutral/unit.test.ts +85 -0
  131. package/src/schemas/functions/is_warm/is-warm.tokenscript +62 -0
  132. package/src/schemas/functions/is_warm/schema.json +20 -0
  133. package/src/schemas/functions/is_warm/unit.test.ts +161 -0
  134. package/src/schemas/functions/lighten/lighten.tokenscript +37 -0
  135. package/src/schemas/functions/lighten/schema.json +24 -0
  136. package/src/schemas/functions/lighten/unit.test.ts +109 -0
  137. package/src/schemas/functions/lightness/lightness.tokenscript +12 -0
  138. package/src/schemas/functions/lightness/schema.json +49 -0
  139. package/src/schemas/functions/lightness/unit.test.ts +99 -0
  140. package/src/schemas/functions/luminance/luminance.tokenscript +16 -0
  141. package/src/schemas/functions/luminance/schema.json +20 -0
  142. package/src/schemas/functions/luminance/unit.test.ts +105 -0
  143. package/src/schemas/functions/meets_contrast/meets-contrast.tokenscript +49 -0
  144. package/src/schemas/functions/meets_contrast/schema.json +28 -0
  145. package/src/schemas/functions/meets_contrast/unit.test.ts +170 -0
  146. package/src/schemas/functions/mix/mix.tokenscript +47 -0
  147. package/src/schemas/functions/mix/schema.json +28 -0
  148. package/src/schemas/functions/mix/unit.test.ts +95 -0
  149. package/src/schemas/functions/monochromatic/monochromatic.tokenscript +72 -0
  150. package/src/schemas/functions/monochromatic/schema.json +24 -0
  151. package/src/schemas/functions/monochromatic/unit.test.ts +91 -0
  152. package/src/schemas/functions/muted/muted.tokenscript +25 -0
  153. package/src/schemas/functions/muted/schema.json +48 -0
  154. package/src/schemas/functions/muted/unit.test.ts +100 -0
  155. package/src/schemas/functions/neutral_variant/neutral-variant.tokenscript +23 -0
  156. package/src/schemas/functions/neutral_variant/schema.json +48 -0
  157. package/src/schemas/functions/neutral_variant/unit.test.ts +102 -0
  158. package/src/schemas/functions/relative_luminance/relative-luminance.tokenscript +15 -0
  159. package/src/schemas/functions/relative_luminance/schema.json +49 -0
  160. package/src/schemas/functions/relative_luminance/unit.test.ts +104 -0
  161. package/src/schemas/functions/rotate_hue/rotate-hue.tokenscript +20 -0
  162. package/src/schemas/functions/rotate_hue/schema.json +24 -0
  163. package/src/schemas/functions/rotate_hue/unit.test.ts +86 -0
  164. package/src/schemas/functions/saturate/saturate.tokenscript +33 -0
  165. package/src/schemas/functions/saturate/schema.json +24 -0
  166. package/src/schemas/functions/saturate/unit.test.ts +59 -0
  167. package/src/schemas/functions/scale_chroma/scale-chroma.tokenscript +22 -0
  168. package/src/schemas/functions/scale_chroma/schema.json +48 -0
  169. package/src/schemas/functions/scale_chroma/unit.test.ts +79 -0
  170. package/src/schemas/functions/scale_lightness/scale-lightness.tokenscript +23 -0
  171. package/src/schemas/functions/scale_lightness/schema.json +48 -0
  172. package/src/schemas/functions/scale_lightness/unit.test.ts +73 -0
  173. package/src/schemas/functions/sepia/schema.json +48 -0
  174. package/src/schemas/functions/sepia/sepia.tokenscript +54 -0
  175. package/src/schemas/functions/sepia/unit.test.ts +88 -0
  176. package/src/schemas/functions/set_chroma/schema.json +24 -0
  177. package/src/schemas/functions/set_chroma/set-chroma.tokenscript +18 -0
  178. package/src/schemas/functions/set_chroma/unit.test.ts +79 -0
  179. package/src/schemas/functions/set_hue/schema.json +24 -0
  180. package/src/schemas/functions/set_hue/set-hue.tokenscript +18 -0
  181. package/src/schemas/functions/set_hue/unit.test.ts +90 -0
  182. package/src/schemas/functions/set_lightness/schema.json +24 -0
  183. package/src/schemas/functions/set_lightness/set-lightness.tokenscript +18 -0
  184. package/src/schemas/functions/set_lightness/unit.test.ts +80 -0
  185. package/src/schemas/functions/shade_scale/schema.json +24 -0
  186. package/src/schemas/functions/shade_scale/shade-scale.tokenscript +61 -0
  187. package/src/schemas/functions/shade_scale/unit.test.ts +64 -0
  188. package/src/schemas/functions/split_complement/schema.json +24 -0
  189. package/src/schemas/functions/split_complement/split-complement.tokenscript +38 -0
  190. package/src/schemas/functions/split_complement/unit.test.ts +53 -0
  191. package/src/schemas/functions/steps/schema.json +28 -0
  192. package/src/schemas/functions/steps/steps.tokenscript +54 -0
  193. package/src/schemas/functions/steps/unit.test.ts +71 -0
  194. package/src/schemas/functions/tetradic/schema.json +20 -0
  195. package/src/schemas/functions/tetradic/tetradic.tokenscript +40 -0
  196. package/src/schemas/functions/tetradic/unit.test.ts +50 -0
  197. package/src/schemas/functions/tint_scale/schema.json +32 -0
  198. package/src/schemas/functions/tint_scale/tint-scale.tokenscript +71 -0
  199. package/src/schemas/functions/tint_scale/unit.test.ts +64 -0
  200. package/src/schemas/functions/to_gamut/schema.json +48 -0
  201. package/src/schemas/functions/to_gamut/to-gamut.tokenscript +96 -0
  202. package/src/schemas/functions/to_gamut/unit.test.ts +97 -0
  203. package/src/schemas/functions/triadic/schema.json +20 -0
  204. package/src/schemas/functions/triadic/triadic.tokenscript +33 -0
  205. package/src/schemas/functions/triadic/unit.test.ts +64 -0
  206. package/src/schemas/functions/vibrant/schema.json +48 -0
  207. package/src/schemas/functions/vibrant/unit.test.ts +55 -0
  208. package/src/schemas/functions/vibrant/vibrant.tokenscript +29 -0
  209. package/src/schemas/functions/warmer/schema.json +43 -0
  210. package/src/schemas/functions/warmer/unit.test.ts +69 -0
  211. package/src/schemas/functions/warmer/warmer.tokenscript +45 -0
  212. package/src/schemas/functions/wcag_level/schema.json +48 -0
  213. package/src/schemas/functions/wcag_level/unit.test.ts +75 -0
  214. package/src/schemas/functions/wcag_level/wcag-level.tokenscript +50 -0
  215. package/src/schemas/types/css-color/from-hsl-color.tokenscript +16 -0
  216. package/src/schemas/types/css-color/from-hwb-color.tokenscript +16 -0
  217. package/src/schemas/types/css-color/from-lab-color.tokenscript +16 -0
  218. package/src/schemas/types/css-color/from-lch-color.tokenscript +16 -0
  219. package/src/schemas/types/css-color/from-oklab-color.tokenscript +16 -0
  220. package/src/schemas/types/css-color/from-oklch-color.tokenscript +16 -0
  221. package/src/schemas/types/css-color/from-p3-color.tokenscript +16 -0
  222. package/src/schemas/types/css-color/from-rgb-color.tokenscript +15 -0
  223. package/src/schemas/types/css-color/from-srgb-color.tokenscript +16 -0
  224. package/src/schemas/types/css-color/from-srgb-linear-color.tokenscript +16 -0
  225. package/src/schemas/types/css-color/from-xyz-d50-color.tokenscript +16 -0
  226. package/src/schemas/types/css-color/from-xyz-d65-color.tokenscript +16 -0
  227. package/src/schemas/types/css-color/initializer.tokenscript +13 -0
  228. package/src/schemas/types/css-color/schema.json +148 -0
  229. package/src/schemas/types/css-color/unit.test.ts +402 -0
  230. package/src/schemas/types/hex-color/initializer.tokenscript +3 -0
  231. package/src/schemas/types/hex-color/schema.json +24 -0
  232. package/src/schemas/types/hex-color/unit.test.ts +123 -0
  233. package/src/schemas/types/hsl-color/from-srgb.tokenscript +87 -0
  234. package/src/schemas/types/hsl-color/initializer.tokenscript +16 -0
  235. package/src/schemas/types/hsl-color/schema.json +48 -0
  236. package/src/schemas/types/hsl-color/unit.test.ts +201 -0
  237. package/src/schemas/types/hsv-color/from-srgb.tokenscript +80 -0
  238. package/src/schemas/types/hsv-color/initializer.tokenscript +16 -0
  239. package/src/schemas/types/hsv-color/schema.json +48 -0
  240. package/src/schemas/types/hsv-color/unit.test.ts +162 -0
  241. package/src/schemas/types/hwb-color/from-hsv.tokenscript +31 -0
  242. package/src/schemas/types/hwb-color/initializer.tokenscript +16 -0
  243. package/src/schemas/types/hwb-color/schema.json +48 -0
  244. package/src/schemas/types/hwb-color/unit.test.ts +150 -0
  245. package/src/schemas/types/lab-color/from-xyz-d50.tokenscript +78 -0
  246. package/src/schemas/types/lab-color/initializer.tokenscript +16 -0
  247. package/src/schemas/types/lab-color/schema.json +48 -0
  248. package/src/schemas/types/lab-color/unit.test.ts +263 -0
  249. package/src/schemas/types/lch-color/from-lab.tokenscript +44 -0
  250. package/src/schemas/types/lch-color/initializer.tokenscript +16 -0
  251. package/src/schemas/types/lch-color/schema.json +48 -0
  252. package/src/schemas/types/lch-color/unit.test.ts +173 -0
  253. package/src/schemas/types/okhsl-color/from-oklab.tokenscript +410 -0
  254. package/src/schemas/types/okhsl-color/initializer.tokenscript +24 -0
  255. package/src/schemas/types/okhsl-color/schema.json +48 -0
  256. package/src/schemas/types/okhsl-color/unit.test.ts +514 -0
  257. package/src/schemas/types/okhsv-color/from-oklab.tokenscript +286 -0
  258. package/src/schemas/types/okhsv-color/initializer.tokenscript +24 -0
  259. package/src/schemas/types/okhsv-color/schema.json +48 -0
  260. package/src/schemas/types/okhsv-color/unit.test.ts +499 -0
  261. package/src/schemas/types/oklab-color/from-okhsl.tokenscript +195 -0
  262. package/src/schemas/types/oklab-color/from-okhsv.tokenscript +197 -0
  263. package/src/schemas/types/oklab-color/from-oklch.tokenscript +39 -0
  264. package/src/schemas/types/oklab-color/from-xyz-d65.tokenscript +43 -0
  265. package/src/schemas/types/oklab-color/initializer.tokenscript +16 -0
  266. package/src/schemas/types/oklab-color/schema.json +78 -0
  267. package/src/schemas/types/oklab-color/unit.test.ts +345 -0
  268. package/src/schemas/types/oklch-color/from-oklab.tokenscript +45 -0
  269. package/src/schemas/types/oklch-color/initializer.tokenscript +16 -0
  270. package/src/schemas/types/oklch-color/schema.json +48 -0
  271. package/src/schemas/types/oklch-color/unit.test.ts +267 -0
  272. package/src/schemas/types/p3-color/from-p3-linear.tokenscript +59 -0
  273. package/src/schemas/types/p3-color/initializer.tokenscript +16 -0
  274. package/src/schemas/types/p3-color/schema.json +48 -0
  275. package/src/schemas/types/p3-color/unit.test.ts +119 -0
  276. package/src/schemas/types/p3-linear-color/from-xyz-d65.tokenscript +47 -0
  277. package/src/schemas/types/p3-linear-color/initializer.tokenscript +16 -0
  278. package/src/schemas/types/p3-linear-color/schema.json +48 -0
  279. package/src/schemas/types/p3-linear-color/unit.test.ts +82 -0
  280. package/src/schemas/types/rgb-color/from-hex.tokenscript +43 -0
  281. package/src/schemas/types/rgb-color/initializer.tokenscript +16 -0
  282. package/src/schemas/types/rgb-color/schema.json +55 -0
  283. package/src/schemas/types/rgb-color/to-hex.tokenscript +42 -0
  284. package/src/schemas/types/rgb-color/unit.test.ts +302 -0
  285. package/src/schemas/types/srgb-color/from-hsl.tokenscript +106 -0
  286. package/src/schemas/types/srgb-color/from-linear.tokenscript +58 -0
  287. package/src/schemas/types/srgb-color/from-rgb.tokenscript +20 -0
  288. package/src/schemas/types/srgb-color/initializer.tokenscript +16 -0
  289. package/src/schemas/types/srgb-color/schema.json +68 -0
  290. package/src/schemas/types/srgb-color/unit.test.ts +303 -0
  291. package/src/schemas/types/srgb-linear-color/from-srgb.tokenscript +55 -0
  292. package/src/schemas/types/srgb-linear-color/from-xyz-d65.tokenscript +34 -0
  293. package/src/schemas/types/srgb-linear-color/initializer.tokenscript +13 -0
  294. package/src/schemas/types/srgb-linear-color/schema.json +58 -0
  295. package/src/schemas/types/srgb-linear-color/unit.test.ts +291 -0
  296. package/src/schemas/types/xyz-d50-color/from-xyz-d65.tokenscript +36 -0
  297. package/src/schemas/types/xyz-d50-color/initializer.tokenscript +16 -0
  298. package/src/schemas/types/xyz-d50-color/schema.json +48 -0
  299. package/src/schemas/types/xyz-d50-color/unit.test.ts +240 -0
  300. package/src/schemas/types/xyz-d65-color/from-linear-p3.tokenscript +47 -0
  301. package/src/schemas/types/xyz-d65-color/from-linear-srgb.tokenscript +38 -0
  302. package/src/schemas/types/xyz-d65-color/from-oklab.tokenscript +44 -0
  303. package/src/schemas/types/xyz-d65-color/initializer.tokenscript +16 -0
  304. package/src/schemas/types/xyz-d65-color/schema.json +68 -0
  305. package/src/schemas/types/xyz-d65-color/unit.test.ts +319 -0
  306. package/src/utils/schema-uri.ts +192 -0
  307. package/src/utils/type.ts +194 -0
@@ -0,0 +1,402 @@
1
+ /**
2
+ * CSS Color Schema Tests
3
+ *
4
+ * Tests for CSS color string output from various color spaces
5
+ * Validates correct CSS Color Level 4 syntax generation
6
+ */
7
+
8
+ import { log } from "@tests/helpers/logger";
9
+ import {
10
+ createInterpreter,
11
+ getBundledSchema,
12
+ setupColorManagerWithSchemas,
13
+ } from "@tests/helpers/schema-test-utils";
14
+ import { describe, expect, it } from "vitest";
15
+ import type { ColorSpecification } from "@/bundler/types";
16
+
17
+ /**
18
+ * Helper to execute code with css-color and required source schemas loaded
19
+ */
20
+ async function executeWithCssColor(sourceSchemas: string[], code: string): Promise<any> {
21
+ // Always include css-color plus the source schemas needed
22
+ const allSchemas = [...new Set([...sourceSchemas, "css-color"])];
23
+ const config = await setupColorManagerWithSchemas(allSchemas);
24
+ const interpreter = createInterpreter(code, {}, config);
25
+ return interpreter.interpret();
26
+ }
27
+
28
+ describe("CSS Color Schema", () => {
29
+ describe("Schema Definition", () => {
30
+ it("should have correct schema structure", async () => {
31
+ const schema = (await getBundledSchema("css-color")) as ColorSpecification;
32
+
33
+ expect(schema.name).toBe("CSS");
34
+ expect(schema.type).toBe("color");
35
+ expect(schema.schema).toBeDefined();
36
+ expect(schema.schema?.properties).toHaveProperty("value");
37
+ expect(schema.schema?.required).toEqual(["value"]);
38
+ });
39
+
40
+ it("should have an initializer for type registration", async () => {
41
+ const schema = (await getBundledSchema("css-color")) as ColorSpecification;
42
+
43
+ expect(schema.initializers).toHaveLength(1);
44
+ expect(schema.initializers[0].keyword).toBe("css");
45
+ });
46
+
47
+ it("should have 12 conversion sources", async () => {
48
+ const schema = (await getBundledSchema("css-color")) as ColorSpecification;
49
+
50
+ expect(schema.conversions).toHaveLength(12);
51
+
52
+ // Verify all expected sources exist (with full registry URL)
53
+ const sources = schema.conversions.map((c: { source: string }) => c.source);
54
+ // Sources are transformed to include the registry base URL during bundling
55
+ const containsSource = (slug: string) => sources.some((s: string) => s.includes(slug));
56
+
57
+ expect(containsSource("rgb-color")).toBe(true);
58
+ expect(containsSource("srgb-color")).toBe(true);
59
+ expect(containsSource("hsl-color")).toBe(true);
60
+ expect(containsSource("hwb-color")).toBe(true);
61
+ expect(containsSource("lab-color")).toBe(true);
62
+ expect(containsSource("lch-color")).toBe(true);
63
+ expect(containsSource("oklab-color")).toBe(true);
64
+ expect(containsSource("oklch-color")).toBe(true);
65
+ expect(containsSource("srgb-linear-color")).toBe(true);
66
+ expect(containsSource("xyz-d65-color")).toBe(true);
67
+ expect(containsSource("xyz-d50-color")).toBe(true);
68
+ expect(containsSource("p3-color")).toBe(true);
69
+ });
70
+ });
71
+
72
+ describe("RGB to CSS", () => {
73
+ it("should convert RGB to rgb() syntax", async () => {
74
+ const result = await executeWithCssColor(
75
+ ["rgb-color", "hex-color"],
76
+ `
77
+ variable c: Color.Rgb = rgb(255, 128, 64);
78
+ c.to.css()
79
+ `,
80
+ );
81
+
82
+ // Result is a ColorSymbol with value.value containing the CSS string
83
+ const css = (result as any)?.value?.value?.value || (result as any)?.toString?.();
84
+ log.info(`\n=== RGB → CSS ===`);
85
+ log.info(`Output: ${css}`);
86
+
87
+ expect(css).toBe("rgb(255 128 64)");
88
+ });
89
+
90
+ it("should handle RGB black", async () => {
91
+ const result = await executeWithCssColor(
92
+ ["rgb-color", "hex-color"],
93
+ `
94
+ variable c: Color.Rgb = rgb(0, 0, 0);
95
+ c.to.css()
96
+ `,
97
+ );
98
+
99
+ const css = (result as any)?.value?.value?.value || (result as any)?.toString?.();
100
+ expect(css).toBe("rgb(0 0 0)");
101
+ });
102
+
103
+ it("should handle RGB white", async () => {
104
+ const result = await executeWithCssColor(
105
+ ["rgb-color", "hex-color"],
106
+ `
107
+ variable c: Color.Rgb = rgb(255, 255, 255);
108
+ c.to.css()
109
+ `,
110
+ );
111
+
112
+ const css = (result as any)?.value?.value?.value || (result as any)?.toString?.();
113
+ expect(css).toBe("rgb(255 255 255)");
114
+ });
115
+ });
116
+
117
+ describe("sRGB to CSS", () => {
118
+ it("should convert sRGB to color(srgb) syntax", async () => {
119
+ const result = await executeWithCssColor(
120
+ ["srgb-color"],
121
+ `
122
+ variable c: Color.SRGB;
123
+ c.r = 1;
124
+ c.g = 0.5;
125
+ c.b = 0.25;
126
+ c.to.css()
127
+ `,
128
+ );
129
+
130
+ const css = (result as any)?.value?.value?.value || (result as any)?.toString?.();
131
+ log.info(`\n=== sRGB → CSS ===`);
132
+ log.info(`Output: ${css}`);
133
+
134
+ expect(css).toMatch(/^color\(srgb 1 0\.5 0\.25\)$/);
135
+ });
136
+ });
137
+
138
+ describe("HSL to CSS", () => {
139
+ it("should convert HSL to hsl() syntax with percentages", async () => {
140
+ const result = await executeWithCssColor(
141
+ ["hsl-color"],
142
+ `
143
+ variable c: Color.HSL;
144
+ c.h = 120;
145
+ c.s = 0.5;
146
+ c.l = 0.75;
147
+ c.to.css()
148
+ `,
149
+ );
150
+
151
+ const css = (result as any)?.value?.value?.value || (result as any)?.toString?.();
152
+ log.info(`\n=== HSL → CSS ===`);
153
+ log.info(`Output: ${css}`);
154
+
155
+ // Should produce hsl(120 50% 75%)
156
+ expect(css).toMatch(/^hsl\(120 50% 75%\)$/);
157
+ });
158
+
159
+ it("should handle HSL red", async () => {
160
+ const result = await executeWithCssColor(
161
+ ["hsl-color"],
162
+ `
163
+ variable c: Color.HSL;
164
+ c.h = 0;
165
+ c.s = 1;
166
+ c.l = 0.5;
167
+ c.to.css()
168
+ `,
169
+ );
170
+
171
+ const css = (result as any)?.value?.value?.value || (result as any)?.toString?.();
172
+ expect(css).toMatch(/^hsl\(0 100% 50%\)$/);
173
+ });
174
+ });
175
+
176
+ describe("HWB to CSS", () => {
177
+ it("should convert HWB to hwb() syntax with percentages", async () => {
178
+ const result = await executeWithCssColor(
179
+ ["hwb-color", "hsv-color", "srgb-color"],
180
+ `
181
+ variable c: Color.HWB;
182
+ c.h = 120;
183
+ c.w = 0.1;
184
+ c.b = 0.2;
185
+ c.to.css()
186
+ `,
187
+ );
188
+
189
+ const css = (result as any)?.value?.value?.value || (result as any)?.toString?.();
190
+ log.info(`\n=== HWB → CSS ===`);
191
+ log.info(`Output: ${css}`);
192
+
193
+ // Should produce hwb(120 10% 20%)
194
+ expect(css).toMatch(/^hwb\(120 10% 20%\)$/);
195
+ });
196
+ });
197
+
198
+ describe("Lab to CSS", () => {
199
+ it("should convert Lab to lab() syntax with L as percentage", async () => {
200
+ const result = await executeWithCssColor(
201
+ ["lab-color", "xyz-d50-color", "xyz-d65-color", "srgb-linear-color", "srgb-color"],
202
+ `
203
+ variable c: Color.Lab;
204
+ c.l = 75;
205
+ c.a = 20;
206
+ c.b = -30;
207
+ c.to.css()
208
+ `,
209
+ );
210
+
211
+ const css = (result as any)?.value?.value?.value || (result as any)?.toString?.();
212
+ log.info(`\n=== Lab → CSS ===`);
213
+ log.info(`Output: ${css}`);
214
+
215
+ // Should produce lab(75% 20 -30)
216
+ expect(css).toMatch(/^lab\(75% 20 -30\)$/);
217
+ });
218
+ });
219
+
220
+ describe("LCH to CSS", () => {
221
+ it("should convert LCH to lch() syntax with L as percentage", async () => {
222
+ const result = await executeWithCssColor(
223
+ [
224
+ "lch-color",
225
+ "lab-color",
226
+ "xyz-d50-color",
227
+ "xyz-d65-color",
228
+ "srgb-linear-color",
229
+ "srgb-color",
230
+ ],
231
+ `
232
+ variable c: Color.LCH;
233
+ c.l = 75;
234
+ c.c = 50;
235
+ c.h = 180;
236
+ c.to.css()
237
+ `,
238
+ );
239
+
240
+ const css = (result as any)?.value?.value?.value || (result as any)?.toString?.();
241
+ log.info(`\n=== LCH → CSS ===`);
242
+ log.info(`Output: ${css}`);
243
+
244
+ // Should produce lch(75% 50 180)
245
+ expect(css).toMatch(/^lch\(75% 50 180\)$/);
246
+ });
247
+ });
248
+
249
+ describe("OKLab to CSS", () => {
250
+ it("should convert OKLab to oklab() syntax", async () => {
251
+ const result = await executeWithCssColor(
252
+ ["oklab-color", "xyz-d65-color", "srgb-linear-color", "srgb-color"],
253
+ `
254
+ variable c: Color.OKLab;
255
+ c.l = 0.7;
256
+ c.a = 0.1;
257
+ c.b = -0.05;
258
+ c.to.css()
259
+ `,
260
+ );
261
+
262
+ const css = (result as any)?.value?.value?.value || (result as any)?.toString?.();
263
+ log.info(`\n=== OKLab → CSS ===`);
264
+ log.info(`Output: ${css}`);
265
+
266
+ // Should produce oklab(0.7 0.1 -0.05)
267
+ expect(css).toMatch(/^oklab\(0\.7 0\.1 -0\.05\)$/);
268
+ });
269
+ });
270
+
271
+ describe("OKLCH to CSS", () => {
272
+ it("should convert OKLCH to oklch() syntax", async () => {
273
+ const result = await executeWithCssColor(
274
+ ["oklch-color", "oklab-color", "xyz-d65-color", "srgb-linear-color", "srgb-color"],
275
+ `
276
+ variable c: Color.OKLCH;
277
+ c.l = 0.7;
278
+ c.c = 0.15;
279
+ c.h = 180;
280
+ c.to.css()
281
+ `,
282
+ );
283
+
284
+ const css = (result as any)?.value?.value?.value || (result as any)?.toString?.();
285
+ log.info(`\n=== OKLCH → CSS ===`);
286
+ log.info(`Output: ${css}`);
287
+
288
+ // Should produce oklch(0.7 0.15 180)
289
+ expect(css).toMatch(/^oklch\(0\.7 0\.15 180\)$/);
290
+ });
291
+ });
292
+
293
+ describe("Linear sRGB to CSS", () => {
294
+ it("should convert Linear sRGB to color(srgb-linear) syntax", async () => {
295
+ const result = await executeWithCssColor(
296
+ ["srgb-linear-color", "srgb-color"],
297
+ `
298
+ variable c: Color.LinearSRGB;
299
+ c.r = 1;
300
+ c.g = 0.25;
301
+ c.b = 0.0625;
302
+ c.to.css()
303
+ `,
304
+ );
305
+
306
+ const css = (result as any)?.value?.value?.value || (result as any)?.toString?.();
307
+ log.info(`\n=== Linear sRGB → CSS ===`);
308
+ log.info(`Output: ${css}`);
309
+
310
+ expect(css).toMatch(/^color\(srgb-linear 1 0\.25 0\.0625\)$/);
311
+ });
312
+ });
313
+
314
+ describe("XYZ-D65 to CSS", () => {
315
+ it("should convert XYZ-D65 to color(xyz-d65) syntax", async () => {
316
+ const result = await executeWithCssColor(
317
+ ["xyz-d65-color", "srgb-linear-color", "srgb-color"],
318
+ `
319
+ variable c: Color.XYZD65;
320
+ c.x = 0.4124;
321
+ c.y = 0.2126;
322
+ c.z = 0.0193;
323
+ c.to.css()
324
+ `,
325
+ );
326
+
327
+ const css = (result as any)?.value?.value?.value || (result as any)?.toString?.();
328
+ log.info(`\n=== XYZ-D65 → CSS ===`);
329
+ log.info(`Output: ${css}`);
330
+
331
+ expect(css).toMatch(/^color\(xyz-d65 0\.4124 0\.2126 0\.0193\)$/);
332
+ });
333
+ });
334
+
335
+ describe("XYZ-D50 to CSS", () => {
336
+ it("should convert XYZ-D50 to color(xyz-d50) syntax", async () => {
337
+ const result = await executeWithCssColor(
338
+ ["xyz-d50-color", "xyz-d65-color", "srgb-linear-color", "srgb-color"],
339
+ `
340
+ variable c: Color.XYZD50;
341
+ c.x = 0.436;
342
+ c.y = 0.2225;
343
+ c.z = 0.0139;
344
+ c.to.css()
345
+ `,
346
+ );
347
+
348
+ const css = (result as any)?.value?.value?.value || (result as any)?.toString?.();
349
+ log.info(`\n=== XYZ-D50 → CSS ===`);
350
+ log.info(`Output: ${css}`);
351
+
352
+ expect(css).toMatch(/^color\(xyz-d50 0\.436 0\.2225 0\.0139\)$/);
353
+ });
354
+ });
355
+
356
+ describe("Display-P3 to CSS", () => {
357
+ it("should convert Display-P3 to color(display-p3) syntax", async () => {
358
+ const result = await executeWithCssColor(
359
+ ["p3-color", "p3-linear-color", "xyz-d65-color", "srgb-linear-color", "srgb-color"],
360
+ `
361
+ variable c: Color.P3;
362
+ c.r = 1;
363
+ c.g = 0.5;
364
+ c.b = 0.25;
365
+ c.to.css()
366
+ `,
367
+ );
368
+
369
+ const css = (result as any)?.value?.value?.value || (result as any)?.toString?.();
370
+ log.info(`\n=== Display-P3 → CSS ===`);
371
+ log.info(`Output: ${css}`);
372
+
373
+ expect(css).toMatch(/^color\(display-p3 1 0\.5 0\.25\)$/);
374
+ });
375
+ });
376
+
377
+ describe("Path Resolution", () => {
378
+ // Skip: HSV → CSS requires multi-hop path resolution (HSV → sRGB → CSS)
379
+ // which may not be fully supported by the ColorManager path finder
380
+ it.skip("should convert HSV to CSS via path resolution (HSV → sRGB → CSS)", async () => {
381
+ // HSV has no direct CSS support, so path resolution should find HSV → sRGB → CSS
382
+ const result = await executeWithCssColor(
383
+ ["hsv-color", "srgb-color", "hsl-color"],
384
+ `
385
+ variable c: Color.HSV;
386
+ c.h = 0;
387
+ c.s = 1;
388
+ c.v = 1;
389
+ c.to.css()
390
+ `,
391
+ );
392
+
393
+ const css = (result as any)?.value?.value?.value || (result as any)?.toString?.();
394
+ log.info(`\n=== HSV → CSS (via path resolution) ===`);
395
+ log.info(`Output: ${css}`);
396
+
397
+ // Should produce valid CSS (exact format depends on path resolution)
398
+ expect(css).toBeTruthy();
399
+ expect(typeof css).toBe("string");
400
+ });
401
+ });
402
+ });
@@ -0,0 +1,3 @@
1
+ variable c: Color.Hex;
2
+ c.value = {input};
3
+ return c;
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "Hex",
3
+ "type": "color",
4
+ "description": "A color in hex format, e.g. #ff0000",
5
+ "schema": {
6
+ "type": "object",
7
+ "properties": {
8
+ "value": {
9
+ "type": "string"
10
+ }
11
+ }
12
+ },
13
+ "initializers": [
14
+ {
15
+ "title": "Hex Color Initializer",
16
+ "keyword": "hex",
17
+ "script": {
18
+ "type": "/api/v1/core/tokenscript/0/",
19
+ "script": "./initializer.tokenscript"
20
+ }
21
+ }
22
+ ],
23
+ "conversions": []
24
+ }
@@ -0,0 +1,123 @@
1
+ import { executeWithSchema, getBundledSchema } from "@tests/helpers/schema-test-utils";
2
+ import { describe, expect, it } from "vitest";
3
+ import type { ColorSpecification } from "@/bundler/types";
4
+
5
+ describe("Hex Color Schema", () => {
6
+ describe("Schema Definition", () => {
7
+ it("should have valid schema structure", async () => {
8
+ const schema = (await getBundledSchema("hex-color")) as ColorSpecification;
9
+
10
+ expect(schema.name).toBe("Hex");
11
+ expect(schema.type).toBe("color");
12
+ expect(schema.schema).toBeDefined();
13
+ expect(schema.schema?.type).toBe("object");
14
+ expect(schema.schema?.properties.value).toBeDefined();
15
+ expect(schema.schema?.properties.value.type).toBe("string");
16
+ });
17
+
18
+ it("should have hex initializer", async () => {
19
+ const schema = (await getBundledSchema("hex-color")) as ColorSpecification;
20
+
21
+ expect(schema.initializers).toHaveLength(1);
22
+ expect(schema.initializers[0].keyword).toBe("hex");
23
+ expect(schema.initializers[0].script.script).toContain("Color.Hex");
24
+ });
25
+ });
26
+
27
+ describe("Initialization", () => {
28
+ it("should create hex color from string", async () => {
29
+ const result = await executeWithSchema(
30
+ "hex-color",
31
+ "type",
32
+ `
33
+ variable c: Color.Hex = #ff0000;
34
+ return c;
35
+ `,
36
+ );
37
+
38
+ expect(result?.constructor.name).toBe("ColorSymbol");
39
+ expect((result as any).subType).toBe("Hex");
40
+ expect((result as any).value).toBe("#ff0000");
41
+ });
42
+
43
+ it("should create hex color with 6 digits", async () => {
44
+ const result = await executeWithSchema(
45
+ "hex-color",
46
+ "type",
47
+ `
48
+ variable c: Color.Hex = #abcdef;
49
+ return c;
50
+ `,
51
+ );
52
+
53
+ expect((result as any).value).toBe("#abcdef");
54
+ });
55
+
56
+ it("should create hex color with 3 digits", async () => {
57
+ const result = await executeWithSchema(
58
+ "hex-color",
59
+ "type",
60
+ `
61
+ variable c: Color.Hex = #abc;
62
+ return c;
63
+ `,
64
+ );
65
+
66
+ expect((result as any).value).toBe("#abc");
67
+ });
68
+ });
69
+
70
+ describe("Edge Cases", () => {
71
+ it("should handle lowercase hex", async () => {
72
+ const result = await executeWithSchema(
73
+ "hex-color",
74
+ "type",
75
+ `
76
+ variable c: Color.Hex = #ffffff;
77
+ return c;
78
+ `,
79
+ );
80
+
81
+ expect((result as any).value).toBe("#ffffff");
82
+ });
83
+
84
+ it("should handle uppercase hex", async () => {
85
+ const result = await executeWithSchema(
86
+ "hex-color",
87
+ "type",
88
+ `
89
+ variable c: Color.Hex = #FFFFFF;
90
+ return c;
91
+ `,
92
+ );
93
+
94
+ expect((result as any).value).toBe("#FFFFFF");
95
+ });
96
+
97
+ it("should handle black color", async () => {
98
+ const result = await executeWithSchema(
99
+ "hex-color",
100
+ "type",
101
+ `
102
+ variable c: Color.Hex = #000000;
103
+ return c;
104
+ `,
105
+ );
106
+
107
+ expect((result as any).value).toBe("#000000");
108
+ });
109
+
110
+ it("should handle white color", async () => {
111
+ const result = await executeWithSchema(
112
+ "hex-color",
113
+ "type",
114
+ `
115
+ variable c: Color.Hex = #ffffff;
116
+ return c;
117
+ `,
118
+ );
119
+
120
+ expect((result as any).value).toBe("#ffffff");
121
+ });
122
+ });
123
+ });
@@ -0,0 +1,87 @@
1
+ // sRGB to HSL Conversion
2
+ // Reference: https://github.com/color-js/color.js/blob/main/src/spaces/hsl.js
3
+ //
4
+ // Algorithm:
5
+ // 1. Find max and min of R, G, B
6
+ // 2. L = (max + min) / 2
7
+ // 3. If max == min, S = 0 (achromatic)
8
+ // 4. Else S = (max - min) / (1 - |2L - 1|)
9
+ // 5. H depends on which channel is max
10
+ //
11
+ // Input: Color.SRGB with r, g, b in 0-1 range
12
+ // Output: Color.HSL with h (0-360), s (0-1), l (0-1)
13
+
14
+ // Get input sRGB values
15
+ variable r: Number = {input}.r;
16
+ variable g: Number = {input}.g;
17
+ variable b: Number = {input}.b;
18
+
19
+ // Find max and min
20
+ variable max_val: Number = r;
21
+ if (g > max_val) [
22
+ max_val = g;
23
+ ];
24
+ if (b > max_val) [
25
+ max_val = b;
26
+ ];
27
+
28
+ variable min_val: Number = r;
29
+ if (g < min_val) [
30
+ min_val = g;
31
+ ];
32
+ if (b < min_val) [
33
+ min_val = b;
34
+ ];
35
+
36
+ // Calculate lightness
37
+ variable l: Number = (max_val + min_val) / 2;
38
+
39
+ // Calculate saturation and hue
40
+ variable s: Number = 0;
41
+ variable h: Number = 0;
42
+ variable delta: Number = max_val - min_val;
43
+
44
+ if (delta > 0) [
45
+ // Not achromatic
46
+
47
+ // Saturation formula
48
+ variable abs_2l_minus_1: Number = 2 * l - 1;
49
+ if (abs_2l_minus_1 < 0) [
50
+ abs_2l_minus_1 = 0 - abs_2l_minus_1;
51
+ ];
52
+ s = delta / (1 - abs_2l_minus_1);
53
+
54
+ // Hue calculation depends on which channel is max
55
+ if (max_val == r) [
56
+ h = ((g - b) / delta);
57
+ if (g < b) [
58
+ h = h + 6;
59
+ ];
60
+ ] else [
61
+ if (max_val == g) [
62
+ h = (b - r) / delta + 2;
63
+ ] else [
64
+ h = (r - g) / delta + 4;
65
+ ];
66
+ ];
67
+
68
+ // Convert to degrees
69
+ h = h * 60;
70
+ ];
71
+
72
+ // Normalize hue to 0-360
73
+ if (h < 0) [
74
+ h = h + 360;
75
+ ];
76
+
77
+ // Create output
78
+ variable output: Color.HSL;
79
+ output.h = h;
80
+ output.s = s;
81
+ output.l = l;
82
+
83
+ return output;
84
+
85
+
86
+
87
+
@@ -0,0 +1,16 @@
1
+ // HSL Color Initializer
2
+ // Creates an HSL color from H, S, L values
3
+ // Input: List of [h, s, l] values
4
+
5
+ variable hsl_values: List = {input};
6
+ variable output: Color.HSL;
7
+
8
+ output.h = hsl_values.get(0);
9
+ output.s = hsl_values.get(1);
10
+ output.l = hsl_values.get(2);
11
+
12
+ return output;
13
+
14
+
15
+
16
+
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "HSL",
3
+ "type": "color",
4
+ "description": "HSL color space - Hue, Saturation, Lightness. Popular for color pickers and CSS.",
5
+ "schema": {
6
+ "type": "object",
7
+ "properties": {
8
+ "h": {
9
+ "type": "number",
10
+ "description": "Hue angle (0-360 degrees)"
11
+ },
12
+ "s": {
13
+ "type": "number",
14
+ "description": "Saturation (0-1)"
15
+ },
16
+ "l": {
17
+ "type": "number",
18
+ "description": "Lightness (0-1)"
19
+ }
20
+ },
21
+ "required": ["h", "s", "l"],
22
+ "order": ["h", "s", "l"],
23
+ "additionalProperties": false
24
+ },
25
+ "initializers": [
26
+ {
27
+ "title": "HSL Color Initializer",
28
+ "keyword": "hsl",
29
+ "description": "Creates an HSL color from H, S, L values",
30
+ "script": {
31
+ "type": "/api/v1/core/tokenscript/0/",
32
+ "script": "./initializer.tokenscript"
33
+ }
34
+ }
35
+ ],
36
+ "conversions": [
37
+ {
38
+ "source": "/api/v1/core/srgb-color/0/",
39
+ "target": "$self",
40
+ "description": "Converts sRGB to HSL",
41
+ "lossless": true,
42
+ "script": {
43
+ "type": "/api/v1/core/tokenscript/0/",
44
+ "script": "./from-srgb.tokenscript"
45
+ }
46
+ }
47
+ ]
48
+ }