@likec4/core 1.48.0 → 1.49.0

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 (134) hide show
  1. package/dist/THIRD-PARTY-LICENSES.md +1012 -0
  2. package/dist/_chunks/Builder.view-element.mjs +2 -3284
  3. package/dist/_chunks/LikeC4Model.d.mts +21 -25
  4. package/dist/_chunks/RichText.mjs +1 -148
  5. package/dist/_chunks/_types.d.mts +1 -5
  6. package/dist/_chunks/_types2.d.mts +2 -4
  7. package/dist/_chunks/assignTagColors.mjs +1 -24
  8. package/dist/_chunks/calcDriftsFromSnapshot.mjs +1 -379
  9. package/dist/_chunks/guards.d.mts +2026 -0
  10. package/dist/_chunks/guards.mjs +4 -0
  11. package/dist/_chunks/index.d.mts +255 -136
  12. package/dist/_chunks/libs/@mantine/colors-generator.mjs +2 -3403
  13. package/dist/_chunks/libs/@radix-ui/colors.mjs +1 -0
  14. package/dist/_chunks/libs/@ungap/structured-clone.mjs +1 -213
  15. package/dist/_chunks/libs/bail.mjs +1 -14
  16. package/dist/_chunks/libs/ccount.mjs +1 -25
  17. package/dist/_chunks/libs/character-entities-html4.mjs +1 -263
  18. package/dist/_chunks/libs/character-entities-legacy.mjs +1 -117
  19. package/dist/_chunks/libs/character-entities.mjs +2 -2136
  20. package/dist/_chunks/libs/comma-separated-tokens.mjs +1 -18
  21. package/dist/_chunks/libs/decode-named-character-reference.mjs +1 -21
  22. package/dist/_chunks/libs/defu.mjs +1 -42
  23. package/dist/_chunks/libs/devlop.mjs +1 -5
  24. package/dist/_chunks/libs/escape-string-regexp.mjs +1 -8
  25. package/dist/_chunks/libs/extend.mjs +1 -77
  26. package/dist/_chunks/libs/graphology-dag.mjs +1 -703
  27. package/dist/_chunks/libs/graphology.mjs +1 -4565
  28. package/dist/_chunks/libs/hast-util-sanitize.mjs +1 -863
  29. package/dist/_chunks/libs/hast-util-to-html.mjs +9 -2696
  30. package/dist/_chunks/libs/is-plain-obj.mjs +1 -9
  31. package/dist/_chunks/libs/longest-streak.mjs +1 -30
  32. package/dist/_chunks/libs/markdown-table.mjs +2 -290
  33. package/dist/_chunks/libs/mdast-util-find-and-replace.mjs +1 -653
  34. package/dist/_chunks/libs/mdast-util-from-markdown.mjs +3 -8522
  35. package/dist/_chunks/libs/mdast-util-gfm.mjs +15 -2393
  36. package/dist/_chunks/libs/mdast-util-to-hast.mjs +11 -1803
  37. package/dist/_chunks/libs/micromark-extension-gfm.mjs +1 -2243
  38. package/dist/_chunks/libs/mnemonist.d.mts +1 -91
  39. package/dist/_chunks/libs/mnemonist.mjs +1 -1978
  40. package/dist/_chunks/libs/natural-compare-lite.mjs +9 -42
  41. package/dist/_chunks/libs/ohash.mjs +1 -0
  42. package/dist/_chunks/libs/rehype-sanitize.mjs +1 -29
  43. package/dist/_chunks/libs/rehype-stringify.mjs +1 -34
  44. package/dist/_chunks/libs/remark-gfm.mjs +1 -36
  45. package/dist/_chunks/libs/remark-github-blockquote-alert.mjs +3 -100
  46. package/dist/_chunks/libs/remark-parse.mjs +1 -39
  47. package/dist/_chunks/libs/remark-rehype.mjs +1 -171
  48. package/dist/_chunks/libs/remeda.mjs +1 -702
  49. package/dist/_chunks/libs/trough.mjs +1 -158
  50. package/dist/_chunks/libs/unified.mjs +1 -2212
  51. package/dist/_chunks/rolldown-runtime.mjs +1 -42
  52. package/dist/_chunks/{index3.d.mts → theme.d.mts} +15 -13
  53. package/dist/_chunks/{index7.d.mts → to-text.d.mts} +165 -29
  54. package/dist/_chunks/to-text.mjs +1 -0
  55. package/dist/_chunks/vector.d.mts +198 -0
  56. package/dist/_chunks/vector.mjs +1 -0
  57. package/dist/builder/index.d.mts +2 -8
  58. package/dist/builder/index.mjs +1 -662
  59. package/dist/compute-view/index.d.mts +86 -15
  60. package/dist/compute-view/index.mjs +2 -262
  61. package/dist/geometry/index.d.mts +2 -2
  62. package/dist/geometry/index.mjs +1 -3
  63. package/dist/index.d.mts +9 -13
  64. package/dist/index.mjs +1 -27
  65. package/dist/model/index.d.mts +4 -14
  66. package/dist/model/index.mjs +1 -11
  67. package/dist/styles/index.d.mts +2 -8
  68. package/dist/styles/index.mjs +1 -30
  69. package/dist/types/index.d.mts +3 -9
  70. package/dist/types/index.mjs +1 -15
  71. package/dist/utils/graphology/index.d.mts +1 -1
  72. package/dist/utils/graphology/index.mjs +1 -3
  73. package/dist/utils/index.d.mts +4 -11
  74. package/dist/utils/index.mjs +1 -17
  75. package/package.json +13 -12
  76. package/dist/_chunks/LikeC4Styles.mjs +0 -691
  77. package/dist/_chunks/RichText.d.mts +0 -84
  78. package/dist/_chunks/_aux.d.mts +0 -289
  79. package/dist/_chunks/_aux.mjs +0 -18
  80. package/dist/_chunks/connection.mjs +0 -0
  81. package/dist/_chunks/const.d.mts +0 -43
  82. package/dist/_chunks/const.mjs +0 -33
  83. package/dist/_chunks/expression-model.d.mts +0 -192
  84. package/dist/_chunks/expression-model.mjs +0 -103
  85. package/dist/_chunks/expression.d.mts +0 -347
  86. package/dist/_chunks/expression.mjs +0 -107
  87. package/dist/_chunks/find.d.mts +0 -82
  88. package/dist/_chunks/find.mjs +0 -646
  89. package/dist/_chunks/find2.d.mts +0 -78
  90. package/dist/_chunks/find2.mjs +0 -287
  91. package/dist/_chunks/fqnRef.d.mts +0 -58
  92. package/dist/_chunks/fqnRef.mjs +0 -41
  93. package/dist/_chunks/geometry.mjs +0 -335
  94. package/dist/_chunks/index2.d.mts +0 -937
  95. package/dist/_chunks/index4.d.mts +0 -62
  96. package/dist/_chunks/index5.d.mts +0 -42
  97. package/dist/_chunks/index6.d.mts +0 -43
  98. package/dist/_chunks/index8.d.mts +0 -144
  99. package/dist/_chunks/invariant.mjs +0 -18
  100. package/dist/_chunks/iterable.mjs +0 -146
  101. package/dist/_chunks/libs/graphology-types.d.mts +0 -601
  102. package/dist/_chunks/libs/graphology.d.mts +0 -6
  103. package/dist/_chunks/mnemonist.d.mts +0 -1
  104. package/dist/_chunks/mnemonist.mjs +0 -0
  105. package/dist/_chunks/model.mjs +0 -1898
  106. package/dist/_chunks/model2.mjs +0 -0
  107. package/dist/_chunks/relationships-view.mjs +0 -132
  108. package/dist/_chunks/scalar.d.mts +0 -109
  109. package/dist/_chunks/scalar.mjs +0 -84
  110. package/dist/_chunks/utils.mjs +0 -483
  111. package/dist/compute-view/relationships-view/index.d.mts +0 -16
  112. package/dist/compute-view/relationships-view/index.mjs +0 -7
  113. package/dist/model/connection/deployment/index.d.mts +0 -12
  114. package/dist/model/connection/deployment/index.mjs +0 -9
  115. package/dist/model/connection/index.d.mts +0 -14
  116. package/dist/model/connection/index.mjs +0 -10
  117. package/dist/model/connection/model/index.d.mts +0 -12
  118. package/dist/model/connection/model/index.mjs +0 -8
  119. package/dist/types/RichText.d.mts +0 -3
  120. package/dist/types/RichText.mjs +0 -7
  121. package/dist/types/_aux.d.mts +0 -3
  122. package/dist/types/_aux.mjs +0 -3
  123. package/dist/types/expression-model.d.mts +0 -6
  124. package/dist/types/expression-model.mjs +0 -7
  125. package/dist/types/expression.d.mts +0 -5
  126. package/dist/types/expression.mjs +0 -7
  127. package/dist/types/fqnRef.d.mts +0 -4
  128. package/dist/types/fqnRef.mjs +0 -7
  129. package/dist/types/scalar.d.mts +0 -2
  130. package/dist/types/scalar.mjs +0 -7
  131. package/dist/utils/iterable/index.d.mts +0 -9
  132. package/dist/utils/iterable/index.mjs +0 -3
  133. package/dist/utils/mnemonist.d.mts +0 -2
  134. package/dist/utils/mnemonist.mjs +0 -12
@@ -1,2284 +1,4 @@
1
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/utils/limit.js
2
- const { min: min$4, max: max$4 } = Math;
3
- var limit_default = (x, low = 0, high = 1) => {
4
- return min$4(max$4(low, x), high);
5
- };
6
-
7
- //#endregion
8
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/utils/clip_rgb.js
9
- var clip_rgb_default = (rgb) => {
10
- rgb._clipped = false;
11
- rgb._unclipped = rgb.slice(0);
12
- for (let i = 0; i <= 3; i++) if (i < 3) {
13
- if (rgb[i] < 0 || rgb[i] > 255) rgb._clipped = true;
14
- rgb[i] = limit_default(rgb[i], 0, 255);
15
- } else if (i === 3) rgb[i] = limit_default(rgb[i], 0, 1);
16
- return rgb;
17
- };
18
-
19
- //#endregion
20
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/utils/type.js
21
- const classToType = {};
22
- for (let name of [
23
- "Boolean",
24
- "Number",
25
- "String",
26
- "Function",
27
- "Array",
28
- "Date",
29
- "RegExp",
30
- "Undefined",
31
- "Null"
32
- ]) classToType[`[object ${name}]`] = name.toLowerCase();
33
- function type_default(obj) {
34
- return classToType[Object.prototype.toString.call(obj)] || "object";
35
- }
36
-
37
- //#endregion
38
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/utils/unpack.js
39
- var unpack_default = (args, keyOrder = null) => {
40
- if (args.length >= 3) return Array.prototype.slice.call(args);
41
- if (type_default(args[0]) == "object" && keyOrder) return keyOrder.split("").filter((k) => args[0][k] !== void 0).map((k) => args[0][k]);
42
- return args[0].slice(0);
43
- };
44
-
45
- //#endregion
46
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/utils/last.js
47
- var last_default = (args) => {
48
- if (args.length < 2) return null;
49
- const l = args.length - 1;
50
- if (type_default(args[l]) == "string") return args[l].toLowerCase();
51
- return null;
52
- };
53
-
54
- //#endregion
55
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/utils/index.js
56
- const { PI: PI$2, min: min$3, max: max$3 } = Math;
57
- const rnd2 = (a) => Math.round(a * 100) / 100;
58
- const rnd3 = (a) => Math.round(a * 100) / 100;
59
- const TWOPI = PI$2 * 2;
60
- const PITHIRD = PI$2 / 3;
61
- const DEG2RAD = PI$2 / 180;
62
- const RAD2DEG = 180 / PI$2;
63
- /**
64
- * Reverse the first three elements of an array
65
- *
66
- * @param {any[]} arr
67
- * @returns {any[]}
68
- */
69
- function reverse3(arr) {
70
- return [...arr.slice(0, 3).reverse(), ...arr.slice(3)];
71
- }
72
-
73
- //#endregion
74
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/io/input.js
75
- var input_default = {
76
- format: {},
77
- autodetect: []
78
- };
79
-
80
- //#endregion
81
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/Color.js
82
- var Color = class {
83
- constructor(...args) {
84
- const me = this;
85
- if (type_default(args[0]) === "object" && args[0].constructor && args[0].constructor === this.constructor) return args[0];
86
- let mode = last_default(args);
87
- let autodetect = false;
88
- if (!mode) {
89
- autodetect = true;
90
- if (!input_default.sorted) {
91
- input_default.autodetect = input_default.autodetect.sort((a, b) => b.p - a.p);
92
- input_default.sorted = true;
93
- }
94
- for (let chk of input_default.autodetect) {
95
- mode = chk.test(...args);
96
- if (mode) break;
97
- }
98
- }
99
- if (input_default.format[mode]) me._rgb = clip_rgb_default(input_default.format[mode].apply(null, autodetect ? args : args.slice(0, -1)));
100
- else throw new Error("unknown format: " + args);
101
- if (me._rgb.length === 3) me._rgb.push(1);
102
- }
103
- toString() {
104
- if (type_default(this.hex) == "function") return this.hex();
105
- return `[${this._rgb.join(",")}]`;
106
- }
107
- };
108
- var Color_default = Color;
109
-
110
- //#endregion
111
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/version.js
112
- const version = "3.2.0";
113
-
114
- //#endregion
115
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/chroma.js
116
- const chroma = (...args) => {
117
- return new Color_default(...args);
118
- };
119
- chroma.version = version;
120
- var chroma_default = chroma;
121
-
122
- //#endregion
123
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/colors/w3cx11.js
124
- /**
125
- X11 color names
126
-
127
- http://www.w3.org/TR/css3-color/#svg-color
128
- */
129
- const w3cx11 = {
130
- aliceblue: "#f0f8ff",
131
- antiquewhite: "#faebd7",
132
- aqua: "#00ffff",
133
- aquamarine: "#7fffd4",
134
- azure: "#f0ffff",
135
- beige: "#f5f5dc",
136
- bisque: "#ffe4c4",
137
- black: "#000000",
138
- blanchedalmond: "#ffebcd",
139
- blue: "#0000ff",
140
- blueviolet: "#8a2be2",
141
- brown: "#a52a2a",
142
- burlywood: "#deb887",
143
- cadetblue: "#5f9ea0",
144
- chartreuse: "#7fff00",
145
- chocolate: "#d2691e",
146
- coral: "#ff7f50",
147
- cornflowerblue: "#6495ed",
148
- cornsilk: "#fff8dc",
149
- crimson: "#dc143c",
150
- cyan: "#00ffff",
151
- darkblue: "#00008b",
152
- darkcyan: "#008b8b",
153
- darkgoldenrod: "#b8860b",
154
- darkgray: "#a9a9a9",
155
- darkgreen: "#006400",
156
- darkgrey: "#a9a9a9",
157
- darkkhaki: "#bdb76b",
158
- darkmagenta: "#8b008b",
159
- darkolivegreen: "#556b2f",
160
- darkorange: "#ff8c00",
161
- darkorchid: "#9932cc",
162
- darkred: "#8b0000",
163
- darksalmon: "#e9967a",
164
- darkseagreen: "#8fbc8f",
165
- darkslateblue: "#483d8b",
166
- darkslategray: "#2f4f4f",
167
- darkslategrey: "#2f4f4f",
168
- darkturquoise: "#00ced1",
169
- darkviolet: "#9400d3",
170
- deeppink: "#ff1493",
171
- deepskyblue: "#00bfff",
172
- dimgray: "#696969",
173
- dimgrey: "#696969",
174
- dodgerblue: "#1e90ff",
175
- firebrick: "#b22222",
176
- floralwhite: "#fffaf0",
177
- forestgreen: "#228b22",
178
- fuchsia: "#ff00ff",
179
- gainsboro: "#dcdcdc",
180
- ghostwhite: "#f8f8ff",
181
- gold: "#ffd700",
182
- goldenrod: "#daa520",
183
- gray: "#808080",
184
- green: "#008000",
185
- greenyellow: "#adff2f",
186
- grey: "#808080",
187
- honeydew: "#f0fff0",
188
- hotpink: "#ff69b4",
189
- indianred: "#cd5c5c",
190
- indigo: "#4b0082",
191
- ivory: "#fffff0",
192
- khaki: "#f0e68c",
193
- laserlemon: "#ffff54",
194
- lavender: "#e6e6fa",
195
- lavenderblush: "#fff0f5",
196
- lawngreen: "#7cfc00",
197
- lemonchiffon: "#fffacd",
198
- lightblue: "#add8e6",
199
- lightcoral: "#f08080",
200
- lightcyan: "#e0ffff",
201
- lightgoldenrod: "#fafad2",
202
- lightgoldenrodyellow: "#fafad2",
203
- lightgray: "#d3d3d3",
204
- lightgreen: "#90ee90",
205
- lightgrey: "#d3d3d3",
206
- lightpink: "#ffb6c1",
207
- lightsalmon: "#ffa07a",
208
- lightseagreen: "#20b2aa",
209
- lightskyblue: "#87cefa",
210
- lightslategray: "#778899",
211
- lightslategrey: "#778899",
212
- lightsteelblue: "#b0c4de",
213
- lightyellow: "#ffffe0",
214
- lime: "#00ff00",
215
- limegreen: "#32cd32",
216
- linen: "#faf0e6",
217
- magenta: "#ff00ff",
218
- maroon: "#800000",
219
- maroon2: "#7f0000",
220
- maroon3: "#b03060",
221
- mediumaquamarine: "#66cdaa",
222
- mediumblue: "#0000cd",
223
- mediumorchid: "#ba55d3",
224
- mediumpurple: "#9370db",
225
- mediumseagreen: "#3cb371",
226
- mediumslateblue: "#7b68ee",
227
- mediumspringgreen: "#00fa9a",
228
- mediumturquoise: "#48d1cc",
229
- mediumvioletred: "#c71585",
230
- midnightblue: "#191970",
231
- mintcream: "#f5fffa",
232
- mistyrose: "#ffe4e1",
233
- moccasin: "#ffe4b5",
234
- navajowhite: "#ffdead",
235
- navy: "#000080",
236
- oldlace: "#fdf5e6",
237
- olive: "#808000",
238
- olivedrab: "#6b8e23",
239
- orange: "#ffa500",
240
- orangered: "#ff4500",
241
- orchid: "#da70d6",
242
- palegoldenrod: "#eee8aa",
243
- palegreen: "#98fb98",
244
- paleturquoise: "#afeeee",
245
- palevioletred: "#db7093",
246
- papayawhip: "#ffefd5",
247
- peachpuff: "#ffdab9",
248
- peru: "#cd853f",
249
- pink: "#ffc0cb",
250
- plum: "#dda0dd",
251
- powderblue: "#b0e0e6",
252
- purple: "#800080",
253
- purple2: "#7f007f",
254
- purple3: "#a020f0",
255
- rebeccapurple: "#663399",
256
- red: "#ff0000",
257
- rosybrown: "#bc8f8f",
258
- royalblue: "#4169e1",
259
- saddlebrown: "#8b4513",
260
- salmon: "#fa8072",
261
- sandybrown: "#f4a460",
262
- seagreen: "#2e8b57",
263
- seashell: "#fff5ee",
264
- sienna: "#a0522d",
265
- silver: "#c0c0c0",
266
- skyblue: "#87ceeb",
267
- slateblue: "#6a5acd",
268
- slategray: "#708090",
269
- slategrey: "#708090",
270
- snow: "#fffafa",
271
- springgreen: "#00ff7f",
272
- steelblue: "#4682b4",
273
- tan: "#d2b48c",
274
- teal: "#008080",
275
- thistle: "#d8bfd8",
276
- tomato: "#ff6347",
277
- turquoise: "#40e0d0",
278
- violet: "#ee82ee",
279
- wheat: "#f5deb3",
280
- white: "#ffffff",
281
- whitesmoke: "#f5f5f5",
282
- yellow: "#ffff00",
283
- yellowgreen: "#9acd32"
284
- };
285
- var w3cx11_default = w3cx11;
286
-
287
- //#endregion
288
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/io/hex/hex2rgb.js
289
- const RE_HEX = /^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;
290
- const RE_HEXA = /^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/;
291
- const hex2rgb = (hex) => {
292
- if (hex.match(RE_HEX)) {
293
- if (hex.length === 4 || hex.length === 7) hex = hex.substr(1);
294
- if (hex.length === 3) {
295
- hex = hex.split("");
296
- hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];
297
- }
298
- const u = parseInt(hex, 16);
299
- return [
300
- u >> 16,
301
- u >> 8 & 255,
302
- u & 255,
303
- 1
304
- ];
305
- }
306
- if (hex.match(RE_HEXA)) {
307
- if (hex.length === 5 || hex.length === 9) hex = hex.substr(1);
308
- if (hex.length === 4) {
309
- hex = hex.split("");
310
- hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2] + hex[3] + hex[3];
311
- }
312
- const u = parseInt(hex, 16);
313
- return [
314
- u >> 24 & 255,
315
- u >> 16 & 255,
316
- u >> 8 & 255,
317
- Math.round((u & 255) / 255 * 100) / 100
318
- ];
319
- }
320
- throw new Error(`unknown hex color: ${hex}`);
321
- };
322
- var hex2rgb_default = hex2rgb;
323
-
324
- //#endregion
325
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/io/hex/rgb2hex.js
326
- const { round: round$5 } = Math;
327
- const rgb2hex = (...args) => {
328
- let [r, g, b, a] = unpack_default(args, "rgba");
329
- let mode = last_default(args) || "auto";
330
- if (a === void 0) a = 1;
331
- if (mode === "auto") mode = a < 1 ? "rgba" : "rgb";
332
- r = round$5(r);
333
- g = round$5(g);
334
- b = round$5(b);
335
- let str = "000000" + (r << 16 | g << 8 | b).toString(16);
336
- str = str.substr(str.length - 6);
337
- let hxa = "0" + round$5(a * 255).toString(16);
338
- hxa = hxa.substr(hxa.length - 2);
339
- switch (mode.toLowerCase()) {
340
- case "rgba": return `#${str}${hxa}`;
341
- case "argb": return `#${hxa}${str}`;
342
- default: return `#${str}`;
343
- }
344
- };
345
- var rgb2hex_default = rgb2hex;
346
-
347
- //#endregion
348
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/io/named/index.js
349
- Color_default.prototype.name = function() {
350
- const hex = rgb2hex_default(this._rgb, "rgb");
351
- for (let n of Object.keys(w3cx11_default)) if (w3cx11_default[n] === hex) return n.toLowerCase();
352
- return hex;
353
- };
354
- input_default.format.named = (name) => {
355
- name = name.toLowerCase();
356
- if (w3cx11_default[name]) return hex2rgb_default(w3cx11_default[name]);
357
- throw new Error("unknown color name: " + name);
358
- };
359
- input_default.autodetect.push({
360
- p: 5,
361
- test: (h, ...rest) => {
362
- if (!rest.length && type_default(h) === "string" && w3cx11_default[h.toLowerCase()]) return "named";
363
- }
364
- });
365
-
366
- //#endregion
367
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/ops/alpha.js
368
- Color_default.prototype.alpha = function(a, mutate = false) {
369
- if (a !== void 0 && type_default(a) === "number") {
370
- if (mutate) {
371
- this._rgb[3] = a;
372
- return this;
373
- }
374
- return new Color_default([
375
- this._rgb[0],
376
- this._rgb[1],
377
- this._rgb[2],
378
- a
379
- ], "rgb");
380
- }
381
- return this._rgb[3];
382
- };
383
-
384
- //#endregion
385
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/ops/clipped.js
386
- Color_default.prototype.clipped = function() {
387
- return this._rgb._clipped || false;
388
- };
389
-
390
- //#endregion
391
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/io/lab/lab-constants.js
392
- const labConstants = {
393
- Kn: 18,
394
- labWhitePoint: "d65",
395
- Xn: .95047,
396
- Yn: 1,
397
- Zn: 1.08883,
398
- t0: .137931034,
399
- t1: .206896552,
400
- t2: .12841855,
401
- t3: .008856452,
402
- kE: 216 / 24389,
403
- kKE: 8,
404
- kK: 24389 / 27,
405
- RefWhiteRGB: {
406
- X: .95047,
407
- Y: 1,
408
- Z: 1.08883
409
- },
410
- MtxRGB2XYZ: {
411
- m00: .4124564390896922,
412
- m01: .21267285140562253,
413
- m02: .0193338955823293,
414
- m10: .357576077643909,
415
- m11: .715152155287818,
416
- m12: .11919202588130297,
417
- m20: .18043748326639894,
418
- m21: .07217499330655958,
419
- m22: .9503040785363679
420
- },
421
- MtxXYZ2RGB: {
422
- m00: 3.2404541621141045,
423
- m01: -.9692660305051868,
424
- m02: .055643430959114726,
425
- m10: -1.5371385127977166,
426
- m11: 1.8760108454466942,
427
- m12: -.2040259135167538,
428
- m20: -.498531409556016,
429
- m21: .041556017530349834,
430
- m22: 1.0572251882231791
431
- },
432
- As: .9414285350000001,
433
- Bs: 1.040417467,
434
- Cs: 1.089532651,
435
- MtxAdaptMa: {
436
- m00: .8951,
437
- m01: -.7502,
438
- m02: .0389,
439
- m10: .2664,
440
- m11: 1.7135,
441
- m12: -.0685,
442
- m20: -.1614,
443
- m21: .0367,
444
- m22: 1.0296
445
- },
446
- MtxAdaptMaI: {
447
- m00: .9869929054667123,
448
- m01: .43230526972339456,
449
- m02: -.008528664575177328,
450
- m10: -.14705425642099013,
451
- m11: .5183602715367776,
452
- m12: .04004282165408487,
453
- m20: .15996265166373125,
454
- m21: .0492912282128556,
455
- m22: .9684866957875502
456
- }
457
- };
458
- var lab_constants_default = labConstants;
459
- const ILLUMINANTS = new Map([
460
- ["a", [1.0985, .35585]],
461
- ["b", [1.0985, .35585]],
462
- ["c", [.98074, 1.18232]],
463
- ["d50", [.96422, .82521]],
464
- ["d55", [.95682, .92149]],
465
- ["d65", [.95047, 1.08883]],
466
- ["e", [
467
- 1,
468
- 1,
469
- 1
470
- ]],
471
- ["f2", [.99186, .67393]],
472
- ["f7", [.95041, 1.08747]],
473
- ["f11", [1.00962, .6435]],
474
- ["icc", [.96422, .82521]]
475
- ]);
476
- function setLabWhitePoint(name) {
477
- const ill = ILLUMINANTS.get(String(name).toLowerCase());
478
- if (!ill) throw new Error("unknown Lab illuminant " + name);
479
- labConstants.labWhitePoint = name;
480
- labConstants.Xn = ill[0];
481
- labConstants.Zn = ill[1];
482
- }
483
- function getLabWhitePoint() {
484
- return labConstants.labWhitePoint;
485
- }
486
-
487
- //#endregion
488
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/io/lab/lab2rgb.js
489
- const lab2rgb = (...args) => {
490
- args = unpack_default(args, "lab");
491
- const [L, a, b] = args;
492
- const [x, y, z] = lab2xyz(L, a, b);
493
- const [r, g, b_] = xyz2rgb(x, y, z);
494
- return [
495
- r,
496
- g,
497
- b_,
498
- args.length > 3 ? args[3] : 1
499
- ];
500
- };
501
- const lab2xyz = (L, a, b) => {
502
- const { kE, kK, kKE, Xn, Yn, Zn } = lab_constants_default;
503
- const fy = (L + 16) / 116;
504
- const fx = .002 * a + fy;
505
- const fz = fy - .005 * b;
506
- const fx3 = fx * fx * fx;
507
- const fz3 = fz * fz * fz;
508
- const xr = fx3 > kE ? fx3 : (116 * fx - 16) / kK;
509
- const yr = L > kKE ? Math.pow((L + 16) / 116, 3) : L / kK;
510
- const zr = fz3 > kE ? fz3 : (116 * fz - 16) / kK;
511
- return [
512
- xr * Xn,
513
- yr * Yn,
514
- zr * Zn
515
- ];
516
- };
517
- const compand = (linear) => {
518
- const sign = Math.sign(linear);
519
- linear = Math.abs(linear);
520
- return (linear <= .0031308 ? linear * 12.92 : 1.055 * Math.pow(linear, 1 / 2.4) - .055) * sign;
521
- };
522
- const xyz2rgb = (x, y, z) => {
523
- const { MtxAdaptMa, MtxAdaptMaI, MtxXYZ2RGB, RefWhiteRGB, Xn, Yn, Zn } = lab_constants_default;
524
- const As = Xn * MtxAdaptMa.m00 + Yn * MtxAdaptMa.m10 + Zn * MtxAdaptMa.m20;
525
- const Bs = Xn * MtxAdaptMa.m01 + Yn * MtxAdaptMa.m11 + Zn * MtxAdaptMa.m21;
526
- const Cs = Xn * MtxAdaptMa.m02 + Yn * MtxAdaptMa.m12 + Zn * MtxAdaptMa.m22;
527
- const Ad = RefWhiteRGB.X * MtxAdaptMa.m00 + RefWhiteRGB.Y * MtxAdaptMa.m10 + RefWhiteRGB.Z * MtxAdaptMa.m20;
528
- const Bd = RefWhiteRGB.X * MtxAdaptMa.m01 + RefWhiteRGB.Y * MtxAdaptMa.m11 + RefWhiteRGB.Z * MtxAdaptMa.m21;
529
- const Cd = RefWhiteRGB.X * MtxAdaptMa.m02 + RefWhiteRGB.Y * MtxAdaptMa.m12 + RefWhiteRGB.Z * MtxAdaptMa.m22;
530
- const X1 = (x * MtxAdaptMa.m00 + y * MtxAdaptMa.m10 + z * MtxAdaptMa.m20) * (Ad / As);
531
- const Y1 = (x * MtxAdaptMa.m01 + y * MtxAdaptMa.m11 + z * MtxAdaptMa.m21) * (Bd / Bs);
532
- const Z1 = (x * MtxAdaptMa.m02 + y * MtxAdaptMa.m12 + z * MtxAdaptMa.m22) * (Cd / Cs);
533
- const X2 = X1 * MtxAdaptMaI.m00 + Y1 * MtxAdaptMaI.m10 + Z1 * MtxAdaptMaI.m20;
534
- const Y2 = X1 * MtxAdaptMaI.m01 + Y1 * MtxAdaptMaI.m11 + Z1 * MtxAdaptMaI.m21;
535
- const Z2 = X1 * MtxAdaptMaI.m02 + Y1 * MtxAdaptMaI.m12 + Z1 * MtxAdaptMaI.m22;
536
- const r = compand(X2 * MtxXYZ2RGB.m00 + Y2 * MtxXYZ2RGB.m10 + Z2 * MtxXYZ2RGB.m20);
537
- const g = compand(X2 * MtxXYZ2RGB.m01 + Y2 * MtxXYZ2RGB.m11 + Z2 * MtxXYZ2RGB.m21);
538
- const b = compand(X2 * MtxXYZ2RGB.m02 + Y2 * MtxXYZ2RGB.m12 + Z2 * MtxXYZ2RGB.m22);
539
- return [
540
- r * 255,
541
- g * 255,
542
- b * 255
543
- ];
544
- };
545
- var lab2rgb_default = lab2rgb;
546
-
547
- //#endregion
548
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/io/lab/rgb2lab.js
549
- const rgb2lab = (...args) => {
550
- const [r, g, b, ...rest] = unpack_default(args, "rgb");
551
- const [x, y, z] = rgb2xyz(r, g, b);
552
- const [L, a, b_] = xyz2lab(x, y, z);
553
- return [
554
- L,
555
- a,
556
- b_,
557
- ...rest.length > 0 && rest[0] < 1 ? [rest[0]] : []
558
- ];
559
- };
560
- function xyz2lab(x, y, z) {
561
- const { Xn, Yn, Zn, kE, kK } = lab_constants_default;
562
- const xr = x / Xn;
563
- const yr = y / Yn;
564
- const zr = z / Zn;
565
- const fx = xr > kE ? Math.pow(xr, 1 / 3) : (kK * xr + 16) / 116;
566
- const fy = yr > kE ? Math.pow(yr, 1 / 3) : (kK * yr + 16) / 116;
567
- const fz = zr > kE ? Math.pow(zr, 1 / 3) : (kK * zr + 16) / 116;
568
- return [
569
- 116 * fy - 16,
570
- 500 * (fx - fy),
571
- 200 * (fy - fz)
572
- ];
573
- }
574
- function gammaAdjustSRGB(companded) {
575
- const sign = Math.sign(companded);
576
- companded = Math.abs(companded);
577
- return (companded <= .04045 ? companded / 12.92 : Math.pow((companded + .055) / 1.055, 2.4)) * sign;
578
- }
579
- const rgb2xyz = (r, g, b) => {
580
- r = gammaAdjustSRGB(r / 255);
581
- g = gammaAdjustSRGB(g / 255);
582
- b = gammaAdjustSRGB(b / 255);
583
- const { MtxRGB2XYZ, MtxAdaptMa, MtxAdaptMaI, Xn, Yn, Zn, As, Bs, Cs } = lab_constants_default;
584
- let x = r * MtxRGB2XYZ.m00 + g * MtxRGB2XYZ.m10 + b * MtxRGB2XYZ.m20;
585
- let y = r * MtxRGB2XYZ.m01 + g * MtxRGB2XYZ.m11 + b * MtxRGB2XYZ.m21;
586
- let z = r * MtxRGB2XYZ.m02 + g * MtxRGB2XYZ.m12 + b * MtxRGB2XYZ.m22;
587
- const Ad = Xn * MtxAdaptMa.m00 + Yn * MtxAdaptMa.m10 + Zn * MtxAdaptMa.m20;
588
- const Bd = Xn * MtxAdaptMa.m01 + Yn * MtxAdaptMa.m11 + Zn * MtxAdaptMa.m21;
589
- const Cd = Xn * MtxAdaptMa.m02 + Yn * MtxAdaptMa.m12 + Zn * MtxAdaptMa.m22;
590
- let X = x * MtxAdaptMa.m00 + y * MtxAdaptMa.m10 + z * MtxAdaptMa.m20;
591
- let Y = x * MtxAdaptMa.m01 + y * MtxAdaptMa.m11 + z * MtxAdaptMa.m21;
592
- let Z = x * MtxAdaptMa.m02 + y * MtxAdaptMa.m12 + z * MtxAdaptMa.m22;
593
- X *= Ad / As;
594
- Y *= Bd / Bs;
595
- Z *= Cd / Cs;
596
- x = X * MtxAdaptMaI.m00 + Y * MtxAdaptMaI.m10 + Z * MtxAdaptMaI.m20;
597
- y = X * MtxAdaptMaI.m01 + Y * MtxAdaptMaI.m11 + Z * MtxAdaptMaI.m21;
598
- z = X * MtxAdaptMaI.m02 + Y * MtxAdaptMaI.m12 + Z * MtxAdaptMaI.m22;
599
- return [
600
- x,
601
- y,
602
- z
603
- ];
604
- };
605
- var rgb2lab_default = rgb2lab;
606
-
607
- //#endregion
608
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/io/lab/index.js
609
- Color_default.prototype.lab = function() {
610
- return rgb2lab_default(this._rgb);
611
- };
612
- const lab$1 = (...args) => new Color_default(...args, "lab");
613
- Object.assign(chroma_default, {
614
- lab: lab$1,
615
- getLabWhitePoint,
616
- setLabWhitePoint
617
- });
618
- input_default.format.lab = lab2rgb_default;
619
- input_default.autodetect.push({
620
- p: 2,
621
- test: (...args) => {
622
- args = unpack_default(args, "lab");
623
- if (type_default(args) === "array" && args.length === 3) return "lab";
624
- }
625
- });
626
-
627
- //#endregion
628
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/ops/darken.js
629
- Color_default.prototype.darken = function(amount = 1) {
630
- const me = this;
631
- const lab = me.lab();
632
- lab[0] -= lab_constants_default.Kn * amount;
633
- return new Color_default(lab, "lab").alpha(me.alpha(), true);
634
- };
635
- Color_default.prototype.brighten = function(amount = 1) {
636
- return this.darken(-amount);
637
- };
638
- Color_default.prototype.darker = Color_default.prototype.darken;
639
- Color_default.prototype.brighter = Color_default.prototype.brighten;
640
-
641
- //#endregion
642
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/ops/get.js
643
- Color_default.prototype.get = function(mc) {
644
- const [mode, channel] = mc.split(".");
645
- const src = this[mode]();
646
- if (channel) {
647
- const i = mode.indexOf(channel) - (mode.substr(0, 2) === "ok" ? 2 : 0);
648
- if (i > -1) return src[i];
649
- throw new Error(`unknown channel ${channel} in mode ${mode}`);
650
- } else return src;
651
- };
652
-
653
- //#endregion
654
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/ops/luminance.js
655
- const { pow: pow$6 } = Math;
656
- const EPS = 1e-7;
657
- const MAX_ITER = 20;
658
- Color_default.prototype.luminance = function(lum, mode = "rgb") {
659
- if (lum !== void 0 && type_default(lum) === "number") {
660
- if (lum === 0) return new Color_default([
661
- 0,
662
- 0,
663
- 0,
664
- this._rgb[3]
665
- ], "rgb");
666
- if (lum === 1) return new Color_default([
667
- 255,
668
- 255,
669
- 255,
670
- this._rgb[3]
671
- ], "rgb");
672
- let cur_lum = this.luminance();
673
- let max_iter = MAX_ITER;
674
- const test = (low, high) => {
675
- const mid = low.interpolate(high, .5, mode);
676
- const lm = mid.luminance();
677
- if (Math.abs(lum - lm) < EPS || !max_iter--) return mid;
678
- return lm > lum ? test(low, mid) : test(mid, high);
679
- };
680
- return new Color_default([...(cur_lum > lum ? test(new Color_default([
681
- 0,
682
- 0,
683
- 0
684
- ]), this) : test(this, new Color_default([
685
- 255,
686
- 255,
687
- 255
688
- ]))).rgb(), this._rgb[3]]);
689
- }
690
- return rgb2luminance(...this._rgb.slice(0, 3));
691
- };
692
- const rgb2luminance = (r, g, b) => {
693
- r = luminance_x(r);
694
- g = luminance_x(g);
695
- b = luminance_x(b);
696
- return .2126 * r + .7152 * g + .0722 * b;
697
- };
698
- const luminance_x = (x) => {
699
- x /= 255;
700
- return x <= .03928 ? x / 12.92 : pow$6((x + .055) / 1.055, 2.4);
701
- };
702
-
703
- //#endregion
704
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/interpolator/index.js
705
- var interpolator_default = {};
706
-
707
- //#endregion
708
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/generator/mix.js
709
- var mix_default = (col1, col2, f = .5, ...rest) => {
710
- let mode = rest[0] || "lrgb";
711
- if (!interpolator_default[mode] && !rest.length) mode = Object.keys(interpolator_default)[0];
712
- if (!interpolator_default[mode]) throw new Error(`interpolation mode ${mode} is not defined`);
713
- if (type_default(col1) !== "object") col1 = new Color_default(col1);
714
- if (type_default(col2) !== "object") col2 = new Color_default(col2);
715
- return interpolator_default[mode](col1, col2, f).alpha(col1.alpha() + f * (col2.alpha() - col1.alpha()));
716
- };
717
-
718
- //#endregion
719
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/ops/mix.js
720
- Color_default.prototype.mix = Color_default.prototype.interpolate = function(col2, f = .5, ...rest) {
721
- return mix_default(this, col2, f, ...rest);
722
- };
723
-
724
- //#endregion
725
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/ops/premultiply.js
726
- Color_default.prototype.premultiply = function(mutate = false) {
727
- const rgb = this._rgb;
728
- const a = rgb[3];
729
- if (mutate) {
730
- this._rgb = [
731
- rgb[0] * a,
732
- rgb[1] * a,
733
- rgb[2] * a,
734
- a
735
- ];
736
- return this;
737
- } else return new Color_default([
738
- rgb[0] * a,
739
- rgb[1] * a,
740
- rgb[2] * a,
741
- a
742
- ], "rgb");
743
- };
744
-
745
- //#endregion
746
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/io/lch/lch2lab.js
747
- const { sin: sin$3, cos: cos$4 } = Math;
748
- const lch2lab = (...args) => {
749
- let [l, c, h] = unpack_default(args, "lch");
750
- if (isNaN(h)) h = 0;
751
- h = h * DEG2RAD;
752
- return [
753
- l,
754
- cos$4(h) * c,
755
- sin$3(h) * c
756
- ];
757
- };
758
- var lch2lab_default = lch2lab;
759
-
760
- //#endregion
761
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/io/lch/lch2rgb.js
762
- const lch2rgb = (...args) => {
763
- args = unpack_default(args, "lch");
764
- const [l, c, h] = args;
765
- const [L, a, b_] = lch2lab_default(l, c, h);
766
- const [r, g, b] = lab2rgb_default(L, a, b_);
767
- return [
768
- r,
769
- g,
770
- b,
771
- args.length > 3 ? args[3] : 1
772
- ];
773
- };
774
- var lch2rgb_default = lch2rgb;
775
-
776
- //#endregion
777
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/io/lch/hcl2rgb.js
778
- const hcl2rgb = (...args) => {
779
- return lch2rgb_default(...reverse3(unpack_default(args, "hcl")));
780
- };
781
- var hcl2rgb_default = hcl2rgb;
782
-
783
- //#endregion
784
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/io/lch/lab2lch.js
785
- const { sqrt: sqrt$4, atan2: atan2$2, round: round$4 } = Math;
786
- const lab2lch = (...args) => {
787
- const [l, a, b] = unpack_default(args, "lab");
788
- const c = sqrt$4(a * a + b * b);
789
- let h = (atan2$2(b, a) * RAD2DEG + 360) % 360;
790
- if (round$4(c * 1e4) === 0) h = NaN;
791
- return [
792
- l,
793
- c,
794
- h
795
- ];
796
- };
797
- var lab2lch_default = lab2lch;
798
-
799
- //#endregion
800
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/io/lch/rgb2lch.js
801
- const rgb2lch = (...args) => {
802
- const [r, g, b, ...rest] = unpack_default(args, "rgb");
803
- const [l, a, b_] = rgb2lab_default(r, g, b);
804
- const [L, c, h] = lab2lch_default(l, a, b_);
805
- return [
806
- L,
807
- c,
808
- h,
809
- ...rest.length > 0 && rest[0] < 1 ? [rest[0]] : []
810
- ];
811
- };
812
- var rgb2lch_default = rgb2lch;
813
-
814
- //#endregion
815
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/io/lch/index.js
816
- Color_default.prototype.lch = function() {
817
- return rgb2lch_default(this._rgb);
818
- };
819
- Color_default.prototype.hcl = function() {
820
- return reverse3(rgb2lch_default(this._rgb));
821
- };
822
- const lch$1 = (...args) => new Color_default(...args, "lch");
823
- const hcl = (...args) => new Color_default(...args, "hcl");
824
- Object.assign(chroma_default, {
825
- lch: lch$1,
826
- hcl
827
- });
828
- input_default.format.lch = lch2rgb_default;
829
- input_default.format.hcl = hcl2rgb_default;
830
- ["lch", "hcl"].forEach((m) => input_default.autodetect.push({
831
- p: 2,
832
- test: (...args) => {
833
- args = unpack_default(args, m);
834
- if (type_default(args) === "array" && args.length === 3) return m;
835
- }
836
- }));
837
-
838
- //#endregion
839
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/ops/saturate.js
840
- Color_default.prototype.saturate = function(amount = 1) {
841
- const me = this;
842
- const lch = me.lch();
843
- lch[1] += lab_constants_default.Kn * amount;
844
- if (lch[1] < 0) lch[1] = 0;
845
- return new Color_default(lch, "lch").alpha(me.alpha(), true);
846
- };
847
- Color_default.prototype.desaturate = function(amount = 1) {
848
- return this.saturate(-amount);
849
- };
850
-
851
- //#endregion
852
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/ops/set.js
853
- Color_default.prototype.set = function(mc, value, mutate = false) {
854
- const [mode, channel] = mc.split(".");
855
- const src = this[mode]();
856
- if (channel) {
857
- const i = mode.indexOf(channel) - (mode.substr(0, 2) === "ok" ? 2 : 0);
858
- if (i > -1) {
859
- if (type_default(value) == "string") switch (value.charAt(0)) {
860
- case "+":
861
- src[i] += +value;
862
- break;
863
- case "-":
864
- src[i] += +value;
865
- break;
866
- case "*":
867
- src[i] *= +value.substr(1);
868
- break;
869
- case "/":
870
- src[i] /= +value.substr(1);
871
- break;
872
- default: src[i] = +value;
873
- }
874
- else if (type_default(value) === "number") src[i] = value;
875
- else throw new Error(`unsupported value for Color.set`);
876
- const out = new Color_default(src, mode);
877
- if (mutate) {
878
- this._rgb = out._rgb;
879
- return this;
880
- }
881
- return out;
882
- }
883
- throw new Error(`unknown channel ${channel} in mode ${mode}`);
884
- } else return src;
885
- };
886
-
887
- //#endregion
888
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/ops/shade.js
889
- Color_default.prototype.tint = function(f = .5, ...rest) {
890
- return mix_default(this, "white", f, ...rest);
891
- };
892
- Color_default.prototype.shade = function(f = .5, ...rest) {
893
- return mix_default(this, "black", f, ...rest);
894
- };
895
-
896
- //#endregion
897
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/interpolator/rgb.js
898
- const rgb$1 = (col1, col2, f) => {
899
- const xyz0 = col1._rgb;
900
- const xyz1 = col2._rgb;
901
- return new Color_default(xyz0[0] + f * (xyz1[0] - xyz0[0]), xyz0[1] + f * (xyz1[1] - xyz0[1]), xyz0[2] + f * (xyz1[2] - xyz0[2]), "rgb");
902
- };
903
- interpolator_default.rgb = rgb$1;
904
-
905
- //#endregion
906
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/interpolator/lrgb.js
907
- const { sqrt: sqrt$3, pow: pow$5 } = Math;
908
- const lrgb = (col1, col2, f) => {
909
- const [x1, y1, z1] = col1._rgb;
910
- const [x2, y2, z2] = col2._rgb;
911
- return new Color_default(sqrt$3(pow$5(x1, 2) * (1 - f) + pow$5(x2, 2) * f), sqrt$3(pow$5(y1, 2) * (1 - f) + pow$5(y2, 2) * f), sqrt$3(pow$5(z1, 2) * (1 - f) + pow$5(z2, 2) * f), "rgb");
912
- };
913
- interpolator_default.lrgb = lrgb;
914
-
915
- //#endregion
916
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/interpolator/lab.js
917
- const lab = (col1, col2, f) => {
918
- const xyz0 = col1.lab();
919
- const xyz1 = col2.lab();
920
- return new Color_default(xyz0[0] + f * (xyz1[0] - xyz0[0]), xyz0[1] + f * (xyz1[1] - xyz0[1]), xyz0[2] + f * (xyz1[2] - xyz0[2]), "lab");
921
- };
922
- interpolator_default.lab = lab;
923
-
924
- //#endregion
925
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/interpolator/_hsx.js
926
- var _hsx_default = (col1, col2, f, m) => {
927
- let xyz0, xyz1;
928
- if (m === "hsl") {
929
- xyz0 = col1.hsl();
930
- xyz1 = col2.hsl();
931
- } else if (m === "hsv") {
932
- xyz0 = col1.hsv();
933
- xyz1 = col2.hsv();
934
- } else if (m === "hcg") {
935
- xyz0 = col1.hcg();
936
- xyz1 = col2.hcg();
937
- } else if (m === "hsi") {
938
- xyz0 = col1.hsi();
939
- xyz1 = col2.hsi();
940
- } else if (m === "lch" || m === "hcl") {
941
- m = "hcl";
942
- xyz0 = col1.hcl();
943
- xyz1 = col2.hcl();
944
- } else if (m === "oklch") {
945
- xyz0 = col1.oklch().reverse();
946
- xyz1 = col2.oklch().reverse();
947
- }
948
- let hue0, hue1, sat0, sat1, lbv0, lbv1;
949
- if (m.substr(0, 1) === "h" || m === "oklch") {
950
- [hue0, sat0, lbv0] = xyz0;
951
- [hue1, sat1, lbv1] = xyz1;
952
- }
953
- let sat, hue, lbv, dh;
954
- if (!isNaN(hue0) && !isNaN(hue1)) {
955
- if (hue1 > hue0 && hue1 - hue0 > 180) dh = hue1 - (hue0 + 360);
956
- else if (hue1 < hue0 && hue0 - hue1 > 180) dh = hue1 + 360 - hue0;
957
- else dh = hue1 - hue0;
958
- hue = hue0 + f * dh;
959
- } else if (!isNaN(hue0)) {
960
- hue = hue0;
961
- if ((lbv1 == 1 || lbv1 == 0) && m != "hsv") sat = sat0;
962
- } else if (!isNaN(hue1)) {
963
- hue = hue1;
964
- if ((lbv0 == 1 || lbv0 == 0) && m != "hsv") sat = sat1;
965
- } else hue = NaN;
966
- if (sat === void 0) sat = sat0 + f * (sat1 - sat0);
967
- lbv = lbv0 + f * (lbv1 - lbv0);
968
- return m === "oklch" ? new Color_default([
969
- lbv,
970
- sat,
971
- hue
972
- ], m) : new Color_default([
973
- hue,
974
- sat,
975
- lbv
976
- ], m);
977
- };
978
-
979
- //#endregion
980
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/interpolator/lch.js
981
- const lch = (col1, col2, f) => {
982
- return _hsx_default(col1, col2, f, "lch");
983
- };
984
- interpolator_default.lch = lch;
985
- interpolator_default.hcl = lch;
986
-
987
- //#endregion
988
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/io/num/num2rgb.js
989
- const num2rgb = (num) => {
990
- if (type_default(num) == "number" && num >= 0 && num <= 16777215) return [
991
- num >> 16,
992
- num >> 8 & 255,
993
- num & 255,
994
- 1
995
- ];
996
- throw new Error("unknown num color: " + num);
997
- };
998
- var num2rgb_default = num2rgb;
999
-
1000
- //#endregion
1001
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/io/num/rgb2num.js
1002
- const rgb2num = (...args) => {
1003
- const [r, g, b] = unpack_default(args, "rgb");
1004
- return (r << 16) + (g << 8) + b;
1005
- };
1006
- var rgb2num_default = rgb2num;
1007
-
1008
- //#endregion
1009
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/io/num/index.js
1010
- Color_default.prototype.num = function() {
1011
- return rgb2num_default(this._rgb);
1012
- };
1013
- const num$1 = (...args) => new Color_default(...args, "num");
1014
- Object.assign(chroma_default, { num: num$1 });
1015
- input_default.format.num = num2rgb_default;
1016
- input_default.autodetect.push({
1017
- p: 5,
1018
- test: (...args) => {
1019
- if (args.length === 1 && type_default(args[0]) === "number" && args[0] >= 0 && args[0] <= 16777215) return "num";
1020
- }
1021
- });
1022
-
1023
- //#endregion
1024
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/interpolator/num.js
1025
- const num = (col1, col2, f) => {
1026
- const c1 = col1.num();
1027
- return new Color_default(c1 + f * (col2.num() - c1), "num");
1028
- };
1029
- interpolator_default.num = num;
1030
-
1031
- //#endregion
1032
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/io/hcg/hcg2rgb.js
1033
- const { floor: floor$3 } = Math;
1034
- const hcg2rgb = (...args) => {
1035
- args = unpack_default(args, "hcg");
1036
- let [h, c, _g] = args;
1037
- let r, g, b;
1038
- _g = _g * 255;
1039
- const _c = c * 255;
1040
- if (c === 0) r = g = b = _g;
1041
- else {
1042
- if (h === 360) h = 0;
1043
- if (h > 360) h -= 360;
1044
- if (h < 0) h += 360;
1045
- h /= 60;
1046
- const i = floor$3(h);
1047
- const f = h - i;
1048
- const p = _g * (1 - c);
1049
- const q = p + _c * (1 - f);
1050
- const t = p + _c * f;
1051
- const v = p + _c;
1052
- switch (i) {
1053
- case 0:
1054
- [r, g, b] = [
1055
- v,
1056
- t,
1057
- p
1058
- ];
1059
- break;
1060
- case 1:
1061
- [r, g, b] = [
1062
- q,
1063
- v,
1064
- p
1065
- ];
1066
- break;
1067
- case 2:
1068
- [r, g, b] = [
1069
- p,
1070
- v,
1071
- t
1072
- ];
1073
- break;
1074
- case 3:
1075
- [r, g, b] = [
1076
- p,
1077
- q,
1078
- v
1079
- ];
1080
- break;
1081
- case 4:
1082
- [r, g, b] = [
1083
- t,
1084
- p,
1085
- v
1086
- ];
1087
- break;
1088
- case 5:
1089
- [r, g, b] = [
1090
- v,
1091
- p,
1092
- q
1093
- ];
1094
- break;
1095
- }
1096
- }
1097
- return [
1098
- r,
1099
- g,
1100
- b,
1101
- args.length > 3 ? args[3] : 1
1102
- ];
1103
- };
1104
- var hcg2rgb_default = hcg2rgb;
1105
-
1106
- //#endregion
1107
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/io/hcg/rgb2hcg.js
1108
- const rgb2hcg = (...args) => {
1109
- const [r, g, b] = unpack_default(args, "rgb");
1110
- const minRgb = min$3(r, g, b);
1111
- const maxRgb = max$3(r, g, b);
1112
- const delta = maxRgb - minRgb;
1113
- const c = delta * 100 / 255;
1114
- const _g = minRgb / (255 - delta) * 100;
1115
- let h;
1116
- if (delta === 0) h = NaN;
1117
- else {
1118
- if (r === maxRgb) h = (g - b) / delta;
1119
- if (g === maxRgb) h = 2 + (b - r) / delta;
1120
- if (b === maxRgb) h = 4 + (r - g) / delta;
1121
- h *= 60;
1122
- if (h < 0) h += 360;
1123
- }
1124
- return [
1125
- h,
1126
- c,
1127
- _g
1128
- ];
1129
- };
1130
- var rgb2hcg_default = rgb2hcg;
1131
-
1132
- //#endregion
1133
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/io/hcg/index.js
1134
- Color_default.prototype.hcg = function() {
1135
- return rgb2hcg_default(this._rgb);
1136
- };
1137
- const hcg$1 = (...args) => new Color_default(...args, "hcg");
1138
- chroma_default.hcg = hcg$1;
1139
- input_default.format.hcg = hcg2rgb_default;
1140
- input_default.autodetect.push({
1141
- p: 1,
1142
- test: (...args) => {
1143
- args = unpack_default(args, "hcg");
1144
- if (type_default(args) === "array" && args.length === 3) return "hcg";
1145
- }
1146
- });
1147
-
1148
- //#endregion
1149
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/interpolator/hcg.js
1150
- const hcg = (col1, col2, f) => {
1151
- return _hsx_default(col1, col2, f, "hcg");
1152
- };
1153
- interpolator_default.hcg = hcg;
1154
-
1155
- //#endregion
1156
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/io/hsi/hsi2rgb.js
1157
- const { cos: cos$3 } = Math;
1158
- const hsi2rgb = (...args) => {
1159
- args = unpack_default(args, "hsi");
1160
- let [h, s, i] = args;
1161
- let r, g, b;
1162
- if (isNaN(h)) h = 0;
1163
- if (isNaN(s)) s = 0;
1164
- if (h > 360) h -= 360;
1165
- if (h < 0) h += 360;
1166
- h /= 360;
1167
- if (h < 1 / 3) {
1168
- b = (1 - s) / 3;
1169
- r = (1 + s * cos$3(TWOPI * h) / cos$3(PITHIRD - TWOPI * h)) / 3;
1170
- g = 1 - (b + r);
1171
- } else if (h < 2 / 3) {
1172
- h -= 1 / 3;
1173
- r = (1 - s) / 3;
1174
- g = (1 + s * cos$3(TWOPI * h) / cos$3(PITHIRD - TWOPI * h)) / 3;
1175
- b = 1 - (r + g);
1176
- } else {
1177
- h -= 2 / 3;
1178
- g = (1 - s) / 3;
1179
- b = (1 + s * cos$3(TWOPI * h) / cos$3(PITHIRD - TWOPI * h)) / 3;
1180
- r = 1 - (g + b);
1181
- }
1182
- r = limit_default(i * r * 3);
1183
- g = limit_default(i * g * 3);
1184
- b = limit_default(i * b * 3);
1185
- return [
1186
- r * 255,
1187
- g * 255,
1188
- b * 255,
1189
- args.length > 3 ? args[3] : 1
1190
- ];
1191
- };
1192
- var hsi2rgb_default = hsi2rgb;
1193
-
1194
- //#endregion
1195
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/io/hsi/rgb2hsi.js
1196
- const { min: min$2, sqrt: sqrt$2, acos } = Math;
1197
- const rgb2hsi = (...args) => {
1198
- let [r, g, b] = unpack_default(args, "rgb");
1199
- r /= 255;
1200
- g /= 255;
1201
- b /= 255;
1202
- let h;
1203
- const min_ = min$2(r, g, b);
1204
- const i = (r + g + b) / 3;
1205
- const s = i > 0 ? 1 - min_ / i : 0;
1206
- if (s === 0) h = NaN;
1207
- else {
1208
- h = (r - g + (r - b)) / 2;
1209
- h /= sqrt$2((r - g) * (r - g) + (r - b) * (g - b));
1210
- h = acos(h);
1211
- if (b > g) h = TWOPI - h;
1212
- h /= TWOPI;
1213
- }
1214
- return [
1215
- h * 360,
1216
- s,
1217
- i
1218
- ];
1219
- };
1220
- var rgb2hsi_default = rgb2hsi;
1221
-
1222
- //#endregion
1223
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/io/hsi/index.js
1224
- Color_default.prototype.hsi = function() {
1225
- return rgb2hsi_default(this._rgb);
1226
- };
1227
- const hsi$1 = (...args) => new Color_default(...args, "hsi");
1228
- chroma_default.hsi = hsi$1;
1229
- input_default.format.hsi = hsi2rgb_default;
1230
- input_default.autodetect.push({
1231
- p: 2,
1232
- test: (...args) => {
1233
- args = unpack_default(args, "hsi");
1234
- if (type_default(args) === "array" && args.length === 3) return "hsi";
1235
- }
1236
- });
1237
-
1238
- //#endregion
1239
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/interpolator/hsi.js
1240
- const hsi = (col1, col2, f) => {
1241
- return _hsx_default(col1, col2, f, "hsi");
1242
- };
1243
- interpolator_default.hsi = hsi;
1244
-
1245
- //#endregion
1246
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/io/hsl/hsl2rgb.js
1247
- const hsl2rgb = (...args) => {
1248
- args = unpack_default(args, "hsl");
1249
- const [h, s, l] = args;
1250
- let r, g, b;
1251
- if (s === 0) r = g = b = l * 255;
1252
- else {
1253
- const t3 = [
1254
- 0,
1255
- 0,
1256
- 0
1257
- ];
1258
- const c = [
1259
- 0,
1260
- 0,
1261
- 0
1262
- ];
1263
- const t2 = l < .5 ? l * (1 + s) : l + s - l * s;
1264
- const t1 = 2 * l - t2;
1265
- const h_ = h / 360;
1266
- t3[0] = h_ + 1 / 3;
1267
- t3[1] = h_;
1268
- t3[2] = h_ - 1 / 3;
1269
- for (let i = 0; i < 3; i++) {
1270
- if (t3[i] < 0) t3[i] += 1;
1271
- if (t3[i] > 1) t3[i] -= 1;
1272
- if (6 * t3[i] < 1) c[i] = t1 + (t2 - t1) * 6 * t3[i];
1273
- else if (2 * t3[i] < 1) c[i] = t2;
1274
- else if (3 * t3[i] < 2) c[i] = t1 + (t2 - t1) * (2 / 3 - t3[i]) * 6;
1275
- else c[i] = t1;
1276
- }
1277
- [r, g, b] = [
1278
- c[0] * 255,
1279
- c[1] * 255,
1280
- c[2] * 255
1281
- ];
1282
- }
1283
- if (args.length > 3) return [
1284
- r,
1285
- g,
1286
- b,
1287
- args[3]
1288
- ];
1289
- return [
1290
- r,
1291
- g,
1292
- b,
1293
- 1
1294
- ];
1295
- };
1296
- var hsl2rgb_default = hsl2rgb;
1297
-
1298
- //#endregion
1299
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/io/hsl/rgb2hsl.js
1300
- const rgb2hsl$1 = (...args) => {
1301
- args = unpack_default(args, "rgba");
1302
- let [r, g, b] = args;
1303
- r /= 255;
1304
- g /= 255;
1305
- b /= 255;
1306
- const minRgb = min$3(r, g, b);
1307
- const maxRgb = max$3(r, g, b);
1308
- const l = (maxRgb + minRgb) / 2;
1309
- let s, h;
1310
- if (maxRgb === minRgb) {
1311
- s = 0;
1312
- h = NaN;
1313
- } else s = l < .5 ? (maxRgb - minRgb) / (maxRgb + minRgb) : (maxRgb - minRgb) / (2 - maxRgb - minRgb);
1314
- if (r == maxRgb) h = (g - b) / (maxRgb - minRgb);
1315
- else if (g == maxRgb) h = 2 + (b - r) / (maxRgb - minRgb);
1316
- else if (b == maxRgb) h = 4 + (r - g) / (maxRgb - minRgb);
1317
- h *= 60;
1318
- if (h < 0) h += 360;
1319
- if (args.length > 3 && args[3] !== void 0) return [
1320
- h,
1321
- s,
1322
- l,
1323
- args[3]
1324
- ];
1325
- return [
1326
- h,
1327
- s,
1328
- l
1329
- ];
1330
- };
1331
- var rgb2hsl_default = rgb2hsl$1;
1332
-
1333
- //#endregion
1334
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/io/hsl/index.js
1335
- Color_default.prototype.hsl = function() {
1336
- return rgb2hsl_default(this._rgb);
1337
- };
1338
- const hsl$1 = (...args) => new Color_default(...args, "hsl");
1339
- chroma_default.hsl = hsl$1;
1340
- input_default.format.hsl = hsl2rgb_default;
1341
- input_default.autodetect.push({
1342
- p: 2,
1343
- test: (...args) => {
1344
- args = unpack_default(args, "hsl");
1345
- if (type_default(args) === "array" && args.length === 3) return "hsl";
1346
- }
1347
- });
1348
-
1349
- //#endregion
1350
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/interpolator/hsl.js
1351
- const hsl = (col1, col2, f) => {
1352
- return _hsx_default(col1, col2, f, "hsl");
1353
- };
1354
- interpolator_default.hsl = hsl;
1355
-
1356
- //#endregion
1357
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/io/hsv/hsv2rgb.js
1358
- const { floor: floor$2 } = Math;
1359
- const hsv2rgb = (...args) => {
1360
- args = unpack_default(args, "hsv");
1361
- let [h, s, v] = args;
1362
- let r, g, b;
1363
- v *= 255;
1364
- if (s === 0) r = g = b = v;
1365
- else {
1366
- if (h === 360) h = 0;
1367
- if (h > 360) h -= 360;
1368
- if (h < 0) h += 360;
1369
- h /= 60;
1370
- const i = floor$2(h);
1371
- const f = h - i;
1372
- const p = v * (1 - s);
1373
- const q = v * (1 - s * f);
1374
- const t = v * (1 - s * (1 - f));
1375
- switch (i) {
1376
- case 0:
1377
- [r, g, b] = [
1378
- v,
1379
- t,
1380
- p
1381
- ];
1382
- break;
1383
- case 1:
1384
- [r, g, b] = [
1385
- q,
1386
- v,
1387
- p
1388
- ];
1389
- break;
1390
- case 2:
1391
- [r, g, b] = [
1392
- p,
1393
- v,
1394
- t
1395
- ];
1396
- break;
1397
- case 3:
1398
- [r, g, b] = [
1399
- p,
1400
- q,
1401
- v
1402
- ];
1403
- break;
1404
- case 4:
1405
- [r, g, b] = [
1406
- t,
1407
- p,
1408
- v
1409
- ];
1410
- break;
1411
- case 5:
1412
- [r, g, b] = [
1413
- v,
1414
- p,
1415
- q
1416
- ];
1417
- break;
1418
- }
1419
- }
1420
- return [
1421
- r,
1422
- g,
1423
- b,
1424
- args.length > 3 ? args[3] : 1
1425
- ];
1426
- };
1427
- var hsv2rgb_default = hsv2rgb;
1428
-
1429
- //#endregion
1430
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/io/hsv/rgb2hsv.js
1431
- const { min: min$1, max: max$2 } = Math;
1432
- const rgb2hsl = (...args) => {
1433
- args = unpack_default(args, "rgb");
1434
- let [r, g, b] = args;
1435
- const min_ = min$1(r, g, b);
1436
- const max_ = max$2(r, g, b);
1437
- const delta = max_ - min_;
1438
- let h, s, v;
1439
- v = max_ / 255;
1440
- if (max_ === 0) {
1441
- h = NaN;
1442
- s = 0;
1443
- } else {
1444
- s = delta / max_;
1445
- if (r === max_) h = (g - b) / delta;
1446
- if (g === max_) h = 2 + (b - r) / delta;
1447
- if (b === max_) h = 4 + (r - g) / delta;
1448
- h *= 60;
1449
- if (h < 0) h += 360;
1450
- }
1451
- return [
1452
- h,
1453
- s,
1454
- v
1455
- ];
1456
- };
1457
- var rgb2hsv_default = rgb2hsl;
1458
-
1459
- //#endregion
1460
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/io/hsv/index.js
1461
- Color_default.prototype.hsv = function() {
1462
- return rgb2hsv_default(this._rgb);
1463
- };
1464
- const hsv$1 = (...args) => new Color_default(...args, "hsv");
1465
- chroma_default.hsv = hsv$1;
1466
- input_default.format.hsv = hsv2rgb_default;
1467
- input_default.autodetect.push({
1468
- p: 2,
1469
- test: (...args) => {
1470
- args = unpack_default(args, "hsv");
1471
- if (type_default(args) === "array" && args.length === 3) return "hsv";
1472
- }
1473
- });
1474
-
1475
- //#endregion
1476
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/interpolator/hsv.js
1477
- const hsv = (col1, col2, f) => {
1478
- return _hsx_default(col1, col2, f, "hsv");
1479
- };
1480
- interpolator_default.hsv = hsv;
1481
-
1482
- //#endregion
1483
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/utils/multiply-matrices.js
1484
- function multiplyMatrices(A, B) {
1485
- let m = A.length;
1486
- if (!Array.isArray(A[0])) A = [A];
1487
- if (!Array.isArray(B[0])) B = B.map((x) => [x]);
1488
- let p = B[0].length;
1489
- let B_cols = B[0].map((_, i) => B.map((x) => x[i]));
1490
- let product = A.map((row) => B_cols.map((col) => {
1491
- if (!Array.isArray(row)) return col.reduce((a, c) => a + c * row, 0);
1492
- return row.reduce((a, c, i) => a + c * (col[i] || 0), 0);
1493
- }));
1494
- if (m === 1) product = product[0];
1495
- if (p === 1) return product.map((x) => x[0]);
1496
- return product;
1497
- }
1498
-
1499
- //#endregion
1500
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/io/oklab/oklab2rgb.js
1501
- const oklab2rgb = (...args) => {
1502
- args = unpack_default(args, "lab");
1503
- const [L, a, b, ...rest] = args;
1504
- const [X, Y, Z] = OKLab_to_XYZ([
1505
- L,
1506
- a,
1507
- b
1508
- ]);
1509
- const [r, g, b_] = xyz2rgb(X, Y, Z);
1510
- return [
1511
- r,
1512
- g,
1513
- b_,
1514
- ...rest.length > 0 && rest[0] < 1 ? [rest[0]] : []
1515
- ];
1516
- };
1517
- function OKLab_to_XYZ(OKLab) {
1518
- return multiplyMatrices([
1519
- [
1520
- 1.2268798758459243,
1521
- -.5578149944602171,
1522
- .2813910456659647
1523
- ],
1524
- [
1525
- -.0405757452148008,
1526
- 1.112286803280317,
1527
- -.0717110580655164
1528
- ],
1529
- [
1530
- -.0763729366746601,
1531
- -.4214933324022432,
1532
- 1.5869240198367816
1533
- ]
1534
- ], multiplyMatrices([
1535
- [
1536
- 1,
1537
- .3963377773761749,
1538
- .2158037573099136
1539
- ],
1540
- [
1541
- 1,
1542
- -.1055613458156586,
1543
- -.0638541728258133
1544
- ],
1545
- [
1546
- 1,
1547
- -.0894841775298119,
1548
- -1.2914855480194092
1549
- ]
1550
- ], OKLab).map((c) => c ** 3));
1551
- }
1552
- var oklab2rgb_default = oklab2rgb;
1553
-
1554
- //#endregion
1555
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/io/oklab/rgb2oklab.js
1556
- const rgb2oklab = (...args) => {
1557
- const [r, g, b, ...rest] = unpack_default(args, "rgb");
1558
- return [...XYZ_to_OKLab(rgb2xyz(r, g, b)), ...rest.length > 0 && rest[0] < 1 ? [rest[0]] : []];
1559
- };
1560
- function XYZ_to_OKLab(XYZ) {
1561
- return multiplyMatrices([
1562
- [
1563
- .210454268309314,
1564
- .7936177747023054,
1565
- -.0040720430116193
1566
- ],
1567
- [
1568
- 1.9779985324311684,
1569
- -2.42859224204858,
1570
- .450593709617411
1571
- ],
1572
- [
1573
- .0259040424655478,
1574
- .7827717124575296,
1575
- -.8086757549230774
1576
- ]
1577
- ], multiplyMatrices([
1578
- [
1579
- .819022437996703,
1580
- .3619062600528904,
1581
- -.1288737815209879
1582
- ],
1583
- [
1584
- .0329836539323885,
1585
- .9292868615863434,
1586
- .0361446663506424
1587
- ],
1588
- [
1589
- .0481771893596242,
1590
- .2642395317527308,
1591
- .6335478284694309
1592
- ]
1593
- ], XYZ).map((c) => Math.cbrt(c)));
1594
- }
1595
- var rgb2oklab_default = rgb2oklab;
1596
-
1597
- //#endregion
1598
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/io/oklab/index.js
1599
- Color_default.prototype.oklab = function() {
1600
- return rgb2oklab_default(this._rgb);
1601
- };
1602
- const oklab$1 = (...args) => new Color_default(...args, "oklab");
1603
- Object.assign(chroma_default, { oklab: oklab$1 });
1604
- input_default.format.oklab = oklab2rgb_default;
1605
- input_default.autodetect.push({
1606
- p: 2,
1607
- test: (...args) => {
1608
- args = unpack_default(args, "oklab");
1609
- if (type_default(args) === "array" && args.length === 3) return "oklab";
1610
- }
1611
- });
1612
-
1613
- //#endregion
1614
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/interpolator/oklab.js
1615
- const oklab = (col1, col2, f) => {
1616
- const xyz0 = col1.oklab();
1617
- const xyz1 = col2.oklab();
1618
- return new Color_default(xyz0[0] + f * (xyz1[0] - xyz0[0]), xyz0[1] + f * (xyz1[1] - xyz0[1]), xyz0[2] + f * (xyz1[2] - xyz0[2]), "oklab");
1619
- };
1620
- interpolator_default.oklab = oklab;
1621
-
1622
- //#endregion
1623
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/interpolator/oklch.js
1624
- const oklch$1 = (col1, col2, f) => {
1625
- return _hsx_default(col1, col2, f, "oklch");
1626
- };
1627
- interpolator_default.oklch = oklch$1;
1628
-
1629
- //#endregion
1630
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/generator/average.js
1631
- const { pow: pow$4, sqrt: sqrt$1, PI: PI$1, cos: cos$2, sin: sin$2, atan2: atan2$1 } = Math;
1632
- var average_default = (colors, mode = "lrgb", weights = null) => {
1633
- const l = colors.length;
1634
- if (!weights) weights = Array.from(new Array(l)).map(() => 1);
1635
- const k = l / weights.reduce(function(a, b) {
1636
- return a + b;
1637
- });
1638
- weights.forEach((w, i) => {
1639
- weights[i] *= k;
1640
- });
1641
- colors = colors.map((c) => new Color_default(c));
1642
- if (mode === "lrgb") return _average_lrgb(colors, weights);
1643
- const first = colors.shift();
1644
- const xyz = first.get(mode);
1645
- const cnt = [];
1646
- let dx = 0;
1647
- let dy = 0;
1648
- for (let i = 0; i < xyz.length; i++) {
1649
- xyz[i] = (xyz[i] || 0) * weights[0];
1650
- cnt.push(isNaN(xyz[i]) ? 0 : weights[0]);
1651
- if (mode.charAt(i) === "h" && !isNaN(xyz[i])) {
1652
- const A = xyz[i] / 180 * PI$1;
1653
- dx += cos$2(A) * weights[0];
1654
- dy += sin$2(A) * weights[0];
1655
- }
1656
- }
1657
- let alpha = first.alpha() * weights[0];
1658
- colors.forEach((c, ci) => {
1659
- const xyz2 = c.get(mode);
1660
- alpha += c.alpha() * weights[ci + 1];
1661
- for (let i = 0; i < xyz.length; i++) if (!isNaN(xyz2[i])) {
1662
- cnt[i] += weights[ci + 1];
1663
- if (mode.charAt(i) === "h") {
1664
- const A = xyz2[i] / 180 * PI$1;
1665
- dx += cos$2(A) * weights[ci + 1];
1666
- dy += sin$2(A) * weights[ci + 1];
1667
- } else xyz[i] += xyz2[i] * weights[ci + 1];
1668
- }
1669
- });
1670
- for (let i = 0; i < xyz.length; i++) if (mode.charAt(i) === "h") {
1671
- let A = atan2$1(dy / cnt[i], dx / cnt[i]) / PI$1 * 180;
1672
- while (A < 0) A += 360;
1673
- while (A >= 360) A -= 360;
1674
- xyz[i] = A;
1675
- } else xyz[i] = xyz[i] / cnt[i];
1676
- alpha /= l;
1677
- return new Color_default(xyz, mode).alpha(alpha > .99999 ? 1 : alpha, true);
1678
- };
1679
- const _average_lrgb = (colors, weights) => {
1680
- const l = colors.length;
1681
- const xyz = [
1682
- 0,
1683
- 0,
1684
- 0,
1685
- 0
1686
- ];
1687
- for (let i = 0; i < colors.length; i++) {
1688
- const col = colors[i];
1689
- const f = weights[i] / l;
1690
- const rgb = col._rgb;
1691
- xyz[0] += pow$4(rgb[0], 2) * f;
1692
- xyz[1] += pow$4(rgb[1], 2) * f;
1693
- xyz[2] += pow$4(rgb[2], 2) * f;
1694
- xyz[3] += rgb[3] * f;
1695
- }
1696
- xyz[0] = sqrt$1(xyz[0]);
1697
- xyz[1] = sqrt$1(xyz[1]);
1698
- xyz[2] = sqrt$1(xyz[2]);
1699
- if (xyz[3] > .9999999) xyz[3] = 1;
1700
- return new Color_default(clip_rgb_default(xyz));
1701
- };
1702
-
1703
- //#endregion
1704
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/generator/scale.js
1705
- const { pow: pow$3 } = Math;
1706
- function scale_default(colors) {
1707
- let _mode = "rgb";
1708
- let _nacol = chroma_default("#ccc");
1709
- let _spread = 0;
1710
- let _positions = [0, 1];
1711
- let _domain = [0, 1];
1712
- let _pos = [];
1713
- let _padding = [0, 0];
1714
- let _classes = false;
1715
- let _colors = [];
1716
- let _out = false;
1717
- let _min = 0;
1718
- let _max = 1;
1719
- let _correctLightness = false;
1720
- let _colorCache = {};
1721
- let _useCache = true;
1722
- let _gamma = 1;
1723
- const setColors = function(colors) {
1724
- colors = colors || ["#fff", "#000"];
1725
- if (colors && type_default(colors) === "string" && chroma_default.brewer && chroma_default.brewer[colors.toLowerCase()]) colors = chroma_default.brewer[colors.toLowerCase()];
1726
- if (type_default(colors) === "array") {
1727
- if (colors.length === 1) colors = [colors[0], colors[0]];
1728
- colors = colors.slice(0);
1729
- for (let c = 0; c < colors.length; c++) colors[c] = chroma_default(colors[c]);
1730
- _pos.length = 0;
1731
- for (let c = 0; c < colors.length; c++) _pos.push(c / (colors.length - 1));
1732
- }
1733
- resetCache();
1734
- return _colors = colors;
1735
- };
1736
- const getClass = function(value) {
1737
- if (_classes != null) {
1738
- const n = _classes.length - 1;
1739
- let i = 0;
1740
- while (i < n && value >= _classes[i]) i++;
1741
- return i - 1;
1742
- }
1743
- return 0;
1744
- };
1745
- let tMapLightness = (t) => t;
1746
- let tMapDomain = (t) => t;
1747
- const getColor = function(val, bypassMap) {
1748
- let col, t;
1749
- if (bypassMap == null) bypassMap = false;
1750
- if (isNaN(val) || val === null) return _nacol;
1751
- if (!bypassMap) if (_classes && _classes.length > 2) t = getClass(val) / (_classes.length - 2);
1752
- else if (_max !== _min) t = (val - _min) / (_max - _min);
1753
- else t = 1;
1754
- else t = val;
1755
- t = tMapDomain(t);
1756
- if (!bypassMap) t = tMapLightness(t);
1757
- if (_gamma !== 1) t = pow$3(t, _gamma);
1758
- t = _padding[0] + t * (1 - _padding[0] - _padding[1]);
1759
- t = limit_default(t, 0, 1);
1760
- const k = Math.floor(t * 1e4);
1761
- if (_useCache && _colorCache[k]) col = _colorCache[k];
1762
- else {
1763
- if (type_default(_colors) === "array") for (let i = 0; i < _pos.length; i++) {
1764
- const p = _pos[i];
1765
- if (t <= p) {
1766
- col = _colors[i];
1767
- break;
1768
- }
1769
- if (t >= p && i === _pos.length - 1) {
1770
- col = _colors[i];
1771
- break;
1772
- }
1773
- if (t > p && t < _pos[i + 1]) {
1774
- t = (t - p) / (_pos[i + 1] - p);
1775
- col = chroma_default.interpolate(_colors[i], _colors[i + 1], t, _mode);
1776
- break;
1777
- }
1778
- }
1779
- else if (type_default(_colors) === "function") col = _colors(t);
1780
- if (_useCache) _colorCache[k] = col;
1781
- }
1782
- return col;
1783
- };
1784
- var resetCache = () => _colorCache = {};
1785
- setColors(colors);
1786
- const f = function(v) {
1787
- const c = chroma_default(getColor(v));
1788
- if (_out && c[_out]) return c[_out]();
1789
- else return c;
1790
- };
1791
- f.classes = function(classes) {
1792
- if (classes != null) {
1793
- if (type_default(classes) === "array") {
1794
- _classes = classes;
1795
- _positions = [classes[0], classes[classes.length - 1]];
1796
- } else {
1797
- const d = chroma_default.analyze(_positions);
1798
- if (classes === 0) _classes = [d.min, d.max];
1799
- else _classes = chroma_default.limits(d, "e", classes);
1800
- }
1801
- return f;
1802
- }
1803
- return _classes;
1804
- };
1805
- f.domain = function(domain) {
1806
- if (!arguments.length) return _domain;
1807
- _domain = domain.slice(0);
1808
- _min = domain[0];
1809
- _max = domain[domain.length - 1];
1810
- _pos = [];
1811
- const k = _colors.length;
1812
- if (domain.length === k && _min !== _max) for (let d of Array.from(domain)) _pos.push((d - _min) / (_max - _min));
1813
- else {
1814
- for (let c = 0; c < k; c++) _pos.push(c / (k - 1));
1815
- if (domain.length > 2) {
1816
- const tOut = domain.map((d, i) => i / (domain.length - 1));
1817
- const tBreaks = domain.map((d) => (d - _min) / (_max - _min));
1818
- if (!tBreaks.every((val, i) => tOut[i] === val)) tMapDomain = (t) => {
1819
- if (t <= 0 || t >= 1) return t;
1820
- let i = 0;
1821
- while (t >= tBreaks[i + 1]) i++;
1822
- const f = (t - tBreaks[i]) / (tBreaks[i + 1] - tBreaks[i]);
1823
- return tOut[i] + f * (tOut[i + 1] - tOut[i]);
1824
- };
1825
- }
1826
- }
1827
- _positions = [_min, _max];
1828
- return f;
1829
- };
1830
- f.mode = function(_m) {
1831
- if (!arguments.length) return _mode;
1832
- _mode = _m;
1833
- resetCache();
1834
- return f;
1835
- };
1836
- f.range = function(colors, _pos) {
1837
- setColors(colors, _pos);
1838
- return f;
1839
- };
1840
- f.out = function(_o) {
1841
- _out = _o;
1842
- return f;
1843
- };
1844
- f.spread = function(val) {
1845
- if (!arguments.length) return _spread;
1846
- _spread = val;
1847
- return f;
1848
- };
1849
- f.correctLightness = function(v) {
1850
- if (v == null) v = true;
1851
- _correctLightness = v;
1852
- resetCache();
1853
- if (_correctLightness) tMapLightness = function(t) {
1854
- const L0 = getColor(0, true).lab()[0];
1855
- const L1 = getColor(1, true).lab()[0];
1856
- const pol = L0 > L1;
1857
- let L_actual = getColor(t, true).lab()[0];
1858
- const L_ideal = L0 + (L1 - L0) * t;
1859
- let L_diff = L_actual - L_ideal;
1860
- let t0 = 0;
1861
- let t1 = 1;
1862
- let max_iter = 20;
1863
- while (Math.abs(L_diff) > .01 && max_iter-- > 0) (function() {
1864
- if (pol) L_diff *= -1;
1865
- if (L_diff < 0) {
1866
- t0 = t;
1867
- t += (t1 - t) * .5;
1868
- } else {
1869
- t1 = t;
1870
- t += (t0 - t) * .5;
1871
- }
1872
- L_actual = getColor(t, true).lab()[0];
1873
- return L_diff = L_actual - L_ideal;
1874
- })();
1875
- return t;
1876
- };
1877
- else tMapLightness = (t) => t;
1878
- return f;
1879
- };
1880
- f.padding = function(p) {
1881
- if (p != null) {
1882
- if (type_default(p) === "number") p = [p, p];
1883
- _padding = p;
1884
- return f;
1885
- } else return _padding;
1886
- };
1887
- f.colors = function(numColors, out) {
1888
- if (arguments.length < 2) out = "hex";
1889
- let result = [];
1890
- if (arguments.length === 0) result = _colors.slice(0);
1891
- else if (numColors === 1) result = [f(.5)];
1892
- else if (numColors > 1) {
1893
- const dm = _positions[0];
1894
- const dd = _positions[1] - dm;
1895
- result = __range__(0, numColors, false).map((i) => f(dm + i / (numColors - 1) * dd));
1896
- } else {
1897
- colors = [];
1898
- let samples = [];
1899
- if (_classes && _classes.length > 2) for (let i = 1, end = _classes.length, asc = 1 <= end; asc ? i < end : i > end; asc ? i++ : i--) samples.push((_classes[i - 1] + _classes[i]) * .5);
1900
- else samples = _positions;
1901
- result = samples.map((v) => f(v));
1902
- }
1903
- if (chroma_default[out]) result = result.map((c) => c[out]());
1904
- return result;
1905
- };
1906
- f.cache = function(c) {
1907
- if (c != null) {
1908
- _useCache = c;
1909
- return f;
1910
- } else return _useCache;
1911
- };
1912
- f.gamma = function(g) {
1913
- if (g != null) {
1914
- _gamma = g;
1915
- return f;
1916
- } else return _gamma;
1917
- };
1918
- f.nodata = function(d) {
1919
- if (d != null) {
1920
- _nacol = chroma_default(d);
1921
- return f;
1922
- } else return _nacol;
1923
- };
1924
- return f;
1925
- }
1926
- function __range__(left, right, inclusive) {
1927
- let range = [];
1928
- let ascending = left < right;
1929
- let end = !inclusive ? right : ascending ? right + 1 : right - 1;
1930
- for (let i = left; ascending ? i < end : i > end; ascending ? i++ : i--) range.push(i);
1931
- return range;
1932
- }
1933
-
1934
- //#endregion
1935
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/generator/bezier.js
1936
- const binom_row = function(n) {
1937
- let row = [1, 1];
1938
- for (let i = 1; i < n; i++) {
1939
- let newrow = [1];
1940
- for (let j = 1; j <= row.length; j++) newrow[j] = (row[j] || 0) + row[j - 1];
1941
- row = newrow;
1942
- }
1943
- return row;
1944
- };
1945
- const bezier = function(colors) {
1946
- let I, lab0, lab1, lab2;
1947
- colors = colors.map((c) => new Color_default(c));
1948
- if (colors.length === 2) {
1949
- [lab0, lab1] = colors.map((c) => c.lab());
1950
- I = function(t) {
1951
- return new Color_default([
1952
- 0,
1953
- 1,
1954
- 2
1955
- ].map((i) => lab0[i] + t * (lab1[i] - lab0[i])), "lab");
1956
- };
1957
- } else if (colors.length === 3) {
1958
- [lab0, lab1, lab2] = colors.map((c) => c.lab());
1959
- I = function(t) {
1960
- return new Color_default([
1961
- 0,
1962
- 1,
1963
- 2
1964
- ].map((i) => (1 - t) * (1 - t) * lab0[i] + 2 * (1 - t) * t * lab1[i] + t * t * lab2[i]), "lab");
1965
- };
1966
- } else if (colors.length === 4) {
1967
- let lab3;
1968
- [lab0, lab1, lab2, lab3] = colors.map((c) => c.lab());
1969
- I = function(t) {
1970
- return new Color_default([
1971
- 0,
1972
- 1,
1973
- 2
1974
- ].map((i) => (1 - t) * (1 - t) * (1 - t) * lab0[i] + 3 * (1 - t) * (1 - t) * t * lab1[i] + 3 * (1 - t) * t * t * lab2[i] + t * t * t * lab3[i]), "lab");
1975
- };
1976
- } else if (colors.length >= 5) {
1977
- let labs, row, n;
1978
- labs = colors.map((c) => c.lab());
1979
- n = colors.length - 1;
1980
- row = binom_row(n);
1981
- I = function(t) {
1982
- const u = 1 - t;
1983
- return new Color_default([
1984
- 0,
1985
- 1,
1986
- 2
1987
- ].map((i) => labs.reduce((sum, el, j) => sum + row[j] * u ** (n - j) * t ** j * el[i], 0)), "lab");
1988
- };
1989
- } else throw new RangeError("No point in running bezier with only one color.");
1990
- return I;
1991
- };
1992
- var bezier_default = (colors) => {
1993
- const f = bezier(colors);
1994
- f.scale = () => scale_default(f);
1995
- return f;
1996
- };
1997
-
1998
- //#endregion
1999
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/io/rgb/index.js
2000
- const { round: round$3 } = Math;
2001
- Color_default.prototype.rgb = function(rnd = true) {
2002
- if (rnd === false) return this._rgb.slice(0, 3);
2003
- return this._rgb.slice(0, 3).map(round$3);
2004
- };
2005
- Color_default.prototype.rgba = function(rnd = true) {
2006
- return this._rgb.slice(0, 4).map((v, i) => {
2007
- return i < 3 ? rnd === false ? v : round$3(v) : v;
2008
- });
2009
- };
2010
- const rgb = (...args) => new Color_default(...args, "rgb");
2011
- Object.assign(chroma_default, { rgb });
2012
- input_default.format.rgb = (...args) => {
2013
- const rgba = unpack_default(args, "rgba");
2014
- if (rgba[3] === void 0) rgba[3] = 1;
2015
- return rgba;
2016
- };
2017
- input_default.autodetect.push({
2018
- p: 3,
2019
- test: (...args) => {
2020
- args = unpack_default(args, "rgba");
2021
- if (type_default(args) === "array" && (args.length === 3 || args.length === 4 && type_default(args[3]) == "number" && args[3] >= 0 && args[3] <= 1)) return "rgb";
2022
- }
2023
- });
2024
-
2025
- //#endregion
2026
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/generator/blend.js
2027
- const blend = (bottom, top, mode) => {
2028
- if (!blend[mode]) throw new Error("unknown blend mode " + mode);
2029
- return blend[mode](bottom, top);
2030
- };
2031
- const blend_f = (f) => (bottom, top) => {
2032
- const c0 = chroma_default(top).rgb();
2033
- const c1 = chroma_default(bottom).rgb();
2034
- return chroma_default.rgb(f(c0, c1));
2035
- };
2036
- const each = (f) => (c0, c1) => {
2037
- const out = [];
2038
- out[0] = f(c0[0], c1[0]);
2039
- out[1] = f(c0[1], c1[1]);
2040
- out[2] = f(c0[2], c1[2]);
2041
- return out;
2042
- };
2043
- const normal = (a) => a;
2044
- const multiply = (a, b) => a * b / 255;
2045
- const darken = (a, b) => a > b ? b : a;
2046
- const lighten = (a, b) => a > b ? a : b;
2047
- const screen = (a, b) => 255 * (1 - (1 - a / 255) * (1 - b / 255));
2048
- const overlay = (a, b) => b < 128 ? 2 * a * b / 255 : 255 * (1 - 2 * (1 - a / 255) * (1 - b / 255));
2049
- const burn = (a, b) => 255 * (1 - (1 - b / 255) / (a / 255));
2050
- const dodge = (a, b) => {
2051
- if (a === 255) return 255;
2052
- a = 255 * (b / 255) / (1 - a / 255);
2053
- return a > 255 ? 255 : a;
2054
- };
2055
- blend.normal = blend_f(each(normal));
2056
- blend.multiply = blend_f(each(multiply));
2057
- blend.screen = blend_f(each(screen));
2058
- blend.overlay = blend_f(each(overlay));
2059
- blend.darken = blend_f(each(darken));
2060
- blend.lighten = blend_f(each(lighten));
2061
- blend.dodge = blend_f(each(dodge));
2062
- blend.burn = blend_f(each(burn));
2063
- var blend_default = blend;
2064
-
2065
- //#endregion
2066
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/generator/cubehelix.js
2067
- const { pow: pow$2, sin: sin$1, cos: cos$1 } = Math;
2068
- function cubehelix_default(start = 300, rotations = -1.5, hue = 1, gamma = 1, lightness = [0, 1]) {
2069
- let dh = 0, dl;
2070
- if (type_default(lightness) === "array") dl = lightness[1] - lightness[0];
2071
- else {
2072
- dl = 0;
2073
- lightness = [lightness, lightness];
2074
- }
2075
- const f = function(fract) {
2076
- const a = TWOPI * ((start + 120) / 360 + rotations * fract);
2077
- const l = pow$2(lightness[0] + dl * fract, gamma);
2078
- const amp = (dh !== 0 ? hue[0] + fract * dh : hue) * l * (1 - l) / 2;
2079
- const cos_a = cos$1(a);
2080
- const sin_a = sin$1(a);
2081
- const r = l + amp * (-.14861 * cos_a + 1.78277 * sin_a);
2082
- const g = l + amp * (-.29227 * cos_a - .90649 * sin_a);
2083
- const b = l + amp * (1.97294 * cos_a);
2084
- return chroma_default(clip_rgb_default([
2085
- r * 255,
2086
- g * 255,
2087
- b * 255,
2088
- 1
2089
- ]));
2090
- };
2091
- f.start = function(s) {
2092
- if (s == null) return start;
2093
- start = s;
2094
- return f;
2095
- };
2096
- f.rotations = function(r) {
2097
- if (r == null) return rotations;
2098
- rotations = r;
2099
- return f;
2100
- };
2101
- f.gamma = function(g) {
2102
- if (g == null) return gamma;
2103
- gamma = g;
2104
- return f;
2105
- };
2106
- f.hue = function(h) {
2107
- if (h == null) return hue;
2108
- hue = h;
2109
- if (type_default(hue) === "array") {
2110
- dh = hue[1] - hue[0];
2111
- if (dh === 0) hue = hue[1];
2112
- } else dh = 0;
2113
- return f;
2114
- };
2115
- f.lightness = function(h) {
2116
- if (h == null) return lightness;
2117
- if (type_default(h) === "array") {
2118
- lightness = h;
2119
- dl = h[1] - h[0];
2120
- } else {
2121
- lightness = [h, h];
2122
- dl = 0;
2123
- }
2124
- return f;
2125
- };
2126
- f.scale = () => chroma_default.scale(f);
2127
- f.hue(hue);
2128
- return f;
2129
- }
2130
-
2131
- //#endregion
2132
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/generator/random.js
2133
- const digits = "0123456789abcdef";
2134
- const { floor: floor$1, random } = Math;
2135
- /**
2136
- * Generates a random color.
2137
- * @param {() => number} rng - A random number generator function.
2138
- */
2139
- var random_default = (rng = random) => {
2140
- let code = "#";
2141
- for (let i = 0; i < 6; i++) code += digits.charAt(floor$1(rng() * 16));
2142
- return new Color_default(code, "hex");
2143
- };
2144
-
2145
- //#endregion
2146
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/utils/analyze.js
2147
- const { log: log$1, pow: pow$1, floor, abs: abs$1 } = Math;
2148
- function analyze(data, key = null) {
2149
- const r = {
2150
- min: Number.MAX_VALUE,
2151
- max: Number.MAX_VALUE * -1,
2152
- sum: 0,
2153
- values: [],
2154
- count: 0
2155
- };
2156
- if (type_default(data) === "object") data = Object.values(data);
2157
- data.forEach((val) => {
2158
- if (key && type_default(val) === "object") val = val[key];
2159
- if (val !== void 0 && val !== null && !isNaN(val)) {
2160
- r.values.push(val);
2161
- r.sum += val;
2162
- if (val < r.min) r.min = val;
2163
- if (val > r.max) r.max = val;
2164
- r.count += 1;
2165
- }
2166
- });
2167
- r.domain = [r.min, r.max];
2168
- r.limits = (mode, num) => limits(r, mode, num);
2169
- return r;
2170
- }
2171
- function limits(data, mode = "equal", num = 7) {
2172
- if (type_default(data) == "array") data = analyze(data);
2173
- const { min, max } = data;
2174
- const values = data.values.sort((a, b) => a - b);
2175
- if (num === 1) return [min, max];
2176
- const limits = [];
2177
- if (mode.substr(0, 1) === "c") {
2178
- limits.push(min);
2179
- limits.push(max);
2180
- }
2181
- if (mode.substr(0, 1) === "e") {
2182
- limits.push(min);
2183
- for (let i = 1; i < num; i++) limits.push(min + i / num * (max - min));
2184
- limits.push(max);
2185
- } else if (mode.substr(0, 1) === "l") {
2186
- if (min <= 0) throw new Error("Logarithmic scales are only possible for values > 0");
2187
- const min_log = Math.LOG10E * log$1(min);
2188
- const max_log = Math.LOG10E * log$1(max);
2189
- limits.push(min);
2190
- for (let i = 1; i < num; i++) limits.push(pow$1(10, min_log + i / num * (max_log - min_log)));
2191
- limits.push(max);
2192
- } else if (mode.substr(0, 1) === "q") {
2193
- limits.push(min);
2194
- for (let i = 1; i < num; i++) {
2195
- const p = (values.length - 1) * i / num;
2196
- const pb = floor(p);
2197
- if (pb === p) limits.push(values[pb]);
2198
- else {
2199
- const pr = p - pb;
2200
- limits.push(values[pb] * (1 - pr) + values[pb + 1] * pr);
2201
- }
2202
- }
2203
- limits.push(max);
2204
- } else if (mode.substr(0, 1) === "k") {
2205
- let cluster;
2206
- const n = values.length;
2207
- const assignments = new Array(n);
2208
- const clusterSizes = new Array(num);
2209
- let repeat = true;
2210
- let nb_iters = 0;
2211
- let centroids = null;
2212
- centroids = [];
2213
- centroids.push(min);
2214
- for (let i = 1; i < num; i++) centroids.push(min + i / num * (max - min));
2215
- centroids.push(max);
2216
- while (repeat) {
2217
- for (let j = 0; j < num; j++) clusterSizes[j] = 0;
2218
- for (let i = 0; i < n; i++) {
2219
- const value = values[i];
2220
- let mindist = Number.MAX_VALUE;
2221
- let best;
2222
- for (let j = 0; j < num; j++) {
2223
- const dist = abs$1(centroids[j] - value);
2224
- if (dist < mindist) {
2225
- mindist = dist;
2226
- best = j;
2227
- }
2228
- clusterSizes[best]++;
2229
- assignments[i] = best;
2230
- }
2231
- }
2232
- const newCentroids = new Array(num);
2233
- for (let j = 0; j < num; j++) newCentroids[j] = null;
2234
- for (let i = 0; i < n; i++) {
2235
- cluster = assignments[i];
2236
- if (newCentroids[cluster] === null) newCentroids[cluster] = values[i];
2237
- else newCentroids[cluster] += values[i];
2238
- }
2239
- for (let j = 0; j < num; j++) newCentroids[j] *= 1 / clusterSizes[j];
2240
- repeat = false;
2241
- for (let j = 0; j < num; j++) if (newCentroids[j] !== centroids[j]) {
2242
- repeat = true;
2243
- break;
2244
- }
2245
- centroids = newCentroids;
2246
- nb_iters++;
2247
- if (nb_iters > 200) repeat = false;
2248
- }
2249
- const kClusters = {};
2250
- for (let j = 0; j < num; j++) kClusters[j] = [];
2251
- for (let i = 0; i < n; i++) {
2252
- cluster = assignments[i];
2253
- kClusters[cluster].push(values[i]);
2254
- }
2255
- let tmpKMeansBreaks = [];
2256
- for (let j = 0; j < num; j++) {
2257
- tmpKMeansBreaks.push(kClusters[j][0]);
2258
- tmpKMeansBreaks.push(kClusters[j][kClusters[j].length - 1]);
2259
- }
2260
- tmpKMeansBreaks = tmpKMeansBreaks.sort((a, b) => a - b);
2261
- limits.push(tmpKMeansBreaks[0]);
2262
- for (let i = 1; i < tmpKMeansBreaks.length; i += 2) {
2263
- const v = tmpKMeansBreaks[i];
2264
- if (!isNaN(v) && limits.indexOf(v) === -1) limits.push(v);
2265
- }
2266
- }
2267
- return limits;
2268
- }
2269
-
2270
- //#endregion
2271
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/utils/contrast.js
2272
- var contrast_default = (a, b) => {
2273
- a = new Color_default(a);
2274
- b = new Color_default(b);
2275
- const l1 = a.luminance();
2276
- const l2 = b.luminance();
2277
- return l1 > l2 ? (l1 + .05) / (l2 + .05) : (l2 + .05) / (l1 + .05);
2278
- };
2279
-
2280
- //#endregion
2281
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/utils/contrastAPCA.js
1
+ const{min:min$4,max:max$4}=Math;var limit_default=(n,r=0,i=1)=>min$4(max$4(r,n),i),clip_rgb_default=e=>{e._clipped=!1,e._unclipped=e.slice(0);for(let t=0;t<=3;t++)t<3?((e[t]<0||e[t]>255)&&(e._clipped=!0),e[t]=limit_default(e[t],0,255)):t===3&&(e[t]=limit_default(e[t],0,1));return e};const classToType={};for(let e of[`Boolean`,`Number`,`String`,`Function`,`Array`,`Date`,`RegExp`,`Undefined`,`Null`])classToType[`[object ${e}]`]=e.toLowerCase();function type_default(e){return classToType[Object.prototype.toString.call(e)]||`object`}var unpack_default=(e,t=null)=>e.length>=3?Array.prototype.slice.call(e):type_default(e[0])==`object`&&t?t.split(``).filter(t=>e[0][t]!==void 0).map(t=>e[0][t]):e[0].slice(0),last_default=e=>{if(e.length<2)return null;let t=e.length-1;return type_default(e[t])==`string`?e[t].toLowerCase():null};const{PI:PI$2,min:min$3,max:max$3}=Math,rnd2=e=>Math.round(e*100)/100,rnd3=e=>Math.round(e*100)/100,TWOPI=PI$2*2,PITHIRD=PI$2/3,DEG2RAD=PI$2/180,RAD2DEG=180/PI$2;function reverse3(e){return[...e.slice(0,3).reverse(),...e.slice(3)]}var input_default={format:{},autodetect:[]},Color=class{constructor(...e){let t=this;if(type_default(e[0])===`object`&&e[0].constructor&&e[0].constructor===this.constructor)return e[0];let n=last_default(e),i=!1;if(!n){i=!0,input_default.sorted||=(input_default.autodetect=input_default.autodetect.sort((e,t)=>t.p-e.p),!0);for(let t of input_default.autodetect)if(n=t.test(...e),n)break}if(input_default.format[n])t._rgb=clip_rgb_default(input_default.format[n].apply(null,i?e:e.slice(0,-1)));else throw Error(`unknown format: `+e);t._rgb.length===3&&t._rgb.push(1)}toString(){return type_default(this.hex)==`function`?this.hex():`[${this._rgb.join(`,`)}]`}};const chroma=(...e)=>new Color(...e);chroma.version=`3.2.0`;const w3cx11={aliceblue:`#f0f8ff`,antiquewhite:`#faebd7`,aqua:`#00ffff`,aquamarine:`#7fffd4`,azure:`#f0ffff`,beige:`#f5f5dc`,bisque:`#ffe4c4`,black:`#000000`,blanchedalmond:`#ffebcd`,blue:`#0000ff`,blueviolet:`#8a2be2`,brown:`#a52a2a`,burlywood:`#deb887`,cadetblue:`#5f9ea0`,chartreuse:`#7fff00`,chocolate:`#d2691e`,coral:`#ff7f50`,cornflowerblue:`#6495ed`,cornsilk:`#fff8dc`,crimson:`#dc143c`,cyan:`#00ffff`,darkblue:`#00008b`,darkcyan:`#008b8b`,darkgoldenrod:`#b8860b`,darkgray:`#a9a9a9`,darkgreen:`#006400`,darkgrey:`#a9a9a9`,darkkhaki:`#bdb76b`,darkmagenta:`#8b008b`,darkolivegreen:`#556b2f`,darkorange:`#ff8c00`,darkorchid:`#9932cc`,darkred:`#8b0000`,darksalmon:`#e9967a`,darkseagreen:`#8fbc8f`,darkslateblue:`#483d8b`,darkslategray:`#2f4f4f`,darkslategrey:`#2f4f4f`,darkturquoise:`#00ced1`,darkviolet:`#9400d3`,deeppink:`#ff1493`,deepskyblue:`#00bfff`,dimgray:`#696969`,dimgrey:`#696969`,dodgerblue:`#1e90ff`,firebrick:`#b22222`,floralwhite:`#fffaf0`,forestgreen:`#228b22`,fuchsia:`#ff00ff`,gainsboro:`#dcdcdc`,ghostwhite:`#f8f8ff`,gold:`#ffd700`,goldenrod:`#daa520`,gray:`#808080`,green:`#008000`,greenyellow:`#adff2f`,grey:`#808080`,honeydew:`#f0fff0`,hotpink:`#ff69b4`,indianred:`#cd5c5c`,indigo:`#4b0082`,ivory:`#fffff0`,khaki:`#f0e68c`,laserlemon:`#ffff54`,lavender:`#e6e6fa`,lavenderblush:`#fff0f5`,lawngreen:`#7cfc00`,lemonchiffon:`#fffacd`,lightblue:`#add8e6`,lightcoral:`#f08080`,lightcyan:`#e0ffff`,lightgoldenrod:`#fafad2`,lightgoldenrodyellow:`#fafad2`,lightgray:`#d3d3d3`,lightgreen:`#90ee90`,lightgrey:`#d3d3d3`,lightpink:`#ffb6c1`,lightsalmon:`#ffa07a`,lightseagreen:`#20b2aa`,lightskyblue:`#87cefa`,lightslategray:`#778899`,lightslategrey:`#778899`,lightsteelblue:`#b0c4de`,lightyellow:`#ffffe0`,lime:`#00ff00`,limegreen:`#32cd32`,linen:`#faf0e6`,magenta:`#ff00ff`,maroon:`#800000`,maroon2:`#7f0000`,maroon3:`#b03060`,mediumaquamarine:`#66cdaa`,mediumblue:`#0000cd`,mediumorchid:`#ba55d3`,mediumpurple:`#9370db`,mediumseagreen:`#3cb371`,mediumslateblue:`#7b68ee`,mediumspringgreen:`#00fa9a`,mediumturquoise:`#48d1cc`,mediumvioletred:`#c71585`,midnightblue:`#191970`,mintcream:`#f5fffa`,mistyrose:`#ffe4e1`,moccasin:`#ffe4b5`,navajowhite:`#ffdead`,navy:`#000080`,oldlace:`#fdf5e6`,olive:`#808000`,olivedrab:`#6b8e23`,orange:`#ffa500`,orangered:`#ff4500`,orchid:`#da70d6`,palegoldenrod:`#eee8aa`,palegreen:`#98fb98`,paleturquoise:`#afeeee`,palevioletred:`#db7093`,papayawhip:`#ffefd5`,peachpuff:`#ffdab9`,peru:`#cd853f`,pink:`#ffc0cb`,plum:`#dda0dd`,powderblue:`#b0e0e6`,purple:`#800080`,purple2:`#7f007f`,purple3:`#a020f0`,rebeccapurple:`#663399`,red:`#ff0000`,rosybrown:`#bc8f8f`,royalblue:`#4169e1`,saddlebrown:`#8b4513`,salmon:`#fa8072`,sandybrown:`#f4a460`,seagreen:`#2e8b57`,seashell:`#fff5ee`,sienna:`#a0522d`,silver:`#c0c0c0`,skyblue:`#87ceeb`,slateblue:`#6a5acd`,slategray:`#708090`,slategrey:`#708090`,snow:`#fffafa`,springgreen:`#00ff7f`,steelblue:`#4682b4`,tan:`#d2b48c`,teal:`#008080`,thistle:`#d8bfd8`,tomato:`#ff6347`,turquoise:`#40e0d0`,violet:`#ee82ee`,wheat:`#f5deb3`,white:`#ffffff`,whitesmoke:`#f5f5f5`,yellow:`#ffff00`,yellowgreen:`#9acd32`},RE_HEX=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,RE_HEXA=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,hex2rgb=e=>{if(e.match(RE_HEX)){(e.length===4||e.length===7)&&(e=e.substr(1)),e.length===3&&(e=e.split(``),e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);let t=parseInt(e,16);return[t>>16,t>>8&255,t&255,1]}if(e.match(RE_HEXA)){(e.length===5||e.length===9)&&(e=e.substr(1)),e.length===4&&(e=e.split(``),e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]);let t=parseInt(e,16);return[t>>24&255,t>>16&255,t>>8&255,Math.round((t&255)/255*100)/100]}throw Error(`unknown hex color: ${e}`)},{round:round$5}=Math,rgb2hex=(...e)=>{let[t,n,r,i]=unpack_default(e,`rgba`),a=last_default(e)||`auto`;i===void 0&&(i=1),a===`auto`&&(a=i<1?`rgba`:`rgb`),t=round$5(t),n=round$5(n),r=round$5(r);let c=`000000`+(t<<16|n<<8|r).toString(16);c=c.substr(c.length-6);let l=`0`+round$5(i*255).toString(16);switch(l=l.substr(l.length-2),a.toLowerCase()){case`rgba`:return`#${c}${l}`;case`argb`:return`#${l}${c}`;default:return`#${c}`}};Color.prototype.name=function(){let e=rgb2hex(this._rgb,`rgb`);for(let t of Object.keys(w3cx11))if(w3cx11[t]===e)return t.toLowerCase();return e},input_default.format.named=e=>{if(e=e.toLowerCase(),w3cx11[e])return hex2rgb(w3cx11[e]);throw Error(`unknown color name: `+e)},input_default.autodetect.push({p:5,test:(e,...t)=>{if(!t.length&&type_default(e)===`string`&&w3cx11[e.toLowerCase()])return`named`}}),Color.prototype.alpha=function(e,t=!1){return e!==void 0&&type_default(e)===`number`?t?(this._rgb[3]=e,this):new Color([this._rgb[0],this._rgb[1],this._rgb[2],e],`rgb`):this._rgb[3]},Color.prototype.clipped=function(){return this._rgb._clipped||!1};const labConstants={Kn:18,labWhitePoint:`d65`,Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452,kE:216/24389,kKE:8,kK:24389/27,RefWhiteRGB:{X:.95047,Y:1,Z:1.08883},MtxRGB2XYZ:{m00:.4124564390896922,m01:.21267285140562253,m02:.0193338955823293,m10:.357576077643909,m11:.715152155287818,m12:.11919202588130297,m20:.18043748326639894,m21:.07217499330655958,m22:.9503040785363679},MtxXYZ2RGB:{m00:3.2404541621141045,m01:-.9692660305051868,m02:.055643430959114726,m10:-1.5371385127977166,m11:1.8760108454466942,m12:-.2040259135167538,m20:-.498531409556016,m21:.041556017530349834,m22:1.0572251882231791},As:.9414285350000001,Bs:1.040417467,Cs:1.089532651,MtxAdaptMa:{m00:.8951,m01:-.7502,m02:.0389,m10:.2664,m11:1.7135,m12:-.0685,m20:-.1614,m21:.0367,m22:1.0296},MtxAdaptMaI:{m00:.9869929054667123,m01:.43230526972339456,m02:-.008528664575177328,m10:-.14705425642099013,m11:.5183602715367776,m12:.04004282165408487,m20:.15996265166373125,m21:.0492912282128556,m22:.9684866957875502}},ILLUMINANTS=new Map([[`a`,[1.0985,.35585]],[`b`,[1.0985,.35585]],[`c`,[.98074,1.18232]],[`d50`,[.96422,.82521]],[`d55`,[.95682,.92149]],[`d65`,[.95047,1.08883]],[`e`,[1,1,1]],[`f2`,[.99186,.67393]],[`f7`,[.95041,1.08747]],[`f11`,[1.00962,.6435]],[`icc`,[.96422,.82521]]]);function setLabWhitePoint(e){let t=ILLUMINANTS.get(String(e).toLowerCase());if(!t)throw Error(`unknown Lab illuminant `+e);labConstants.labWhitePoint=e,labConstants.Xn=t[0],labConstants.Zn=t[1]}function getLabWhitePoint(){return labConstants.labWhitePoint}const lab2rgb=(...e)=>{e=unpack_default(e,`lab`);let[t,n,r]=e,[i,a,s]=lab2xyz(t,n,r),[c,l,u]=xyz2rgb(i,a,s);return[c,l,u,e.length>3?e[3]:1]},lab2xyz=(e,t,n)=>{let{kE:r,kK:i,kKE:a,Xn:o,Yn:s,Zn:c}=labConstants,l=(e+16)/116,u=.002*t+l,d=l-.005*n,f=u*u*u,p=d*d*d,m=f>r?f:(116*u-16)/i,h=e>a?((e+16)/116)**3:e/i,g=p>r?p:(116*d-16)/i;return[m*o,h*s,g*c]},compand=e=>{let t=Math.sign(e);return e=Math.abs(e),(e<=.0031308?e*12.92:1.055*e**(1/2.4)-.055)*t},xyz2rgb=(e,t,n)=>{let{MtxAdaptMa:r,MtxAdaptMaI:i,MtxXYZ2RGB:a,RefWhiteRGB:o,Xn:s,Yn:c,Zn:l}=labConstants,u=s*r.m00+c*r.m10+l*r.m20,d=s*r.m01+c*r.m11+l*r.m21,f=s*r.m02+c*r.m12+l*r.m22,p=o.X*r.m00+o.Y*r.m10+o.Z*r.m20,m=o.X*r.m01+o.Y*r.m11+o.Z*r.m21,h=o.X*r.m02+o.Y*r.m12+o.Z*r.m22,g=(e*r.m00+t*r.m10+n*r.m20)*(p/u),_=(e*r.m01+t*r.m11+n*r.m21)*(m/d),v=(e*r.m02+t*r.m12+n*r.m22)*(h/f),y=g*i.m00+_*i.m10+v*i.m20,b=g*i.m01+_*i.m11+v*i.m21,x=g*i.m02+_*i.m12+v*i.m22,S=compand(y*a.m00+b*a.m10+x*a.m20),C=compand(y*a.m01+b*a.m11+x*a.m21),w=compand(y*a.m02+b*a.m12+x*a.m22);return[S*255,C*255,w*255]},rgb2lab=(...e)=>{let[t,n,r,...i]=unpack_default(e,`rgb`),[a,s,c]=rgb2xyz(t,n,r),[l,u,d]=xyz2lab(a,s,c);return[l,u,d,...i.length>0&&i[0]<1?[i[0]]:[]]};function xyz2lab(e,t,n){let{Xn:r,Yn:i,Zn:a,kE:o,kK:s}=labConstants,c=e/r,l=t/i,u=n/a,d=c>o?c**(1/3):(s*c+16)/116,f=l>o?l**(1/3):(s*l+16)/116,p=u>o?u**(1/3):(s*u+16)/116;return[116*f-16,500*(d-f),200*(f-p)]}function gammaAdjustSRGB(e){let t=Math.sign(e);return e=Math.abs(e),(e<=.04045?e/12.92:((e+.055)/1.055)**2.4)*t}const rgb2xyz=(e,t,n)=>{e=gammaAdjustSRGB(e/255),t=gammaAdjustSRGB(t/255),n=gammaAdjustSRGB(n/255);let{MtxRGB2XYZ:r,MtxAdaptMa:i,MtxAdaptMaI:a,Xn:o,Yn:s,Zn:c,As:l,Bs:u,Cs:d}=labConstants,f=e*r.m00+t*r.m10+n*r.m20,p=e*r.m01+t*r.m11+n*r.m21,m=e*r.m02+t*r.m12+n*r.m22,h=o*i.m00+s*i.m10+c*i.m20,g=o*i.m01+s*i.m11+c*i.m21,_=o*i.m02+s*i.m12+c*i.m22,v=f*i.m00+p*i.m10+m*i.m20,y=f*i.m01+p*i.m11+m*i.m21,b=f*i.m02+p*i.m12+m*i.m22;return v*=h/l,y*=g/u,b*=_/d,f=v*a.m00+y*a.m10+b*a.m20,p=v*a.m01+y*a.m11+b*a.m21,m=v*a.m02+y*a.m12+b*a.m22,[f,p,m]};Color.prototype.lab=function(){return rgb2lab(this._rgb)};const lab$1=(...e)=>new Color(...e,`lab`);Object.assign(chroma,{lab:lab$1,getLabWhitePoint,setLabWhitePoint}),input_default.format.lab=lab2rgb,input_default.autodetect.push({p:2,test:(...e)=>{if(e=unpack_default(e,`lab`),type_default(e)===`array`&&e.length===3)return`lab`}}),Color.prototype.darken=function(e=1){let t=this,n=t.lab();return n[0]-=labConstants.Kn*e,new Color(n,`lab`).alpha(t.alpha(),!0)},Color.prototype.brighten=function(e=1){return this.darken(-e)},Color.prototype.darker=Color.prototype.darken,Color.prototype.brighter=Color.prototype.brighten,Color.prototype.get=function(e){let[t,n]=e.split(`.`),r=this[t]();if(n){let e=t.indexOf(n)-(t.substr(0,2)===`ok`?2:0);if(e>-1)return r[e];throw Error(`unknown channel ${n} in mode ${t}`)}else return r};const{pow:pow$6}=Math;Color.prototype.luminance=function(e,t=`rgb`){if(e!==void 0&&type_default(e)===`number`){if(e===0)return new Color([0,0,0,this._rgb[3]],`rgb`);if(e===1)return new Color([255,255,255,this._rgb[3]],`rgb`);let n=this.luminance(),r=20,i=(n,a)=>{let o=n.interpolate(a,.5,t),s=o.luminance();return Math.abs(e-s)<1e-7||!r--?o:s>e?i(n,o):i(o,a)};return new Color([...(n>e?i(new Color([0,0,0]),this):i(this,new Color([255,255,255]))).rgb(),this._rgb[3]])}return rgb2luminance(...this._rgb.slice(0,3))};const rgb2luminance=(e,t,n)=>(e=luminance_x(e),t=luminance_x(t),n=luminance_x(n),.2126*e+.7152*t+.0722*n),luminance_x=e=>(e/=255,e<=.03928?e/12.92:pow$6((e+.055)/1.055,2.4));var interpolator_default={},mix_default=(e,t,n=.5,...r)=>{let i=r[0]||`lrgb`;if(!interpolator_default[i]&&!r.length&&(i=Object.keys(interpolator_default)[0]),!interpolator_default[i])throw Error(`interpolation mode ${i} is not defined`);return type_default(e)!==`object`&&(e=new Color(e)),type_default(t)!==`object`&&(t=new Color(t)),interpolator_default[i](e,t,n).alpha(e.alpha()+n*(t.alpha()-e.alpha()))};Color.prototype.mix=Color.prototype.interpolate=function(e,t=.5,...n){return mix_default(this,e,t,...n)},Color.prototype.premultiply=function(e=!1){let t=this._rgb,n=t[3];return e?(this._rgb=[t[0]*n,t[1]*n,t[2]*n,n],this):new Color([t[0]*n,t[1]*n,t[2]*n,n],`rgb`)};const{sin:sin$3,cos:cos$4}=Math,lch2lab=(...e)=>{let[t,n,r]=unpack_default(e,`lch`);return isNaN(r)&&(r=0),r*=DEG2RAD,[t,cos$4(r)*n,sin$3(r)*n]},lch2rgb=(...e)=>{e=unpack_default(e,`lch`);let[t,n,r]=e,[i,a,s]=lch2lab(t,n,r),[c,l,u]=lab2rgb(i,a,s);return[c,l,u,e.length>3?e[3]:1]},hcl2rgb=(...e)=>lch2rgb(...reverse3(unpack_default(e,`hcl`))),{sqrt:sqrt$4,atan2:atan2$2,round:round$4}=Math,lab2lch=(...e)=>{let[t,n,r]=unpack_default(e,`lab`),i=sqrt$4(n*n+r*r),a=(atan2$2(r,n)*RAD2DEG+360)%360;return round$4(i*1e4)===0&&(a=NaN),[t,i,a]},rgb2lch=(...e)=>{let[t,n,r,...i]=unpack_default(e,`rgb`),[a,s,c]=rgb2lab(t,n,r),[l,u,d]=lab2lch(a,s,c);return[l,u,d,...i.length>0&&i[0]<1?[i[0]]:[]]};Color.prototype.lch=function(){return rgb2lch(this._rgb)},Color.prototype.hcl=function(){return reverse3(rgb2lch(this._rgb))};const lch$1=(...e)=>new Color(...e,`lch`),hcl=(...e)=>new Color(...e,`hcl`);Object.assign(chroma,{lch:lch$1,hcl}),input_default.format.lch=lch2rgb,input_default.format.hcl=hcl2rgb,[`lch`,`hcl`].forEach(e=>input_default.autodetect.push({p:2,test:(...t)=>{if(t=unpack_default(t,e),type_default(t)===`array`&&t.length===3)return e}})),Color.prototype.saturate=function(e=1){let t=this,n=t.lch();return n[1]+=labConstants.Kn*e,n[1]<0&&(n[1]=0),new Color(n,`lch`).alpha(t.alpha(),!0)},Color.prototype.desaturate=function(e=1){return this.saturate(-e)},Color.prototype.set=function(e,t,n=!1){let[r,i]=e.split(`.`),o=this[r]();if(i){let e=r.indexOf(i)-(r.substr(0,2)===`ok`?2:0);if(e>-1){if(type_default(t)==`string`)switch(t.charAt(0)){case`+`:o[e]+=+t;break;case`-`:o[e]+=+t;break;case`*`:o[e]*=+t.substr(1);break;case`/`:o[e]/=+t.substr(1);break;default:o[e]=+t}else if(type_default(t)===`number`)o[e]=t;else throw Error(`unsupported value for Color.set`);let i=new Color(o,r);return n?(this._rgb=i._rgb,this):i}throw Error(`unknown channel ${i} in mode ${r}`)}else return o},Color.prototype.tint=function(e=.5,...t){return mix_default(this,`white`,e,...t)},Color.prototype.shade=function(e=.5,...t){return mix_default(this,`black`,e,...t)};const rgb$1=(e,t,n)=>{let r=e._rgb,i=t._rgb;return new Color(r[0]+n*(i[0]-r[0]),r[1]+n*(i[1]-r[1]),r[2]+n*(i[2]-r[2]),`rgb`)};interpolator_default.rgb=rgb$1;const{sqrt:sqrt$3,pow:pow$5}=Math,lrgb=(e,t,n)=>{let[r,i,a]=e._rgb,[o,s,c]=t._rgb;return new Color(sqrt$3(pow$5(r,2)*(1-n)+pow$5(o,2)*n),sqrt$3(pow$5(i,2)*(1-n)+pow$5(s,2)*n),sqrt$3(pow$5(a,2)*(1-n)+pow$5(c,2)*n),`rgb`)};interpolator_default.lrgb=lrgb;const lab=(e,t,n)=>{let r=e.lab(),i=t.lab();return new Color(r[0]+n*(i[0]-r[0]),r[1]+n*(i[1]-r[1]),r[2]+n*(i[2]-r[2]),`lab`)};interpolator_default.lab=lab;var _hsx_default=(e,t,n,r)=>{let i,a;r===`hsl`?(i=e.hsl(),a=t.hsl()):r===`hsv`?(i=e.hsv(),a=t.hsv()):r===`hcg`?(i=e.hcg(),a=t.hcg()):r===`hsi`?(i=e.hsi(),a=t.hsi()):r===`lch`||r===`hcl`?(r=`hcl`,i=e.hcl(),a=t.hcl()):r===`oklch`&&(i=e.oklch().reverse(),a=t.oklch().reverse());let o,s,c,l,u,d;(r.substr(0,1)===`h`||r===`oklch`)&&([o,c,u]=i,[s,l,d]=a);let f,p,m,h;return!isNaN(o)&&!isNaN(s)?(h=s>o&&s-o>180?s-(o+360):s<o&&o-s>180?s+360-o:s-o,p=o+n*h):isNaN(o)?isNaN(s)?p=NaN:(p=s,(u==1||u==0)&&r!=`hsv`&&(f=l)):(p=o,(d==1||d==0)&&r!=`hsv`&&(f=c)),f===void 0&&(f=c+n*(l-c)),m=u+n*(d-u),r===`oklch`?new Color([m,f,p],r):new Color([p,f,m],r)};const lch=(e,t,n)=>_hsx_default(e,t,n,`lch`);interpolator_default.lch=lch,interpolator_default.hcl=lch;const num2rgb=e=>{if(type_default(e)==`number`&&e>=0&&e<=16777215)return[e>>16,e>>8&255,e&255,1];throw Error(`unknown num color: `+e)},rgb2num=(...e)=>{let[t,n,r]=unpack_default(e,`rgb`);return(t<<16)+(n<<8)+r};Color.prototype.num=function(){return rgb2num(this._rgb)};const num$1=(...e)=>new Color(...e,`num`);Object.assign(chroma,{num:num$1}),input_default.format.num=num2rgb,input_default.autodetect.push({p:5,test:(...e)=>{if(e.length===1&&type_default(e[0])===`number`&&e[0]>=0&&e[0]<=16777215)return`num`}});const num=(e,t,n)=>{let r=e.num();return new Color(r+n*(t.num()-r),`num`)};interpolator_default.num=num;const{floor:floor$3}=Math,hcg2rgb=(...e)=>{e=unpack_default(e,`hcg`);let[t,n,r]=e,i,a,s;r*=255;let c=n*255;if(n===0)i=a=s=r;else{t===360&&(t=0),t>360&&(t-=360),t<0&&(t+=360),t/=60;let e=floor$3(t),o=t-e,l=r*(1-n),u=l+c*(1-o),d=l+c*o,f=l+c;switch(e){case 0:[i,a,s]=[f,d,l];break;case 1:[i,a,s]=[u,f,l];break;case 2:[i,a,s]=[l,f,d];break;case 3:[i,a,s]=[l,u,f];break;case 4:[i,a,s]=[d,l,f];break;case 5:[i,a,s]=[f,l,u];break}}return[i,a,s,e.length>3?e[3]:1]},rgb2hcg=(...e)=>{let[t,n,r]=unpack_default(e,`rgb`),i=min$3(t,n,r),a=max$3(t,n,r),s=a-i,c=s*100/255,d=i/(255-s)*100,f;return s===0?f=NaN:(t===a&&(f=(n-r)/s),n===a&&(f=2+(r-t)/s),r===a&&(f=4+(t-n)/s),f*=60,f<0&&(f+=360)),[f,c,d]};Color.prototype.hcg=function(){return rgb2hcg(this._rgb)};const hcg$1=(...e)=>new Color(...e,`hcg`);chroma.hcg=hcg$1,input_default.format.hcg=hcg2rgb,input_default.autodetect.push({p:1,test:(...e)=>{if(e=unpack_default(e,`hcg`),type_default(e)===`array`&&e.length===3)return`hcg`}});const hcg=(e,t,n)=>_hsx_default(e,t,n,`hcg`);interpolator_default.hcg=hcg;const{cos:cos$3}=Math,hsi2rgb=(...e)=>{e=unpack_default(e,`hsi`);let[t,r,i]=e,a,s,c;return isNaN(t)&&(t=0),isNaN(r)&&(r=0),t>360&&(t-=360),t<0&&(t+=360),t/=360,t<1/3?(c=(1-r)/3,a=(1+r*cos$3(TWOPI*t)/cos$3(PITHIRD-TWOPI*t))/3,s=1-(c+a)):t<2/3?(t-=1/3,a=(1-r)/3,s=(1+r*cos$3(TWOPI*t)/cos$3(PITHIRD-TWOPI*t))/3,c=1-(a+s)):(t-=2/3,s=(1-r)/3,c=(1+r*cos$3(TWOPI*t)/cos$3(PITHIRD-TWOPI*t))/3,a=1-(s+c)),a=limit_default(i*a*3),s=limit_default(i*s*3),c=limit_default(i*c*3),[a*255,s*255,c*255,e.length>3?e[3]:1]},{min:min$2,sqrt:sqrt$2,acos}=Math,rgb2hsi=(...e)=>{let[t,n,r]=unpack_default(e,`rgb`);t/=255,n/=255,r/=255;let i,a=min$2(t,n,r),s=(t+n+r)/3,c=s>0?1-a/s:0;return c===0?i=NaN:(i=(t-n+(t-r))/2,i/=sqrt$2((t-n)*(t-n)+(t-r)*(n-r)),i=acos(i),r>n&&(i=TWOPI-i),i/=TWOPI),[i*360,c,s]};Color.prototype.hsi=function(){return rgb2hsi(this._rgb)};const hsi$1=(...e)=>new Color(...e,`hsi`);chroma.hsi=hsi$1,input_default.format.hsi=hsi2rgb,input_default.autodetect.push({p:2,test:(...e)=>{if(e=unpack_default(e,`hsi`),type_default(e)===`array`&&e.length===3)return`hsi`}});const hsi=(e,t,n)=>_hsx_default(e,t,n,`hsi`);interpolator_default.hsi=hsi;const hsl2rgb=(...e)=>{e=unpack_default(e,`hsl`);let[t,n,r]=e,i,a,s;if(n===0)i=a=s=r*255;else{let e=[0,0,0],o=[0,0,0],c=r<.5?r*(1+n):r+n-r*n,l=2*r-c,u=t/360;e[0]=u+1/3,e[1]=u,e[2]=u-1/3;for(let t=0;t<3;t++)e[t]<0&&(e[t]+=1),e[t]>1&&--e[t],6*e[t]<1?o[t]=l+(c-l)*6*e[t]:2*e[t]<1?o[t]=c:3*e[t]<2?o[t]=l+(c-l)*(2/3-e[t])*6:o[t]=l;[i,a,s]=[o[0]*255,o[1]*255,o[2]*255]}return e.length>3?[i,a,s,e[3]]:[i,a,s,1]},rgb2hsl$1=(...e)=>{e=unpack_default(e,`rgba`);let[t,n,r]=e;t/=255,n/=255,r/=255;let i=min$3(t,n,r),a=max$3(t,n,r),s=(a+i)/2,c,d;return a===i?(c=0,d=NaN):c=s<.5?(a-i)/(a+i):(a-i)/(2-a-i),t==a?d=(n-r)/(a-i):n==a?d=2+(r-t)/(a-i):r==a&&(d=4+(t-n)/(a-i)),d*=60,d<0&&(d+=360),e.length>3&&e[3]!==void 0?[d,c,s,e[3]]:[d,c,s]};Color.prototype.hsl=function(){return rgb2hsl$1(this._rgb)};const hsl$1=(...e)=>new Color(...e,`hsl`);chroma.hsl=hsl$1,input_default.format.hsl=hsl2rgb,input_default.autodetect.push({p:2,test:(...e)=>{if(e=unpack_default(e,`hsl`),type_default(e)===`array`&&e.length===3)return`hsl`}});const hsl=(e,t,n)=>_hsx_default(e,t,n,`hsl`);interpolator_default.hsl=hsl;const{floor:floor$2}=Math,hsv2rgb=(...e)=>{e=unpack_default(e,`hsv`);let[t,n,r]=e,i,a,s;if(r*=255,n===0)i=a=s=r;else{t===360&&(t=0),t>360&&(t-=360),t<0&&(t+=360),t/=60;let e=floor$2(t),o=t-e,c=r*(1-n),l=r*(1-n*o),u=r*(1-n*(1-o));switch(e){case 0:[i,a,s]=[r,u,c];break;case 1:[i,a,s]=[l,r,c];break;case 2:[i,a,s]=[c,r,u];break;case 3:[i,a,s]=[c,l,r];break;case 4:[i,a,s]=[u,c,r];break;case 5:[i,a,s]=[r,c,l];break}}return[i,a,s,e.length>3?e[3]:1]},{min:min$1,max:max$2}=Math,rgb2hsl=(...e)=>{e=unpack_default(e,`rgb`);let[t,n,r]=e,i=min$1(t,n,r),a=max$2(t,n,r),s=a-i,c,l,u;return u=a/255,a===0?(c=NaN,l=0):(l=s/a,t===a&&(c=(n-r)/s),n===a&&(c=2+(r-t)/s),r===a&&(c=4+(t-n)/s),c*=60,c<0&&(c+=360)),[c,l,u]};Color.prototype.hsv=function(){return rgb2hsl(this._rgb)};const hsv$1=(...e)=>new Color(...e,`hsv`);chroma.hsv=hsv$1,input_default.format.hsv=hsv2rgb,input_default.autodetect.push({p:2,test:(...e)=>{if(e=unpack_default(e,`hsv`),type_default(e)===`array`&&e.length===3)return`hsv`}});const hsv=(e,t,n)=>_hsx_default(e,t,n,`hsv`);interpolator_default.hsv=hsv;function multiplyMatrices(e,t){let n=e.length;Array.isArray(e[0])||(e=[e]),Array.isArray(t[0])||(t=t.map(e=>[e]));let r=t[0].length,i=t[0].map((e,n)=>t.map(e=>e[n])),a=e.map(e=>i.map(t=>Array.isArray(e)?e.reduce((e,n,r)=>e+n*(t[r]||0),0):t.reduce((t,n)=>t+n*e,0)));return n===1&&(a=a[0]),r===1?a.map(e=>e[0]):a}const oklab2rgb=(...e)=>{e=unpack_default(e,`lab`);let[t,n,r,...i]=e,[a,s,c]=OKLab_to_XYZ([t,n,r]),[l,u,d]=xyz2rgb(a,s,c);return[l,u,d,...i.length>0&&i[0]<1?[i[0]]:[]]};function OKLab_to_XYZ(e){return multiplyMatrices([[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],multiplyMatrices([[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],e).map(e=>e**3))}const rgb2oklab=(...e)=>{let[t,n,r,...i]=unpack_default(e,`rgb`);return[...XYZ_to_OKLab(rgb2xyz(t,n,r)),...i.length>0&&i[0]<1?[i[0]]:[]]};function XYZ_to_OKLab(e){return multiplyMatrices([[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],multiplyMatrices([[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],e).map(e=>Math.cbrt(e)))}Color.prototype.oklab=function(){return rgb2oklab(this._rgb)};const oklab$1=(...e)=>new Color(...e,`oklab`);Object.assign(chroma,{oklab:oklab$1}),input_default.format.oklab=oklab2rgb,input_default.autodetect.push({p:2,test:(...e)=>{if(e=unpack_default(e,`oklab`),type_default(e)===`array`&&e.length===3)return`oklab`}});const oklab=(e,t,n)=>{let r=e.oklab(),i=t.oklab();return new Color(r[0]+n*(i[0]-r[0]),r[1]+n*(i[1]-r[1]),r[2]+n*(i[2]-r[2]),`oklab`)};interpolator_default.oklab=oklab;const oklch$1=(e,t,n)=>_hsx_default(e,t,n,`oklch`);interpolator_default.oklch=oklch$1;const{pow:pow$4,sqrt:sqrt$1,PI:PI$1,cos:cos$2,sin:sin$2,atan2:atan2$1}=Math;var average_default=(e,t=`lrgb`,n=null)=>{let r=e.length;n||=Array.from(Array(r)).map(()=>1);let i=r/n.reduce(function(e,t){return e+t});if(n.forEach((e,t)=>{n[t]*=i}),e=e.map(e=>new Color(e)),t===`lrgb`)return _average_lrgb(e,n);let a=e.shift(),o=a.get(t),s=[],c=0,l=0;for(let e=0;e<o.length;e++)if(o[e]=(o[e]||0)*n[0],s.push(isNaN(o[e])?0:n[0]),t.charAt(e)===`h`&&!isNaN(o[e])){let t=o[e]/180*PI$1;c+=cos$2(t)*n[0],l+=sin$2(t)*n[0]}let u=a.alpha()*n[0];e.forEach((e,r)=>{let i=e.get(t);u+=e.alpha()*n[r+1];for(let e=0;e<o.length;e++)if(!isNaN(i[e]))if(s[e]+=n[r+1],t.charAt(e)===`h`){let t=i[e]/180*PI$1;c+=cos$2(t)*n[r+1],l+=sin$2(t)*n[r+1]}else o[e]+=i[e]*n[r+1]});for(let e=0;e<o.length;e++)if(t.charAt(e)===`h`){let t=atan2$1(l/s[e],c/s[e])/PI$1*180;for(;t<0;)t+=360;for(;t>=360;)t-=360;o[e]=t}else o[e]=o[e]/s[e];return u/=r,new Color(o,t).alpha(u>.99999?1:u,!0)};const _average_lrgb=(e,t)=>{let n=e.length,i=[0,0,0,0];for(let r=0;r<e.length;r++){let a=e[r],o=t[r]/n,s=a._rgb;i[0]+=pow$4(s[0],2)*o,i[1]+=pow$4(s[1],2)*o,i[2]+=pow$4(s[2],2)*o,i[3]+=s[3]*o}return i[0]=sqrt$1(i[0]),i[1]=sqrt$1(i[1]),i[2]=sqrt$1(i[2]),i[3]>.9999999&&(i[3]=1),new Color(clip_rgb_default(i))},{pow:pow$3}=Math;function scale_default(e){let t=`rgb`,r=chroma(`#ccc`),i=0,o=[0,1],s=[0,1],c=[],l=[0,0],u=!1,d=[],f=!1,p=0,m=1,h=!1,g={},_=!0,v=1,y=function(e){if(e||=[`#fff`,`#000`],e&&type_default(e)===`string`&&chroma.brewer&&chroma.brewer[e.toLowerCase()]&&(e=chroma.brewer[e.toLowerCase()]),type_default(e)===`array`){e.length===1&&(e=[e[0],e[0]]),e=e.slice(0);for(let t=0;t<e.length;t++)e[t]=chroma(e[t]);c.length=0;for(let t=0;t<e.length;t++)c.push(t/(e.length-1))}return T(),d=e},x=function(e){if(u!=null){let t=u.length-1,n=0;for(;n<t&&e>=u[n];)n++;return n-1}return 0},S=e=>e,C=e=>e,w=function(e,i){let o,s;if(i??=!1,isNaN(e)||e===null)return r;s=i?e:u&&u.length>2?x(e)/(u.length-2):m===p?1:(e-p)/(m-p),s=C(s),i||(s=S(s)),v!==1&&(s=pow$3(s,v)),s=l[0]+s*(1-l[0]-l[1]),s=limit_default(s,0,1);let f=Math.floor(s*1e4);if(_&&g[f])o=g[f];else{if(type_default(d)===`array`)for(let e=0;e<c.length;e++){let n=c[e];if(s<=n){o=d[e];break}if(s>=n&&e===c.length-1){o=d[e];break}if(s>n&&s<c[e+1]){s=(s-n)/(c[e+1]-n),o=chroma.interpolate(d[e],d[e+1],s,t);break}}else type_default(d)===`function`&&(o=d(s));_&&(g[f]=o)}return o};var T=()=>g={};y(e);let E=function(e){let t=chroma(w(e));return f&&t[f]?t[f]():t};return E.classes=function(e){if(e!=null){if(type_default(e)===`array`)u=e,o=[e[0],e[e.length-1]];else{let t=chroma.analyze(o);u=e===0?[t.min,t.max]:chroma.limits(t,`e`,e)}return E}return u},E.domain=function(e){if(!arguments.length)return s;s=e.slice(0),p=e[0],m=e[e.length-1],c=[];let t=d.length;if(e.length===t&&p!==m)for(let t of Array.from(e))c.push((t-p)/(m-p));else{for(let e=0;e<t;e++)c.push(e/(t-1));if(e.length>2){let t=e.map((t,n)=>n/(e.length-1)),n=e.map(e=>(e-p)/(m-p));n.every((e,n)=>t[n]===e)||(C=e=>{if(e<=0||e>=1)return e;let r=0;for(;e>=n[r+1];)r++;let i=(e-n[r])/(n[r+1]-n[r]);return t[r]+i*(t[r+1]-t[r])})}}return o=[p,m],E},E.mode=function(e){return arguments.length?(t=e,T(),E):t},E.range=function(e,t){return y(e,t),E},E.out=function(e){return f=e,E},E.spread=function(e){return arguments.length?(i=e,E):i},E.correctLightness=function(e){return e??=!0,h=e,T(),S=h?function(e){let t=w(0,!0).lab()[0],n=w(1,!0).lab()[0],r=t>n,i=w(e,!0).lab()[0],a=t+(n-t)*e,o=i-a,s=0,c=1,l=20;for(;Math.abs(o)>.01&&l-- >0;)(function(){return r&&(o*=-1),o<0?(s=e,e+=(c-e)*.5):(c=e,e+=(s-e)*.5),i=w(e,!0).lab()[0],o=i-a})();return e}:e=>e,E},E.padding=function(e){return e==null?l:(type_default(e)===`number`&&(e=[e,e]),l=e,E)},E.colors=function(t,n){arguments.length<2&&(n=`hex`);let r=[];if(arguments.length===0)r=d.slice(0);else if(t===1)r=[E(.5)];else if(t>1){let e=o[0],n=o[1]-e;r=__range__(0,t,!1).map(r=>E(e+r/(t-1)*n))}else{e=[];let t=[];if(u&&u.length>2)for(let e=1,n=u.length,r=1<=n;r?e<n:e>n;r?e++:e--)t.push((u[e-1]+u[e])*.5);else t=o;r=t.map(e=>E(e))}return chroma[n]&&(r=r.map(e=>e[n]())),r},E.cache=function(e){return e==null?_:(_=e,E)},E.gamma=function(e){return e==null?v:(v=e,E)},E.nodata=function(e){return e==null?r:(r=chroma(e),E)},E}function __range__(e,t,n){let r=[],i=e<t,a=n?i?t+1:t-1:t;for(let t=e;i?t<a:t>a;i?t++:t--)r.push(t);return r}const binom_row=function(e){let t=[1,1];for(let n=1;n<e;n++){let e=[1];for(let n=1;n<=t.length;n++)e[n]=(t[n]||0)+t[n-1];t=e}return t},bezier=function(e){let t,n,r,i;if(e=e.map(e=>new Color(e)),e.length===2)[n,r]=e.map(e=>e.lab()),t=function(e){return new Color([0,1,2].map(t=>n[t]+e*(r[t]-n[t])),`lab`)};else if(e.length===3)[n,r,i]=e.map(e=>e.lab()),t=function(e){return new Color([0,1,2].map(t=>(1-e)*(1-e)*n[t]+2*(1-e)*e*r[t]+e*e*i[t]),`lab`)};else if(e.length===4){let a;[n,r,i,a]=e.map(e=>e.lab()),t=function(e){return new Color([0,1,2].map(t=>(1-e)*(1-e)*(1-e)*n[t]+3*(1-e)*(1-e)*e*r[t]+3*(1-e)*e*e*i[t]+e*e*e*a[t]),`lab`)}}else if(e.length>=5){let n,r,i;n=e.map(e=>e.lab()),i=e.length-1,r=binom_row(i),t=function(e){let t=1-e;return new Color([0,1,2].map(a=>n.reduce((n,o,s)=>n+r[s]*t**(i-s)*e**s*o[a],0)),`lab`)}}else throw RangeError(`No point in running bezier with only one color.`);return t};var bezier_default=e=>{let t=bezier(e);return t.scale=()=>scale_default(t),t};const{round:round$3}=Math;Color.prototype.rgb=function(e=!0){return e===!1?this._rgb.slice(0,3):this._rgb.slice(0,3).map(round$3)},Color.prototype.rgba=function(e=!0){return this._rgb.slice(0,4).map((t,n)=>n<3?e===!1?t:round$3(t):t)};const rgb=(...e)=>new Color(...e,`rgb`);Object.assign(chroma,{rgb}),input_default.format.rgb=(...e)=>{let t=unpack_default(e,`rgba`);return t[3]===void 0&&(t[3]=1),t},input_default.autodetect.push({p:3,test:(...e)=>{if(e=unpack_default(e,`rgba`),type_default(e)===`array`&&(e.length===3||e.length===4&&type_default(e[3])==`number`&&e[3]>=0&&e[3]<=1))return`rgb`}});const blend=(e,t,n)=>{if(!blend[n])throw Error(`unknown blend mode `+n);return blend[n](e,t)},blend_f=e=>(t,n)=>{let r=chroma(n).rgb(),i=chroma(t).rgb();return chroma.rgb(e(r,i))},each=e=>(t,n)=>{let r=[];return r[0]=e(t[0],n[0]),r[1]=e(t[1],n[1]),r[2]=e(t[2],n[2]),r},normal=e=>e,multiply=(e,t)=>e*t/255,darken=(e,t)=>e>t?t:e,lighten=(e,t)=>e>t?e:t,screen=(e,t)=>255*(1-(1-e/255)*(1-t/255)),overlay=(e,t)=>t<128?2*e*t/255:255*(1-2*(1-e/255)*(1-t/255)),burn=(e,t)=>255*(1-(1-t/255)/(e/255)),dodge=(e,t)=>e===255?255:(e=t/255*255/(1-e/255),e>255?255:e);blend.normal=blend_f(each(normal)),blend.multiply=blend_f(each(multiply)),blend.screen=blend_f(each(screen)),blend.overlay=blend_f(each(overlay)),blend.darken=blend_f(each(darken)),blend.lighten=blend_f(each(lighten)),blend.dodge=blend_f(each(dodge)),blend.burn=blend_f(each(burn));const{pow:pow$2,sin:sin$1,cos:cos$1}=Math;function cubehelix_default(e=300,t=-1.5,n=1,i=1,o=[0,1]){let s=0,c;type_default(o)===`array`?c=o[1]-o[0]:(c=0,o=[o,o]);let l=function(a){let l=TWOPI*((e+120)/360+t*a),u=pow$2(o[0]+c*a,i),d=(s===0?n:n[0]+a*s)*u*(1-u)/2,f=cos$1(l),m=sin$1(l),h=u+d*(-.14861*f+1.78277*m),g=u+d*(-.29227*f-.90649*m),_=u+1.97294*f*d;return chroma(clip_rgb_default([h*255,g*255,_*255,1]))};return l.start=function(t){return t==null?e:(e=t,l)},l.rotations=function(e){return e==null?t:(t=e,l)},l.gamma=function(e){return e==null?i:(i=e,l)},l.hue=function(e){return e==null?n:(n=e,type_default(n)===`array`?(s=n[1]-n[0],s===0&&(n=n[1])):s=0,l)},l.lightness=function(e){return e==null?o:(type_default(e)===`array`?(o=e,c=e[1]-e[0]):(o=[e,e],c=0),l)},l.scale=()=>chroma.scale(l),l.hue(n),l}const{floor:floor$1,random}=Math;var random_default=(e=random)=>{let t=`#`;for(let n=0;n<6;n++)t+=`0123456789abcdef`.charAt(floor$1(e()*16));return new Color(t,`hex`)};const{log:log$1,pow:pow$1,floor,abs:abs$1}=Math;function analyze(e,t=null){let n={min:Number.MAX_VALUE,max:Number.MAX_VALUE*-1,sum:0,values:[],count:0};return type_default(e)===`object`&&(e=Object.values(e)),e.forEach(e=>{t&&type_default(e)===`object`&&(e=e[t]),e!=null&&!isNaN(e)&&(n.values.push(e),n.sum+=e,e<n.min&&(n.min=e),e>n.max&&(n.max=e),n.count+=1)}),n.domain=[n.min,n.max],n.limits=(e,t)=>limits(n,e,t),n}function limits(e,t=`equal`,n=7){type_default(e)==`array`&&(e=analyze(e));let{min:r,max:i}=e,o=e.values.sort((e,t)=>e-t);if(n===1)return[r,i];let s=[];if(t.substr(0,1)===`c`&&(s.push(r),s.push(i)),t.substr(0,1)===`e`){s.push(r);for(let e=1;e<n;e++)s.push(r+e/n*(i-r));s.push(i)}else if(t.substr(0,1)===`l`){if(r<=0)throw Error(`Logarithmic scales are only possible for values > 0`);let e=Math.LOG10E*log$1(r),t=Math.LOG10E*log$1(i);s.push(r);for(let r=1;r<n;r++)s.push(pow$1(10,e+r/n*(t-e)));s.push(i)}else if(t.substr(0,1)===`q`){s.push(r);for(let e=1;e<n;e++){let t=(o.length-1)*e/n,r=floor(t);if(r===t)s.push(o[r]);else{let e=t-r;s.push(o[r]*(1-e)+o[r+1]*e)}}s.push(i)}else if(t.substr(0,1)===`k`){let e,t=o.length,a=Array(t),c=Array(n),l=!0,u=0,d=null;d=[],d.push(r);for(let e=1;e<n;e++)d.push(r+e/n*(i-r));for(d.push(i);l;){for(let e=0;e<n;e++)c[e]=0;for(let e=0;e<t;e++){let t=o[e],r=Number.MAX_VALUE,i;for(let o=0;o<n;o++){let n=abs$1(d[o]-t);n<r&&(r=n,i=o),c[i]++,a[e]=i}}let r=Array(n);for(let e=0;e<n;e++)r[e]=null;for(let n=0;n<t;n++)e=a[n],r[e]===null?r[e]=o[n]:r[e]+=o[n];for(let e=0;e<n;e++)r[e]*=1/c[e];l=!1;for(let e=0;e<n;e++)if(r[e]!==d[e]){l=!0;break}d=r,u++,u>200&&(l=!1)}let f={};for(let e=0;e<n;e++)f[e]=[];for(let n=0;n<t;n++)e=a[n],f[e].push(o[n]);let p=[];for(let e=0;e<n;e++)p.push(f[e][0]),p.push(f[e][f[e].length-1]);p=p.sort((e,t)=>e-t),s.push(p[0]);for(let e=1;e<p.length;e+=2){let t=p[e];!isNaN(t)&&s.indexOf(t)===-1&&s.push(t)}}return s}var contrast_default=(e,t)=>{e=new Color(e),t=new Color(t);let n=e.luminance(),r=t.luminance();return n>r?(n+.05)/(r+.05):(r+.05)/(n+.05)};
2282
2
  /**
2283
3
  * @license
2284
4
  *
@@ -2292,1125 +12,4 @@ var contrast_default = (a, b) => {
2292
12
  * You can read more about the APCA Readability Criterion at
2293
13
  * https://readtech.org/ARC/
2294
14
  */
2295
- const W_offset = .027;
2296
- const P_in = 5e-4;
2297
- const P_out = .1;
2298
- const R_scale = 1.14;
2299
- const B_threshold = .022;
2300
- const B_exp = 1.414;
2301
- var contrastAPCA_default = (text, bg) => {
2302
- text = new Color_default(text);
2303
- bg = new Color_default(bg);
2304
- if (text.alpha() < 1) text = mix_default(bg, text, text.alpha(), "rgb");
2305
- const l_text = lum(...text.rgb());
2306
- const l_bg = lum(...bg.rgb());
2307
- const Y_text = l_text >= B_threshold ? l_text : l_text + Math.pow(B_threshold - l_text, B_exp);
2308
- const Y_bg = l_bg >= B_threshold ? l_bg : l_bg + Math.pow(B_threshold - l_bg, B_exp);
2309
- const S_norm = Math.pow(Y_bg, .56) - Math.pow(Y_text, .57);
2310
- const S_rev = Math.pow(Y_bg, .65) - Math.pow(Y_text, .62);
2311
- const C = Math.abs(Y_bg - Y_text) < P_in ? 0 : Y_text < Y_bg ? S_norm * R_scale : S_rev * R_scale;
2312
- return (Math.abs(C) < P_out ? 0 : C > 0 ? C - W_offset : C + W_offset) * 100;
2313
- };
2314
- function lum(r, g, b) {
2315
- return .2126729 * Math.pow(r / 255, 2.4) + .7151522 * Math.pow(g / 255, 2.4) + .072175 * Math.pow(b / 255, 2.4);
2316
- }
2317
-
2318
- //#endregion
2319
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/utils/delta-e.js
2320
- const { sqrt, pow, min, max: max$1, atan2, abs, cos, sin, exp, PI } = Math;
2321
- function delta_e_default(a, b, Kl = 1, Kc = 1, Kh = 1) {
2322
- var rad2deg = function(rad) {
2323
- return 360 * rad / (2 * PI);
2324
- };
2325
- var deg2rad = function(deg) {
2326
- return 2 * PI * deg / 360;
2327
- };
2328
- a = new Color_default(a);
2329
- b = new Color_default(b);
2330
- const [L1, a1, b1] = Array.from(a.lab());
2331
- const [L2, a2, b2] = Array.from(b.lab());
2332
- const avgL = (L1 + L2) / 2;
2333
- const avgC = (sqrt(pow(a1, 2) + pow(b1, 2)) + sqrt(pow(a2, 2) + pow(b2, 2))) / 2;
2334
- const G = .5 * (1 - sqrt(pow(avgC, 7) / (pow(avgC, 7) + pow(25, 7))));
2335
- const a1p = a1 * (1 + G);
2336
- const a2p = a2 * (1 + G);
2337
- const C1p = sqrt(pow(a1p, 2) + pow(b1, 2));
2338
- const C2p = sqrt(pow(a2p, 2) + pow(b2, 2));
2339
- const avgCp = (C1p + C2p) / 2;
2340
- const arctan1 = rad2deg(atan2(b1, a1p));
2341
- const arctan2 = rad2deg(atan2(b2, a2p));
2342
- const h1p = arctan1 >= 0 ? arctan1 : arctan1 + 360;
2343
- const h2p = arctan2 >= 0 ? arctan2 : arctan2 + 360;
2344
- const avgHp = abs(h1p - h2p) > 180 ? (h1p + h2p + 360) / 2 : (h1p + h2p) / 2;
2345
- const T = 1 - .17 * cos(deg2rad(avgHp - 30)) + .24 * cos(deg2rad(2 * avgHp)) + .32 * cos(deg2rad(3 * avgHp + 6)) - .2 * cos(deg2rad(4 * avgHp - 63));
2346
- let deltaHp = h2p - h1p;
2347
- deltaHp = abs(deltaHp) <= 180 ? deltaHp : h2p <= h1p ? deltaHp + 360 : deltaHp - 360;
2348
- deltaHp = 2 * sqrt(C1p * C2p) * sin(deg2rad(deltaHp) / 2);
2349
- const deltaL = L2 - L1;
2350
- const deltaCp = C2p - C1p;
2351
- const sl = 1 + .015 * pow(avgL - 50, 2) / sqrt(20 + pow(avgL - 50, 2));
2352
- const sc = 1 + .045 * avgCp;
2353
- const sh = 1 + .015 * avgCp * T;
2354
- const deltaTheta = 30 * exp(-pow((avgHp - 275) / 25, 2));
2355
- const Rt = -(2 * sqrt(pow(avgCp, 7) / (pow(avgCp, 7) + pow(25, 7)))) * sin(2 * deg2rad(deltaTheta));
2356
- return max$1(0, min(100, sqrt(pow(deltaL / (Kl * sl), 2) + pow(deltaCp / (Kc * sc), 2) + pow(deltaHp / (Kh * sh), 2) + Rt * (deltaCp / (Kc * sc)) * (deltaHp / (Kh * sh)))));
2357
- }
2358
-
2359
- //#endregion
2360
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/utils/distance.js
2361
- function distance_default(a, b, mode = "lab") {
2362
- a = new Color_default(a);
2363
- b = new Color_default(b);
2364
- const l1 = a.get(mode);
2365
- const l2 = b.get(mode);
2366
- let sum_sq = 0;
2367
- for (let i in l1) {
2368
- const d = (l1[i] || 0) - (l2[i] || 0);
2369
- sum_sq += d * d;
2370
- }
2371
- return Math.sqrt(sum_sq);
2372
- }
2373
-
2374
- //#endregion
2375
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/utils/valid.js
2376
- var valid_default = (...args) => {
2377
- try {
2378
- new Color_default(...args);
2379
- return true;
2380
- } catch (e) {
2381
- return false;
2382
- }
2383
- };
2384
-
2385
- //#endregion
2386
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/utils/scales.js
2387
- var scales_default = {
2388
- cool() {
2389
- return scale_default([chroma_default.hsl(180, 1, .9), chroma_default.hsl(250, .7, .4)]);
2390
- },
2391
- hot() {
2392
- return scale_default([
2393
- "#000",
2394
- "#f00",
2395
- "#ff0",
2396
- "#fff"
2397
- ], [
2398
- 0,
2399
- .25,
2400
- .75,
2401
- 1
2402
- ]).mode("rgb");
2403
- }
2404
- };
2405
-
2406
- //#endregion
2407
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/colors/colorbrewer.js
2408
- /**
2409
- ColorBrewer colors for chroma.js
2410
-
2411
- Copyright (c) 2002 Cynthia Brewer, Mark Harrower, and The
2412
- Pennsylvania State University.
2413
-
2414
- Licensed under the Apache License, Version 2.0 (the "License");
2415
- you may not use this file except in compliance with the License.
2416
- You may obtain a copy of the License at
2417
- http://www.apache.org/licenses/LICENSE-2.0
2418
-
2419
- Unless required by applicable law or agreed to in writing, software distributed
2420
- under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
2421
- CONDITIONS OF ANY KIND, either express or implied. See the License for the
2422
- specific language governing permissions and limitations under the License.
2423
- */
2424
- const colorbrewer = {
2425
- OrRd: [
2426
- "#fff7ec",
2427
- "#fee8c8",
2428
- "#fdd49e",
2429
- "#fdbb84",
2430
- "#fc8d59",
2431
- "#ef6548",
2432
- "#d7301f",
2433
- "#b30000",
2434
- "#7f0000"
2435
- ],
2436
- PuBu: [
2437
- "#fff7fb",
2438
- "#ece7f2",
2439
- "#d0d1e6",
2440
- "#a6bddb",
2441
- "#74a9cf",
2442
- "#3690c0",
2443
- "#0570b0",
2444
- "#045a8d",
2445
- "#023858"
2446
- ],
2447
- BuPu: [
2448
- "#f7fcfd",
2449
- "#e0ecf4",
2450
- "#bfd3e6",
2451
- "#9ebcda",
2452
- "#8c96c6",
2453
- "#8c6bb1",
2454
- "#88419d",
2455
- "#810f7c",
2456
- "#4d004b"
2457
- ],
2458
- Oranges: [
2459
- "#fff5eb",
2460
- "#fee6ce",
2461
- "#fdd0a2",
2462
- "#fdae6b",
2463
- "#fd8d3c",
2464
- "#f16913",
2465
- "#d94801",
2466
- "#a63603",
2467
- "#7f2704"
2468
- ],
2469
- BuGn: [
2470
- "#f7fcfd",
2471
- "#e5f5f9",
2472
- "#ccece6",
2473
- "#99d8c9",
2474
- "#66c2a4",
2475
- "#41ae76",
2476
- "#238b45",
2477
- "#006d2c",
2478
- "#00441b"
2479
- ],
2480
- YlOrBr: [
2481
- "#ffffe5",
2482
- "#fff7bc",
2483
- "#fee391",
2484
- "#fec44f",
2485
- "#fe9929",
2486
- "#ec7014",
2487
- "#cc4c02",
2488
- "#993404",
2489
- "#662506"
2490
- ],
2491
- YlGn: [
2492
- "#ffffe5",
2493
- "#f7fcb9",
2494
- "#d9f0a3",
2495
- "#addd8e",
2496
- "#78c679",
2497
- "#41ab5d",
2498
- "#238443",
2499
- "#006837",
2500
- "#004529"
2501
- ],
2502
- Reds: [
2503
- "#fff5f0",
2504
- "#fee0d2",
2505
- "#fcbba1",
2506
- "#fc9272",
2507
- "#fb6a4a",
2508
- "#ef3b2c",
2509
- "#cb181d",
2510
- "#a50f15",
2511
- "#67000d"
2512
- ],
2513
- RdPu: [
2514
- "#fff7f3",
2515
- "#fde0dd",
2516
- "#fcc5c0",
2517
- "#fa9fb5",
2518
- "#f768a1",
2519
- "#dd3497",
2520
- "#ae017e",
2521
- "#7a0177",
2522
- "#49006a"
2523
- ],
2524
- Greens: [
2525
- "#f7fcf5",
2526
- "#e5f5e0",
2527
- "#c7e9c0",
2528
- "#a1d99b",
2529
- "#74c476",
2530
- "#41ab5d",
2531
- "#238b45",
2532
- "#006d2c",
2533
- "#00441b"
2534
- ],
2535
- YlGnBu: [
2536
- "#ffffd9",
2537
- "#edf8b1",
2538
- "#c7e9b4",
2539
- "#7fcdbb",
2540
- "#41b6c4",
2541
- "#1d91c0",
2542
- "#225ea8",
2543
- "#253494",
2544
- "#081d58"
2545
- ],
2546
- Purples: [
2547
- "#fcfbfd",
2548
- "#efedf5",
2549
- "#dadaeb",
2550
- "#bcbddc",
2551
- "#9e9ac8",
2552
- "#807dba",
2553
- "#6a51a3",
2554
- "#54278f",
2555
- "#3f007d"
2556
- ],
2557
- GnBu: [
2558
- "#f7fcf0",
2559
- "#e0f3db",
2560
- "#ccebc5",
2561
- "#a8ddb5",
2562
- "#7bccc4",
2563
- "#4eb3d3",
2564
- "#2b8cbe",
2565
- "#0868ac",
2566
- "#084081"
2567
- ],
2568
- Greys: [
2569
- "#ffffff",
2570
- "#f0f0f0",
2571
- "#d9d9d9",
2572
- "#bdbdbd",
2573
- "#969696",
2574
- "#737373",
2575
- "#525252",
2576
- "#252525",
2577
- "#000000"
2578
- ],
2579
- YlOrRd: [
2580
- "#ffffcc",
2581
- "#ffeda0",
2582
- "#fed976",
2583
- "#feb24c",
2584
- "#fd8d3c",
2585
- "#fc4e2a",
2586
- "#e31a1c",
2587
- "#bd0026",
2588
- "#800026"
2589
- ],
2590
- PuRd: [
2591
- "#f7f4f9",
2592
- "#e7e1ef",
2593
- "#d4b9da",
2594
- "#c994c7",
2595
- "#df65b0",
2596
- "#e7298a",
2597
- "#ce1256",
2598
- "#980043",
2599
- "#67001f"
2600
- ],
2601
- Blues: [
2602
- "#f7fbff",
2603
- "#deebf7",
2604
- "#c6dbef",
2605
- "#9ecae1",
2606
- "#6baed6",
2607
- "#4292c6",
2608
- "#2171b5",
2609
- "#08519c",
2610
- "#08306b"
2611
- ],
2612
- PuBuGn: [
2613
- "#fff7fb",
2614
- "#ece2f0",
2615
- "#d0d1e6",
2616
- "#a6bddb",
2617
- "#67a9cf",
2618
- "#3690c0",
2619
- "#02818a",
2620
- "#016c59",
2621
- "#014636"
2622
- ],
2623
- Viridis: [
2624
- "#440154",
2625
- "#482777",
2626
- "#3f4a8a",
2627
- "#31678e",
2628
- "#26838f",
2629
- "#1f9d8a",
2630
- "#6cce5a",
2631
- "#b6de2b",
2632
- "#fee825"
2633
- ],
2634
- Spectral: [
2635
- "#9e0142",
2636
- "#d53e4f",
2637
- "#f46d43",
2638
- "#fdae61",
2639
- "#fee08b",
2640
- "#ffffbf",
2641
- "#e6f598",
2642
- "#abdda4",
2643
- "#66c2a5",
2644
- "#3288bd",
2645
- "#5e4fa2"
2646
- ],
2647
- RdYlGn: [
2648
- "#a50026",
2649
- "#d73027",
2650
- "#f46d43",
2651
- "#fdae61",
2652
- "#fee08b",
2653
- "#ffffbf",
2654
- "#d9ef8b",
2655
- "#a6d96a",
2656
- "#66bd63",
2657
- "#1a9850",
2658
- "#006837"
2659
- ],
2660
- RdBu: [
2661
- "#67001f",
2662
- "#b2182b",
2663
- "#d6604d",
2664
- "#f4a582",
2665
- "#fddbc7",
2666
- "#f7f7f7",
2667
- "#d1e5f0",
2668
- "#92c5de",
2669
- "#4393c3",
2670
- "#2166ac",
2671
- "#053061"
2672
- ],
2673
- PiYG: [
2674
- "#8e0152",
2675
- "#c51b7d",
2676
- "#de77ae",
2677
- "#f1b6da",
2678
- "#fde0ef",
2679
- "#f7f7f7",
2680
- "#e6f5d0",
2681
- "#b8e186",
2682
- "#7fbc41",
2683
- "#4d9221",
2684
- "#276419"
2685
- ],
2686
- PRGn: [
2687
- "#40004b",
2688
- "#762a83",
2689
- "#9970ab",
2690
- "#c2a5cf",
2691
- "#e7d4e8",
2692
- "#f7f7f7",
2693
- "#d9f0d3",
2694
- "#a6dba0",
2695
- "#5aae61",
2696
- "#1b7837",
2697
- "#00441b"
2698
- ],
2699
- RdYlBu: [
2700
- "#a50026",
2701
- "#d73027",
2702
- "#f46d43",
2703
- "#fdae61",
2704
- "#fee090",
2705
- "#ffffbf",
2706
- "#e0f3f8",
2707
- "#abd9e9",
2708
- "#74add1",
2709
- "#4575b4",
2710
- "#313695"
2711
- ],
2712
- BrBG: [
2713
- "#543005",
2714
- "#8c510a",
2715
- "#bf812d",
2716
- "#dfc27d",
2717
- "#f6e8c3",
2718
- "#f5f5f5",
2719
- "#c7eae5",
2720
- "#80cdc1",
2721
- "#35978f",
2722
- "#01665e",
2723
- "#003c30"
2724
- ],
2725
- RdGy: [
2726
- "#67001f",
2727
- "#b2182b",
2728
- "#d6604d",
2729
- "#f4a582",
2730
- "#fddbc7",
2731
- "#ffffff",
2732
- "#e0e0e0",
2733
- "#bababa",
2734
- "#878787",
2735
- "#4d4d4d",
2736
- "#1a1a1a"
2737
- ],
2738
- PuOr: [
2739
- "#7f3b08",
2740
- "#b35806",
2741
- "#e08214",
2742
- "#fdb863",
2743
- "#fee0b6",
2744
- "#f7f7f7",
2745
- "#d8daeb",
2746
- "#b2abd2",
2747
- "#8073ac",
2748
- "#542788",
2749
- "#2d004b"
2750
- ],
2751
- Set2: [
2752
- "#66c2a5",
2753
- "#fc8d62",
2754
- "#8da0cb",
2755
- "#e78ac3",
2756
- "#a6d854",
2757
- "#ffd92f",
2758
- "#e5c494",
2759
- "#b3b3b3"
2760
- ],
2761
- Accent: [
2762
- "#7fc97f",
2763
- "#beaed4",
2764
- "#fdc086",
2765
- "#ffff99",
2766
- "#386cb0",
2767
- "#f0027f",
2768
- "#bf5b17",
2769
- "#666666"
2770
- ],
2771
- Set1: [
2772
- "#e41a1c",
2773
- "#377eb8",
2774
- "#4daf4a",
2775
- "#984ea3",
2776
- "#ff7f00",
2777
- "#ffff33",
2778
- "#a65628",
2779
- "#f781bf",
2780
- "#999999"
2781
- ],
2782
- Set3: [
2783
- "#8dd3c7",
2784
- "#ffffb3",
2785
- "#bebada",
2786
- "#fb8072",
2787
- "#80b1d3",
2788
- "#fdb462",
2789
- "#b3de69",
2790
- "#fccde5",
2791
- "#d9d9d9",
2792
- "#bc80bd",
2793
- "#ccebc5",
2794
- "#ffed6f"
2795
- ],
2796
- Dark2: [
2797
- "#1b9e77",
2798
- "#d95f02",
2799
- "#7570b3",
2800
- "#e7298a",
2801
- "#66a61e",
2802
- "#e6ab02",
2803
- "#a6761d",
2804
- "#666666"
2805
- ],
2806
- Paired: [
2807
- "#a6cee3",
2808
- "#1f78b4",
2809
- "#b2df8a",
2810
- "#33a02c",
2811
- "#fb9a99",
2812
- "#e31a1c",
2813
- "#fdbf6f",
2814
- "#ff7f00",
2815
- "#cab2d6",
2816
- "#6a3d9a",
2817
- "#ffff99",
2818
- "#b15928"
2819
- ],
2820
- Pastel2: [
2821
- "#b3e2cd",
2822
- "#fdcdac",
2823
- "#cbd5e8",
2824
- "#f4cae4",
2825
- "#e6f5c9",
2826
- "#fff2ae",
2827
- "#f1e2cc",
2828
- "#cccccc"
2829
- ],
2830
- Pastel1: [
2831
- "#fbb4ae",
2832
- "#b3cde3",
2833
- "#ccebc5",
2834
- "#decbe4",
2835
- "#fed9a6",
2836
- "#ffffcc",
2837
- "#e5d8bd",
2838
- "#fddaec",
2839
- "#f2f2f2"
2840
- ]
2841
- };
2842
- const colorbrewerTypes = Object.keys(colorbrewer);
2843
- const typeMap = new Map(colorbrewerTypes.map((key) => [key.toLowerCase(), key]));
2844
- const colorbrewerProxy = typeof Proxy === "function" ? new Proxy(colorbrewer, {
2845
- get(target, prop) {
2846
- const lower = prop.toLowerCase();
2847
- if (typeMap.has(lower)) return target[typeMap.get(lower)];
2848
- },
2849
- getOwnPropertyNames() {
2850
- return Object.getOwnPropertyNames(colorbrewerTypes);
2851
- }
2852
- }) : colorbrewer;
2853
- var colorbrewer_default = colorbrewerProxy;
2854
-
2855
- //#endregion
2856
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/io/cmyk/cmyk2rgb.js
2857
- const cmyk2rgb = (...args) => {
2858
- args = unpack_default(args, "cmyk");
2859
- const [c, m, y, k] = args;
2860
- const alpha = args.length > 4 ? args[4] : 1;
2861
- if (k === 1) return [
2862
- 0,
2863
- 0,
2864
- 0,
2865
- alpha
2866
- ];
2867
- return [
2868
- c >= 1 ? 0 : 255 * (1 - c) * (1 - k),
2869
- m >= 1 ? 0 : 255 * (1 - m) * (1 - k),
2870
- y >= 1 ? 0 : 255 * (1 - y) * (1 - k),
2871
- alpha
2872
- ];
2873
- };
2874
- var cmyk2rgb_default = cmyk2rgb;
2875
-
2876
- //#endregion
2877
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/io/cmyk/rgb2cmyk.js
2878
- const { max } = Math;
2879
- const rgb2cmyk = (...args) => {
2880
- let [r, g, b] = unpack_default(args, "rgb");
2881
- r = r / 255;
2882
- g = g / 255;
2883
- b = b / 255;
2884
- const k = 1 - max(r, max(g, b));
2885
- const f = k < 1 ? 1 / (1 - k) : 0;
2886
- return [
2887
- (1 - r - k) * f,
2888
- (1 - g - k) * f,
2889
- (1 - b - k) * f,
2890
- k
2891
- ];
2892
- };
2893
- var rgb2cmyk_default = rgb2cmyk;
2894
-
2895
- //#endregion
2896
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/io/cmyk/index.js
2897
- Color_default.prototype.cmyk = function() {
2898
- return rgb2cmyk_default(this._rgb);
2899
- };
2900
- const cmyk = (...args) => new Color_default(...args, "cmyk");
2901
- Object.assign(chroma_default, { cmyk });
2902
- input_default.format.cmyk = cmyk2rgb_default;
2903
- input_default.autodetect.push({
2904
- p: 2,
2905
- test: (...args) => {
2906
- args = unpack_default(args, "cmyk");
2907
- if (type_default(args) === "array" && args.length === 4) return "cmyk";
2908
- }
2909
- });
2910
-
2911
- //#endregion
2912
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/io/css/hsl2css.js
2913
- const hsl2css = (...args) => {
2914
- const hsla = unpack_default(args, "hsla");
2915
- let mode = last_default(args) || "lsa";
2916
- hsla[0] = rnd2(hsla[0] || 0) + "deg";
2917
- hsla[1] = rnd2(hsla[1] * 100) + "%";
2918
- hsla[2] = rnd2(hsla[2] * 100) + "%";
2919
- if (mode === "hsla" || hsla.length > 3 && hsla[3] < 1) {
2920
- hsla[3] = "/ " + (hsla.length > 3 ? hsla[3] : 1);
2921
- mode = "hsla";
2922
- } else hsla.length = 3;
2923
- return `${mode.substr(0, 3)}(${hsla.join(" ")})`;
2924
- };
2925
- var hsl2css_default = hsl2css;
2926
-
2927
- //#endregion
2928
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/io/css/lab2css.js
2929
- const lab2css = (...args) => {
2930
- const laba = unpack_default(args, "lab");
2931
- let mode = last_default(args) || "lab";
2932
- laba[0] = rnd2(laba[0]) + "%";
2933
- laba[1] = rnd2(laba[1]);
2934
- laba[2] = rnd2(laba[2]);
2935
- if (mode === "laba" || laba.length > 3 && laba[3] < 1) laba[3] = "/ " + (laba.length > 3 ? laba[3] : 1);
2936
- else laba.length = 3;
2937
- return `lab(${laba.join(" ")})`;
2938
- };
2939
- var lab2css_default = lab2css;
2940
-
2941
- //#endregion
2942
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/io/css/lch2css.js
2943
- const lch2css = (...args) => {
2944
- const lcha = unpack_default(args, "lch");
2945
- let mode = last_default(args) || "lab";
2946
- lcha[0] = rnd2(lcha[0]) + "%";
2947
- lcha[1] = rnd2(lcha[1]);
2948
- lcha[2] = isNaN(lcha[2]) ? "none" : rnd2(lcha[2]) + "deg";
2949
- if (mode === "lcha" || lcha.length > 3 && lcha[3] < 1) lcha[3] = "/ " + (lcha.length > 3 ? lcha[3] : 1);
2950
- else lcha.length = 3;
2951
- return `lch(${lcha.join(" ")})`;
2952
- };
2953
- var lch2css_default = lch2css;
2954
-
2955
- //#endregion
2956
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/io/css/oklab2css.js
2957
- const oklab2css = (...args) => {
2958
- const laba = unpack_default(args, "lab");
2959
- laba[0] = rnd2(laba[0] * 100) + "%";
2960
- laba[1] = rnd3(laba[1]);
2961
- laba[2] = rnd3(laba[2]);
2962
- if (laba.length > 3 && laba[3] < 1) laba[3] = "/ " + (laba.length > 3 ? laba[3] : 1);
2963
- else laba.length = 3;
2964
- return `oklab(${laba.join(" ")})`;
2965
- };
2966
- var oklab2css_default = oklab2css;
2967
-
2968
- //#endregion
2969
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/io/oklch/rgb2oklch.js
2970
- const rgb2oklch = (...args) => {
2971
- const [r, g, b, ...rest] = unpack_default(args, "rgb");
2972
- const [l, a, b_] = rgb2oklab_default(r, g, b);
2973
- const [L, c, h] = lab2lch_default(l, a, b_);
2974
- return [
2975
- L,
2976
- c,
2977
- h,
2978
- ...rest.length > 0 && rest[0] < 1 ? [rest[0]] : []
2979
- ];
2980
- };
2981
- var rgb2oklch_default = rgb2oklch;
2982
-
2983
- //#endregion
2984
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/io/css/oklch2css.js
2985
- const oklch2css = (...args) => {
2986
- const lcha = unpack_default(args, "lch");
2987
- lcha[0] = rnd2(lcha[0] * 100) + "%";
2988
- lcha[1] = rnd3(lcha[1]);
2989
- lcha[2] = isNaN(lcha[2]) ? "none" : rnd2(lcha[2]) + "deg";
2990
- if (lcha.length > 3 && lcha[3] < 1) lcha[3] = "/ " + (lcha.length > 3 ? lcha[3] : 1);
2991
- else lcha.length = 3;
2992
- return `oklch(${lcha.join(" ")})`;
2993
- };
2994
- var oklch2css_default = oklch2css;
2995
-
2996
- //#endregion
2997
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/io/css/rgb2css.js
2998
- const { round: round$2 } = Math;
2999
- const rgb2css = (...args) => {
3000
- const rgba = unpack_default(args, "rgba");
3001
- let mode = last_default(args) || "rgb";
3002
- if (mode.substr(0, 3) === "hsl") return hsl2css_default(rgb2hsl_default(rgba), mode);
3003
- if (mode.substr(0, 3) === "lab") {
3004
- const prevWhitePoint = getLabWhitePoint();
3005
- setLabWhitePoint("d50");
3006
- const cssColor = lab2css_default(rgb2lab_default(rgba), mode);
3007
- setLabWhitePoint(prevWhitePoint);
3008
- return cssColor;
3009
- }
3010
- if (mode.substr(0, 3) === "lch") {
3011
- const prevWhitePoint = getLabWhitePoint();
3012
- setLabWhitePoint("d50");
3013
- const cssColor = lch2css_default(rgb2lch_default(rgba), mode);
3014
- setLabWhitePoint(prevWhitePoint);
3015
- return cssColor;
3016
- }
3017
- if (mode.substr(0, 5) === "oklab") return oklab2css_default(rgb2oklab_default(rgba));
3018
- if (mode.substr(0, 5) === "oklch") return oklch2css_default(rgb2oklch_default(rgba));
3019
- rgba[0] = round$2(rgba[0]);
3020
- rgba[1] = round$2(rgba[1]);
3021
- rgba[2] = round$2(rgba[2]);
3022
- if (mode === "rgba" || rgba.length > 3 && rgba[3] < 1) {
3023
- rgba[3] = "/ " + (rgba.length > 3 ? rgba[3] : 1);
3024
- mode = "rgba";
3025
- }
3026
- return `${mode.substr(0, 3)}(${rgba.slice(0, mode === "rgb" ? 3 : 4).join(" ")})`;
3027
- };
3028
- var rgb2css_default = rgb2css;
3029
-
3030
- //#endregion
3031
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/io/oklch/oklch2rgb.js
3032
- const oklch2rgb = (...args) => {
3033
- args = unpack_default(args, "lch");
3034
- const [l, c, h, ...rest] = args;
3035
- const [L, a, b_] = lch2lab_default(l, c, h);
3036
- const [r, g, b] = oklab2rgb_default(L, a, b_);
3037
- return [
3038
- r,
3039
- g,
3040
- b,
3041
- ...rest.length > 0 && rest[0] < 1 ? [rest[0]] : []
3042
- ];
3043
- };
3044
- var oklch2rgb_default = oklch2rgb;
3045
-
3046
- //#endregion
3047
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/io/css/css2rgb.js
3048
- const INT_OR_PCT = /((?:-?\d+)|(?:-?\d+(?:\.\d+)?)%|none)/.source;
3049
- const FLOAT_OR_PCT = /((?:-?(?:\d+(?:\.\d*)?|\.\d+)%?)|none)/.source;
3050
- const PCT = /((?:-?(?:\d+(?:\.\d*)?|\.\d+)%)|none)/.source;
3051
- const RE_S = /\s*/.source;
3052
- const SEP = /\s+/.source;
3053
- const COMMA = /\s*,\s*/.source;
3054
- const ANLGE = /((?:-?(?:\d+(?:\.\d*)?|\.\d+)(?:deg)?)|none)/.source;
3055
- const ALPHA = /\s*(?:\/\s*((?:[01]|[01]?\.\d+)|\d+(?:\.\d+)?%))?/.source;
3056
- const RE_RGB = new RegExp("^rgba?\\(" + RE_S + [
3057
- INT_OR_PCT,
3058
- INT_OR_PCT,
3059
- INT_OR_PCT
3060
- ].join(SEP) + ALPHA + "\\)$");
3061
- const RE_RGB_LEGACY = new RegExp("^rgb\\(" + RE_S + [
3062
- INT_OR_PCT,
3063
- INT_OR_PCT,
3064
- INT_OR_PCT
3065
- ].join(COMMA) + RE_S + "\\)$");
3066
- const RE_RGBA_LEGACY = new RegExp("^rgba\\(" + RE_S + [
3067
- INT_OR_PCT,
3068
- INT_OR_PCT,
3069
- INT_OR_PCT,
3070
- FLOAT_OR_PCT
3071
- ].join(COMMA) + RE_S + "\\)$");
3072
- const RE_HSL = new RegExp("^hsla?\\(" + RE_S + [
3073
- ANLGE,
3074
- PCT,
3075
- PCT
3076
- ].join(SEP) + ALPHA + "\\)$");
3077
- const RE_HSL_LEGACY = new RegExp("^hsl?\\(" + RE_S + [
3078
- ANLGE,
3079
- PCT,
3080
- PCT
3081
- ].join(COMMA) + RE_S + "\\)$");
3082
- const RE_HSLA_LEGACY = /^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/;
3083
- const RE_LAB = new RegExp("^lab\\(" + RE_S + [
3084
- FLOAT_OR_PCT,
3085
- FLOAT_OR_PCT,
3086
- FLOAT_OR_PCT
3087
- ].join(SEP) + ALPHA + "\\)$");
3088
- const RE_LCH = new RegExp("^lch\\(" + RE_S + [
3089
- FLOAT_OR_PCT,
3090
- FLOAT_OR_PCT,
3091
- ANLGE
3092
- ].join(SEP) + ALPHA + "\\)$");
3093
- const RE_OKLAB = new RegExp("^oklab\\(" + RE_S + [
3094
- FLOAT_OR_PCT,
3095
- FLOAT_OR_PCT,
3096
- FLOAT_OR_PCT
3097
- ].join(SEP) + ALPHA + "\\)$");
3098
- const RE_OKLCH = new RegExp("^oklch\\(" + RE_S + [
3099
- FLOAT_OR_PCT,
3100
- FLOAT_OR_PCT,
3101
- ANLGE
3102
- ].join(SEP) + ALPHA + "\\)$");
3103
- const { round: round$1 } = Math;
3104
- const roundRGB = (rgb) => {
3105
- return rgb.map((v, i) => i <= 2 ? limit_default(round$1(v), 0, 255) : v);
3106
- };
3107
- const percentToAbsolute = (pct, min = 0, max = 100, signed = false) => {
3108
- if (typeof pct === "string" && pct.endsWith("%")) {
3109
- pct = parseFloat(pct.substring(0, pct.length - 1)) / 100;
3110
- if (signed) pct = min + (pct + 1) * .5 * (max - min);
3111
- else pct = min + pct * (max - min);
3112
- }
3113
- return +pct;
3114
- };
3115
- const noneToValue = (v, noneValue) => {
3116
- return v === "none" ? noneValue : v;
3117
- };
3118
- const css2rgb = (css) => {
3119
- css = css.toLowerCase().trim();
3120
- if (css === "transparent") return [
3121
- 0,
3122
- 0,
3123
- 0,
3124
- 0
3125
- ];
3126
- let m;
3127
- if (input_default.format.named) try {
3128
- return input_default.format.named(css);
3129
- } catch (e) {}
3130
- if ((m = css.match(RE_RGB)) || (m = css.match(RE_RGB_LEGACY))) {
3131
- let rgb = m.slice(1, 4);
3132
- for (let i = 0; i < 3; i++) rgb[i] = +percentToAbsolute(noneToValue(rgb[i], 0), 0, 255);
3133
- rgb = roundRGB(rgb);
3134
- const alpha = m[4] !== void 0 ? +percentToAbsolute(m[4], 0, 1) : 1;
3135
- rgb[3] = alpha;
3136
- return rgb;
3137
- }
3138
- if (m = css.match(RE_RGBA_LEGACY)) {
3139
- const rgb = m.slice(1, 5);
3140
- for (let i = 0; i < 4; i++) rgb[i] = +percentToAbsolute(rgb[i], 0, 255);
3141
- return rgb;
3142
- }
3143
- if ((m = css.match(RE_HSL)) || (m = css.match(RE_HSL_LEGACY))) {
3144
- const hsl = m.slice(1, 4);
3145
- hsl[0] = +noneToValue(hsl[0].replace("deg", ""), 0);
3146
- hsl[1] = +percentToAbsolute(noneToValue(hsl[1], 0), 0, 100) * .01;
3147
- hsl[2] = +percentToAbsolute(noneToValue(hsl[2], 0), 0, 100) * .01;
3148
- const rgb = roundRGB(hsl2rgb_default(hsl));
3149
- rgb[3] = m[4] !== void 0 ? +percentToAbsolute(m[4], 0, 1) : 1;
3150
- return rgb;
3151
- }
3152
- if (m = css.match(RE_HSLA_LEGACY)) {
3153
- const hsl = m.slice(1, 4);
3154
- hsl[1] *= .01;
3155
- hsl[2] *= .01;
3156
- const rgb = hsl2rgb_default(hsl);
3157
- for (let i = 0; i < 3; i++) rgb[i] = round$1(rgb[i]);
3158
- rgb[3] = +m[4];
3159
- return rgb;
3160
- }
3161
- if (m = css.match(RE_LAB)) {
3162
- const lab = m.slice(1, 4);
3163
- lab[0] = percentToAbsolute(noneToValue(lab[0], 0), 0, 100);
3164
- lab[1] = percentToAbsolute(noneToValue(lab[1], 0), -125, 125, true);
3165
- lab[2] = percentToAbsolute(noneToValue(lab[2], 0), -125, 125, true);
3166
- const wp = getLabWhitePoint();
3167
- setLabWhitePoint("d50");
3168
- const rgb = roundRGB(lab2rgb_default(lab));
3169
- setLabWhitePoint(wp);
3170
- rgb[3] = m[4] !== void 0 ? +percentToAbsolute(m[4], 0, 1) : 1;
3171
- return rgb;
3172
- }
3173
- if (m = css.match(RE_LCH)) {
3174
- const lch = m.slice(1, 4);
3175
- lch[0] = percentToAbsolute(lch[0], 0, 100);
3176
- lch[1] = percentToAbsolute(noneToValue(lch[1], 0), 0, 150, false);
3177
- lch[2] = +noneToValue(lch[2].replace("deg", ""), 0);
3178
- const wp = getLabWhitePoint();
3179
- setLabWhitePoint("d50");
3180
- const rgb = roundRGB(lch2rgb_default(lch));
3181
- setLabWhitePoint(wp);
3182
- rgb[3] = m[4] !== void 0 ? +percentToAbsolute(m[4], 0, 1) : 1;
3183
- return rgb;
3184
- }
3185
- if (m = css.match(RE_OKLAB)) {
3186
- const oklab = m.slice(1, 4);
3187
- oklab[0] = percentToAbsolute(noneToValue(oklab[0], 0), 0, 1);
3188
- oklab[1] = percentToAbsolute(noneToValue(oklab[1], 0), -.4, .4, true);
3189
- oklab[2] = percentToAbsolute(noneToValue(oklab[2], 0), -.4, .4, true);
3190
- const rgb = roundRGB(oklab2rgb_default(oklab));
3191
- rgb[3] = m[4] !== void 0 ? +percentToAbsolute(m[4], 0, 1) : 1;
3192
- return rgb;
3193
- }
3194
- if (m = css.match(RE_OKLCH)) {
3195
- const oklch = m.slice(1, 4);
3196
- oklch[0] = percentToAbsolute(noneToValue(oklch[0], 0), 0, 1);
3197
- oklch[1] = percentToAbsolute(noneToValue(oklch[1], 0), 0, .4, false);
3198
- oklch[2] = +noneToValue(oklch[2].replace("deg", ""), 0);
3199
- const rgb = roundRGB(oklch2rgb_default(oklch));
3200
- rgb[3] = m[4] !== void 0 ? +percentToAbsolute(m[4], 0, 1) : 1;
3201
- return rgb;
3202
- }
3203
- };
3204
- css2rgb.test = (s) => {
3205
- return RE_RGB.test(s) || RE_HSL.test(s) || RE_LAB.test(s) || RE_LCH.test(s) || RE_OKLAB.test(s) || RE_OKLCH.test(s) || RE_RGB_LEGACY.test(s) || RE_RGBA_LEGACY.test(s) || RE_HSL_LEGACY.test(s) || RE_HSLA_LEGACY.test(s) || s === "transparent";
3206
- };
3207
- var css2rgb_default = css2rgb;
3208
-
3209
- //#endregion
3210
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/io/css/index.js
3211
- Color_default.prototype.css = function(mode) {
3212
- return rgb2css_default(this._rgb, mode);
3213
- };
3214
- const css = (...args) => new Color_default(...args, "css");
3215
- chroma_default.css = css;
3216
- input_default.format.css = css2rgb_default;
3217
- input_default.autodetect.push({
3218
- p: 5,
3219
- test: (h, ...rest) => {
3220
- if (!rest.length && type_default(h) === "string" && css2rgb_default.test(h)) return "css";
3221
- }
3222
- });
3223
-
3224
- //#endregion
3225
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/io/gl/index.js
3226
- input_default.format.gl = (...args) => {
3227
- const rgb = unpack_default(args, "rgba");
3228
- rgb[0] *= 255;
3229
- rgb[1] *= 255;
3230
- rgb[2] *= 255;
3231
- return rgb;
3232
- };
3233
- const gl = (...args) => new Color_default(...args, "gl");
3234
- chroma_default.gl = gl;
3235
- Color_default.prototype.gl = function() {
3236
- const rgb = this._rgb;
3237
- return [
3238
- rgb[0] / 255,
3239
- rgb[1] / 255,
3240
- rgb[2] / 255,
3241
- rgb[3]
3242
- ];
3243
- };
3244
-
3245
- //#endregion
3246
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/io/hex/index.js
3247
- Color_default.prototype.hex = function(mode) {
3248
- return rgb2hex_default(this._rgb, mode);
3249
- };
3250
- const hex = (...args) => new Color_default(...args, "hex");
3251
- chroma_default.hex = hex;
3252
- input_default.format.hex = hex2rgb_default;
3253
- input_default.autodetect.push({
3254
- p: 4,
3255
- test: (h, ...rest) => {
3256
- if (!rest.length && type_default(h) === "string" && [
3257
- 3,
3258
- 4,
3259
- 5,
3260
- 6,
3261
- 7,
3262
- 8,
3263
- 9
3264
- ].indexOf(h.length) >= 0) return "hex";
3265
- }
3266
- });
3267
-
3268
- //#endregion
3269
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/io/temp/temperature2rgb.js
3270
- const { log } = Math;
3271
- const temperature2rgb = (kelvin) => {
3272
- const temp = kelvin / 100;
3273
- let r, g, b;
3274
- if (temp < 66) {
3275
- r = 255;
3276
- g = temp < 6 ? 0 : -155.25485562709179 - .44596950469579133 * (g = temp - 2) + 104.49216199393888 * log(g);
3277
- b = temp < 20 ? 0 : -254.76935184120902 + .8274096064007395 * (b = temp - 10) + 115.67994401066147 * log(b);
3278
- } else {
3279
- r = 351.97690566805693 + .114206453784165 * (r = temp - 55) - 40.25366309332127 * log(r);
3280
- g = 325.4494125711974 + .07943456536662342 * (g = temp - 50) - 28.0852963507957 * log(g);
3281
- b = 255;
3282
- }
3283
- return [
3284
- r,
3285
- g,
3286
- b,
3287
- 1
3288
- ];
3289
- };
3290
- var temperature2rgb_default = temperature2rgb;
3291
-
3292
- //#endregion
3293
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/io/temp/rgb2temperature.js
3294
- const { round } = Math;
3295
- const rgb2temperature = (...args) => {
3296
- const rgb = unpack_default(args, "rgb");
3297
- const r = rgb[0], b = rgb[2];
3298
- let minTemp = 1e3;
3299
- let maxTemp = 4e4;
3300
- const eps = .4;
3301
- let temp;
3302
- while (maxTemp - minTemp > eps) {
3303
- temp = (maxTemp + minTemp) * .5;
3304
- const rgb = temperature2rgb_default(temp);
3305
- if (rgb[2] / rgb[0] >= b / r) maxTemp = temp;
3306
- else minTemp = temp;
3307
- }
3308
- return round(temp);
3309
- };
3310
- var rgb2temperature_default = rgb2temperature;
3311
-
3312
- //#endregion
3313
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/io/temp/index.js
3314
- Color_default.prototype.temp = Color_default.prototype.kelvin = Color_default.prototype.temperature = function() {
3315
- return rgb2temperature_default(this._rgb);
3316
- };
3317
- const temp = (...args) => new Color_default(...args, "temp");
3318
- Object.assign(chroma_default, {
3319
- temp,
3320
- kelvin: temp,
3321
- temperature: temp
3322
- });
3323
- input_default.format.temp = input_default.format.kelvin = input_default.format.temperature = temperature2rgb_default;
3324
-
3325
- //#endregion
3326
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/src/io/oklch/index.js
3327
- Color_default.prototype.oklch = function() {
3328
- return rgb2oklch_default(this._rgb);
3329
- };
3330
- const oklch = (...args) => new Color_default(...args, "oklch");
3331
- Object.assign(chroma_default, { oklch });
3332
- input_default.format.oklch = oklch2rgb_default;
3333
- input_default.autodetect.push({
3334
- p: 2,
3335
- test: (...args) => {
3336
- args = unpack_default(args, "oklch");
3337
- if (type_default(args) === "array" && args.length === 3) return "oklch";
3338
- }
3339
- });
3340
-
3341
- //#endregion
3342
- //#region ../../node_modules/.pnpm/chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840c5155f1e299d91bd40b2a8eb0f3e4c0c62d1c/node_modules/chroma-js/index.js
3343
- Object.assign(chroma_default, {
3344
- analyze,
3345
- average: average_default,
3346
- bezier: bezier_default,
3347
- blend: blend_default,
3348
- brewer: colorbrewer_default,
3349
- Color: Color_default,
3350
- colors: w3cx11_default,
3351
- contrast: contrast_default,
3352
- contrastAPCA: contrastAPCA_default,
3353
- cubehelix: cubehelix_default,
3354
- deltaE: delta_e_default,
3355
- distance: distance_default,
3356
- input: input_default,
3357
- interpolate: mix_default,
3358
- limits,
3359
- mix: mix_default,
3360
- random: random_default,
3361
- scale: scale_default,
3362
- scales: scales_default,
3363
- valid: valid_default
3364
- });
3365
- var chroma_js_default = chroma_default;
3366
-
3367
- //#endregion
3368
- //#region ../../node_modules/.pnpm/@mantine+colors-generator@8.3.13_chroma-js@3.2.0_patch_hash=d987322bee5bda6851d8538d840_5f8f37723442888f47e0bba4bb8659dc/node_modules/@mantine/colors-generator/esm/generate-colors.mjs
3369
- const LIGHTNESS_MAP = [
3370
- .96,
3371
- .907,
3372
- .805,
3373
- .697,
3374
- .605,
3375
- .547,
3376
- .518,
3377
- .445,
3378
- .395,
3379
- .34
3380
- ];
3381
- const SATURATION_MAP = [
3382
- .32,
3383
- .16,
3384
- .08,
3385
- .04,
3386
- 0,
3387
- 0,
3388
- .04,
3389
- .08,
3390
- .16,
3391
- .32
3392
- ];
3393
- function getClosestLightness(colorObject) {
3394
- const lightnessGoal = colorObject.get("hsl.l");
3395
- return LIGHTNESS_MAP.reduce((prev, curr) => Math.abs(curr - lightnessGoal) < Math.abs(prev - lightnessGoal) ? curr : prev);
3396
- }
3397
- function generateColorsMap(color) {
3398
- const colorObject = chroma_js_default(color);
3399
- const closestLightness = getClosestLightness(colorObject);
3400
- const baseColorIndex = LIGHTNESS_MAP.findIndex((l) => l === closestLightness);
3401
- const colors = LIGHTNESS_MAP.map((l) => colorObject.set("hsl.l", l)).map((c) => chroma_js_default(c)).map((c, i) => {
3402
- const saturationDelta = SATURATION_MAP[i] - SATURATION_MAP[baseColorIndex];
3403
- return saturationDelta >= 0 ? c.saturate(saturationDelta) : c.desaturate(saturationDelta * -1);
3404
- });
3405
- colors[baseColorIndex] = chroma_js_default(color);
3406
- return {
3407
- baseColorIndex,
3408
- colors
3409
- };
3410
- }
3411
- function generateColors(color) {
3412
- return generateColorsMap(color).colors.map((c) => c.hex());
3413
- }
3414
-
3415
- //#endregion
3416
- export { chroma_js_default as n, generateColors as t };
15
+ const W_offset=.027,R_scale=1.14,B_threshold=.022,B_exp=1.414;var contrastAPCA_default=(e,t)=>{e=new Color(e),t=new Color(t),e.alpha()<1&&(e=mix_default(t,e,e.alpha(),`rgb`));let n=lum(...e.rgb()),r=lum(...t.rgb()),i=n>=B_threshold?n:n+(B_threshold-n)**+B_exp,a=r>=B_threshold?r:r+(B_threshold-r)**+B_exp,o=a**.56-i**.57,s=a**.65-i**.62,c=Math.abs(a-i)<5e-4?0:i<a?o*R_scale:s*R_scale;return(Math.abs(c)<.1?0:c>0?c-W_offset:c+W_offset)*100};function lum(e,t,n){return .2126729*(e/255)**2.4+.7151522*(t/255)**2.4+.072175*(n/255)**2.4}const{sqrt,pow,min,max:max$1,atan2,abs,cos,sin,exp,PI}=Math;function delta_e_default(e,t,n=1,r=1,i=1){var a=function(e){return 360*e/(2*PI)},o=function(e){return 2*PI*e/360};e=new Color(e),t=new Color(t);let[s,c,l]=Array.from(e.lab()),[u,d,f]=Array.from(t.lab()),p=(s+u)/2,m=(sqrt(pow(c,2)+pow(l,2))+sqrt(pow(d,2)+pow(f,2)))/2,h=.5*(1-sqrt(pow(m,7)/(pow(m,7)+pow(25,7)))),g=c*(1+h),_=d*(1+h),v=sqrt(pow(g,2)+pow(l,2)),b=sqrt(pow(_,2)+pow(f,2)),x=(v+b)/2,S=a(atan2(l,g)),C=a(atan2(f,_)),w=S>=0?S:S+360,T=C>=0?C:C+360,E=abs(w-T)>180?(w+T+360)/2:(w+T)/2,D=1-.17*cos(o(E-30))+.24*cos(o(2*E))+.32*cos(o(3*E+6))-.2*cos(o(4*E-63)),O=T-w;O=abs(O)<=180?O:T<=w?O+360:O-360,O=2*sqrt(v*b)*sin(o(O)/2);let k=u-s,A=b-v,j=1+.015*pow(p-50,2)/sqrt(20+pow(p-50,2)),M=1+.045*x,N=1+.015*x*D,P=30*exp(-pow((E-275)/25,2)),F=-(2*sqrt(pow(x,7)/(pow(x,7)+pow(25,7))))*sin(2*o(P));return max$1(0,min(100,sqrt(pow(k/(n*j),2)+pow(A/(r*M),2)+pow(O/(i*N),2)+F*(A/(r*M))*(O/(i*N)))))}function distance_default(e,t,n=`lab`){e=new Color(e),t=new Color(t);let r=e.get(n),i=t.get(n),a=0;for(let e in r){let t=(r[e]||0)-(i[e]||0);a+=t*t}return Math.sqrt(a)}var valid_default=(...e)=>{try{return new Color(...e),!0}catch{return!1}},scales_default={cool(){return scale_default([chroma.hsl(180,1,.9),chroma.hsl(250,.7,.4)])},hot(){return scale_default([`#000`,`#f00`,`#ff0`,`#fff`],[0,.25,.75,1]).mode(`rgb`)}};const colorbrewer={OrRd:[`#fff7ec`,`#fee8c8`,`#fdd49e`,`#fdbb84`,`#fc8d59`,`#ef6548`,`#d7301f`,`#b30000`,`#7f0000`],PuBu:[`#fff7fb`,`#ece7f2`,`#d0d1e6`,`#a6bddb`,`#74a9cf`,`#3690c0`,`#0570b0`,`#045a8d`,`#023858`],BuPu:[`#f7fcfd`,`#e0ecf4`,`#bfd3e6`,`#9ebcda`,`#8c96c6`,`#8c6bb1`,`#88419d`,`#810f7c`,`#4d004b`],Oranges:[`#fff5eb`,`#fee6ce`,`#fdd0a2`,`#fdae6b`,`#fd8d3c`,`#f16913`,`#d94801`,`#a63603`,`#7f2704`],BuGn:[`#f7fcfd`,`#e5f5f9`,`#ccece6`,`#99d8c9`,`#66c2a4`,`#41ae76`,`#238b45`,`#006d2c`,`#00441b`],YlOrBr:[`#ffffe5`,`#fff7bc`,`#fee391`,`#fec44f`,`#fe9929`,`#ec7014`,`#cc4c02`,`#993404`,`#662506`],YlGn:[`#ffffe5`,`#f7fcb9`,`#d9f0a3`,`#addd8e`,`#78c679`,`#41ab5d`,`#238443`,`#006837`,`#004529`],Reds:[`#fff5f0`,`#fee0d2`,`#fcbba1`,`#fc9272`,`#fb6a4a`,`#ef3b2c`,`#cb181d`,`#a50f15`,`#67000d`],RdPu:[`#fff7f3`,`#fde0dd`,`#fcc5c0`,`#fa9fb5`,`#f768a1`,`#dd3497`,`#ae017e`,`#7a0177`,`#49006a`],Greens:[`#f7fcf5`,`#e5f5e0`,`#c7e9c0`,`#a1d99b`,`#74c476`,`#41ab5d`,`#238b45`,`#006d2c`,`#00441b`],YlGnBu:[`#ffffd9`,`#edf8b1`,`#c7e9b4`,`#7fcdbb`,`#41b6c4`,`#1d91c0`,`#225ea8`,`#253494`,`#081d58`],Purples:[`#fcfbfd`,`#efedf5`,`#dadaeb`,`#bcbddc`,`#9e9ac8`,`#807dba`,`#6a51a3`,`#54278f`,`#3f007d`],GnBu:[`#f7fcf0`,`#e0f3db`,`#ccebc5`,`#a8ddb5`,`#7bccc4`,`#4eb3d3`,`#2b8cbe`,`#0868ac`,`#084081`],Greys:[`#ffffff`,`#f0f0f0`,`#d9d9d9`,`#bdbdbd`,`#969696`,`#737373`,`#525252`,`#252525`,`#000000`],YlOrRd:[`#ffffcc`,`#ffeda0`,`#fed976`,`#feb24c`,`#fd8d3c`,`#fc4e2a`,`#e31a1c`,`#bd0026`,`#800026`],PuRd:[`#f7f4f9`,`#e7e1ef`,`#d4b9da`,`#c994c7`,`#df65b0`,`#e7298a`,`#ce1256`,`#980043`,`#67001f`],Blues:[`#f7fbff`,`#deebf7`,`#c6dbef`,`#9ecae1`,`#6baed6`,`#4292c6`,`#2171b5`,`#08519c`,`#08306b`],PuBuGn:[`#fff7fb`,`#ece2f0`,`#d0d1e6`,`#a6bddb`,`#67a9cf`,`#3690c0`,`#02818a`,`#016c59`,`#014636`],Viridis:[`#440154`,`#482777`,`#3f4a8a`,`#31678e`,`#26838f`,`#1f9d8a`,`#6cce5a`,`#b6de2b`,`#fee825`],Spectral:[`#9e0142`,`#d53e4f`,`#f46d43`,`#fdae61`,`#fee08b`,`#ffffbf`,`#e6f598`,`#abdda4`,`#66c2a5`,`#3288bd`,`#5e4fa2`],RdYlGn:[`#a50026`,`#d73027`,`#f46d43`,`#fdae61`,`#fee08b`,`#ffffbf`,`#d9ef8b`,`#a6d96a`,`#66bd63`,`#1a9850`,`#006837`],RdBu:[`#67001f`,`#b2182b`,`#d6604d`,`#f4a582`,`#fddbc7`,`#f7f7f7`,`#d1e5f0`,`#92c5de`,`#4393c3`,`#2166ac`,`#053061`],PiYG:[`#8e0152`,`#c51b7d`,`#de77ae`,`#f1b6da`,`#fde0ef`,`#f7f7f7`,`#e6f5d0`,`#b8e186`,`#7fbc41`,`#4d9221`,`#276419`],PRGn:[`#40004b`,`#762a83`,`#9970ab`,`#c2a5cf`,`#e7d4e8`,`#f7f7f7`,`#d9f0d3`,`#a6dba0`,`#5aae61`,`#1b7837`,`#00441b`],RdYlBu:[`#a50026`,`#d73027`,`#f46d43`,`#fdae61`,`#fee090`,`#ffffbf`,`#e0f3f8`,`#abd9e9`,`#74add1`,`#4575b4`,`#313695`],BrBG:[`#543005`,`#8c510a`,`#bf812d`,`#dfc27d`,`#f6e8c3`,`#f5f5f5`,`#c7eae5`,`#80cdc1`,`#35978f`,`#01665e`,`#003c30`],RdGy:[`#67001f`,`#b2182b`,`#d6604d`,`#f4a582`,`#fddbc7`,`#ffffff`,`#e0e0e0`,`#bababa`,`#878787`,`#4d4d4d`,`#1a1a1a`],PuOr:[`#7f3b08`,`#b35806`,`#e08214`,`#fdb863`,`#fee0b6`,`#f7f7f7`,`#d8daeb`,`#b2abd2`,`#8073ac`,`#542788`,`#2d004b`],Set2:[`#66c2a5`,`#fc8d62`,`#8da0cb`,`#e78ac3`,`#a6d854`,`#ffd92f`,`#e5c494`,`#b3b3b3`],Accent:[`#7fc97f`,`#beaed4`,`#fdc086`,`#ffff99`,`#386cb0`,`#f0027f`,`#bf5b17`,`#666666`],Set1:[`#e41a1c`,`#377eb8`,`#4daf4a`,`#984ea3`,`#ff7f00`,`#ffff33`,`#a65628`,`#f781bf`,`#999999`],Set3:[`#8dd3c7`,`#ffffb3`,`#bebada`,`#fb8072`,`#80b1d3`,`#fdb462`,`#b3de69`,`#fccde5`,`#d9d9d9`,`#bc80bd`,`#ccebc5`,`#ffed6f`],Dark2:[`#1b9e77`,`#d95f02`,`#7570b3`,`#e7298a`,`#66a61e`,`#e6ab02`,`#a6761d`,`#666666`],Paired:[`#a6cee3`,`#1f78b4`,`#b2df8a`,`#33a02c`,`#fb9a99`,`#e31a1c`,`#fdbf6f`,`#ff7f00`,`#cab2d6`,`#6a3d9a`,`#ffff99`,`#b15928`],Pastel2:[`#b3e2cd`,`#fdcdac`,`#cbd5e8`,`#f4cae4`,`#e6f5c9`,`#fff2ae`,`#f1e2cc`,`#cccccc`],Pastel1:[`#fbb4ae`,`#b3cde3`,`#ccebc5`,`#decbe4`,`#fed9a6`,`#ffffcc`,`#e5d8bd`,`#fddaec`,`#f2f2f2`]},colorbrewerTypes=Object.keys(colorbrewer),typeMap=new Map(colorbrewerTypes.map(e=>[e.toLowerCase(),e])),colorbrewerProxy=typeof Proxy==`function`?new Proxy(colorbrewer,{get(e,t){let n=t.toLowerCase();if(typeMap.has(n))return e[typeMap.get(n)]},getOwnPropertyNames(){return Object.getOwnPropertyNames(colorbrewerTypes)}}):colorbrewer,cmyk2rgb=(...e)=>{e=unpack_default(e,`cmyk`);let[t,n,r,i]=e,a=e.length>4?e[4]:1;return i===1?[0,0,0,a]:[t>=1?0:255*(1-t)*(1-i),n>=1?0:255*(1-n)*(1-i),r>=1?0:255*(1-r)*(1-i),a]},{max}=Math,rgb2cmyk=(...e)=>{let[t,n,r]=unpack_default(e,`rgb`);t/=255,n/=255,r/=255;let i=1-max(t,max(n,r)),a=i<1?1/(1-i):0;return[(1-t-i)*a,(1-n-i)*a,(1-r-i)*a,i]};Color.prototype.cmyk=function(){return rgb2cmyk(this._rgb)};const cmyk=(...e)=>new Color(...e,`cmyk`);Object.assign(chroma,{cmyk}),input_default.format.cmyk=cmyk2rgb,input_default.autodetect.push({p:2,test:(...e)=>{if(e=unpack_default(e,`cmyk`),type_default(e)===`array`&&e.length===4)return`cmyk`}});const hsl2css=(...e)=>{let t=unpack_default(e,`hsla`),n=last_default(e)||`lsa`;return t[0]=rnd2(t[0]||0)+`deg`,t[1]=rnd2(t[1]*100)+`%`,t[2]=rnd2(t[2]*100)+`%`,n===`hsla`||t.length>3&&t[3]<1?(t[3]=`/ `+(t.length>3?t[3]:1),n=`hsla`):t.length=3,`${n.substr(0,3)}(${t.join(` `)})`},lab2css=(...e)=>{let t=unpack_default(e,`lab`),n=last_default(e)||`lab`;return t[0]=rnd2(t[0])+`%`,t[1]=rnd2(t[1]),t[2]=rnd2(t[2]),n===`laba`||t.length>3&&t[3]<1?t[3]=`/ `+(t.length>3?t[3]:1):t.length=3,`lab(${t.join(` `)})`},lch2css=(...e)=>{let t=unpack_default(e,`lch`),n=last_default(e)||`lab`;return t[0]=rnd2(t[0])+`%`,t[1]=rnd2(t[1]),t[2]=isNaN(t[2])?`none`:rnd2(t[2])+`deg`,n===`lcha`||t.length>3&&t[3]<1?t[3]=`/ `+(t.length>3?t[3]:1):t.length=3,`lch(${t.join(` `)})`},oklab2css=(...e)=>{let t=unpack_default(e,`lab`);return t[0]=rnd2(t[0]*100)+`%`,t[1]=rnd3(t[1]),t[2]=rnd3(t[2]),t.length>3&&t[3]<1?t[3]=`/ `+(t.length>3?t[3]:1):t.length=3,`oklab(${t.join(` `)})`},rgb2oklch=(...e)=>{let[t,n,r,...i]=unpack_default(e,`rgb`),[a,s,c]=rgb2oklab(t,n,r),[l,u,d]=lab2lch(a,s,c);return[l,u,d,...i.length>0&&i[0]<1?[i[0]]:[]]},oklch2css=(...e)=>{let t=unpack_default(e,`lch`);return t[0]=rnd2(t[0]*100)+`%`,t[1]=rnd3(t[1]),t[2]=isNaN(t[2])?`none`:rnd2(t[2])+`deg`,t.length>3&&t[3]<1?t[3]=`/ `+(t.length>3?t[3]:1):t.length=3,`oklch(${t.join(` `)})`},{round:round$2}=Math,rgb2css=(...e)=>{let t=unpack_default(e,`rgba`),n=last_default(e)||`rgb`;if(n.substr(0,3)===`hsl`)return hsl2css(rgb2hsl$1(t),n);if(n.substr(0,3)===`lab`){let e=getLabWhitePoint();setLabWhitePoint(`d50`);let r=lab2css(rgb2lab(t),n);return setLabWhitePoint(e),r}if(n.substr(0,3)===`lch`){let e=getLabWhitePoint();setLabWhitePoint(`d50`);let r=lch2css(rgb2lch(t),n);return setLabWhitePoint(e),r}return n.substr(0,5)===`oklab`?oklab2css(rgb2oklab(t)):n.substr(0,5)===`oklch`?oklch2css(rgb2oklch(t)):(t[0]=round$2(t[0]),t[1]=round$2(t[1]),t[2]=round$2(t[2]),(n===`rgba`||t.length>3&&t[3]<1)&&(t[3]=`/ `+(t.length>3?t[3]:1),n=`rgba`),`${n.substr(0,3)}(${t.slice(0,n===`rgb`?3:4).join(` `)})`)},oklch2rgb=(...e)=>{e=unpack_default(e,`lch`);let[t,n,r,...i]=e,[a,s,c]=lch2lab(t,n,r),[l,u,d]=oklab2rgb(a,s,c);return[l,u,d,...i.length>0&&i[0]<1?[i[0]]:[]]},INT_OR_PCT=`((?:-?\\d+)|(?:-?\\d+(?:\\.\\d+)?)%|none)`,FLOAT_OR_PCT=`((?:-?(?:\\d+(?:\\.\\d*)?|\\.\\d+)%?)|none)`,PCT=`((?:-?(?:\\d+(?:\\.\\d*)?|\\.\\d+)%)|none)`,COMMA=`\\s*,\\s*`,ANLGE=`((?:-?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:deg)?)|none)`,ALPHA=`\\s*(?:\\/\\s*((?:[01]|[01]?\\.\\d+)|\\d+(?:\\.\\d+)?%))?`,RE_RGB=RegExp(`^rgba?\\(\\s*`+[INT_OR_PCT,INT_OR_PCT,INT_OR_PCT].join(`\\s+`)+ALPHA+`\\)$`),RE_RGB_LEGACY=RegExp(`^rgb\\(\\s*`+[INT_OR_PCT,INT_OR_PCT,INT_OR_PCT].join(COMMA)+`\\s*\\)$`),RE_RGBA_LEGACY=RegExp(`^rgba\\(\\s*`+[INT_OR_PCT,INT_OR_PCT,INT_OR_PCT,FLOAT_OR_PCT].join(COMMA)+`\\s*\\)$`),RE_HSL=RegExp(`^hsla?\\(\\s*`+[ANLGE,PCT,PCT].join(`\\s+`)+ALPHA+`\\)$`),RE_HSL_LEGACY=RegExp(`^hsl?\\(\\s*`+[ANLGE,PCT,PCT].join(COMMA)+`\\s*\\)$`),RE_HSLA_LEGACY=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,RE_LAB=RegExp(`^lab\\(\\s*`+[FLOAT_OR_PCT,FLOAT_OR_PCT,FLOAT_OR_PCT].join(`\\s+`)+ALPHA+`\\)$`),RE_LCH=RegExp(`^lch\\(\\s*`+[FLOAT_OR_PCT,FLOAT_OR_PCT,ANLGE].join(`\\s+`)+ALPHA+`\\)$`),RE_OKLAB=RegExp(`^oklab\\(\\s*`+[FLOAT_OR_PCT,FLOAT_OR_PCT,FLOAT_OR_PCT].join(`\\s+`)+ALPHA+`\\)$`),RE_OKLCH=RegExp(`^oklch\\(\\s*`+[FLOAT_OR_PCT,FLOAT_OR_PCT,ANLGE].join(`\\s+`)+ALPHA+`\\)$`),{round:round$1}=Math,roundRGB=e=>e.map((e,t)=>t<=2?limit_default(round$1(e),0,255):e),percentToAbsolute=(e,t=0,n=100,r=!1)=>(typeof e==`string`&&e.endsWith(`%`)&&(e=parseFloat(e.substring(0,e.length-1))/100,e=r?t+(e+1)*.5*(n-t):t+e*(n-t)),+e),noneToValue=(e,t)=>e===`none`?t:e,css2rgb=e=>{if(e=e.toLowerCase().trim(),e===`transparent`)return[0,0,0,0];let t;if(input_default.format.named)try{return input_default.format.named(e)}catch{}if((t=e.match(RE_RGB))||(t=e.match(RE_RGB_LEGACY))){let e=t.slice(1,4);for(let t=0;t<3;t++)e[t]=+percentToAbsolute(noneToValue(e[t],0),0,255);e=roundRGB(e);let n=t[4]===void 0?1:+percentToAbsolute(t[4],0,1);return e[3]=n,e}if(t=e.match(RE_RGBA_LEGACY)){let e=t.slice(1,5);for(let t=0;t<4;t++)e[t]=+percentToAbsolute(e[t],0,255);return e}if((t=e.match(RE_HSL))||(t=e.match(RE_HSL_LEGACY))){let e=t.slice(1,4);e[0]=+noneToValue(e[0].replace(`deg`,``),0),e[1]=percentToAbsolute(noneToValue(e[1],0),0,100)*.01,e[2]=percentToAbsolute(noneToValue(e[2],0),0,100)*.01;let n=roundRGB(hsl2rgb(e));return n[3]=t[4]===void 0?1:+percentToAbsolute(t[4],0,1),n}if(t=e.match(RE_HSLA_LEGACY)){let e=t.slice(1,4);e[1]*=.01,e[2]*=.01;let n=hsl2rgb(e);for(let e=0;e<3;e++)n[e]=round$1(n[e]);return n[3]=+t[4],n}if(t=e.match(RE_LAB)){let e=t.slice(1,4);e[0]=percentToAbsolute(noneToValue(e[0],0),0,100),e[1]=percentToAbsolute(noneToValue(e[1],0),-125,125,!0),e[2]=percentToAbsolute(noneToValue(e[2],0),-125,125,!0);let n=getLabWhitePoint();setLabWhitePoint(`d50`);let r=roundRGB(lab2rgb(e));return setLabWhitePoint(n),r[3]=t[4]===void 0?1:+percentToAbsolute(t[4],0,1),r}if(t=e.match(RE_LCH)){let e=t.slice(1,4);e[0]=percentToAbsolute(e[0],0,100),e[1]=percentToAbsolute(noneToValue(e[1],0),0,150,!1),e[2]=+noneToValue(e[2].replace(`deg`,``),0);let n=getLabWhitePoint();setLabWhitePoint(`d50`);let r=roundRGB(lch2rgb(e));return setLabWhitePoint(n),r[3]=t[4]===void 0?1:+percentToAbsolute(t[4],0,1),r}if(t=e.match(RE_OKLAB)){let e=t.slice(1,4);e[0]=percentToAbsolute(noneToValue(e[0],0),0,1),e[1]=percentToAbsolute(noneToValue(e[1],0),-.4,.4,!0),e[2]=percentToAbsolute(noneToValue(e[2],0),-.4,.4,!0);let n=roundRGB(oklab2rgb(e));return n[3]=t[4]===void 0?1:+percentToAbsolute(t[4],0,1),n}if(t=e.match(RE_OKLCH)){let e=t.slice(1,4);e[0]=percentToAbsolute(noneToValue(e[0],0),0,1),e[1]=percentToAbsolute(noneToValue(e[1],0),0,.4,!1),e[2]=+noneToValue(e[2].replace(`deg`,``),0);let n=roundRGB(oklch2rgb(e));return n[3]=t[4]===void 0?1:+percentToAbsolute(t[4],0,1),n}};css2rgb.test=e=>RE_RGB.test(e)||RE_HSL.test(e)||RE_LAB.test(e)||RE_LCH.test(e)||RE_OKLAB.test(e)||RE_OKLCH.test(e)||RE_RGB_LEGACY.test(e)||RE_RGBA_LEGACY.test(e)||RE_HSL_LEGACY.test(e)||RE_HSLA_LEGACY.test(e)||e===`transparent`,Color.prototype.css=function(e){return rgb2css(this._rgb,e)};const css=(...e)=>new Color(...e,`css`);chroma.css=css,input_default.format.css=css2rgb,input_default.autodetect.push({p:5,test:(e,...t)=>{if(!t.length&&type_default(e)===`string`&&css2rgb.test(e))return`css`}}),input_default.format.gl=(...e)=>{let t=unpack_default(e,`rgba`);return t[0]*=255,t[1]*=255,t[2]*=255,t};const gl=(...e)=>new Color(...e,`gl`);chroma.gl=gl,Color.prototype.gl=function(){let e=this._rgb;return[e[0]/255,e[1]/255,e[2]/255,e[3]]},Color.prototype.hex=function(e){return rgb2hex(this._rgb,e)};const hex=(...e)=>new Color(...e,`hex`);chroma.hex=hex,input_default.format.hex=hex2rgb,input_default.autodetect.push({p:4,test:(e,...t)=>{if(!t.length&&type_default(e)===`string`&&[3,4,5,6,7,8,9].indexOf(e.length)>=0)return`hex`}});const{log}=Math,temperature2rgb=e=>{let t=e/100,n,r,i;return t<66?(n=255,r=t<6?0:-155.25485562709179-.44596950469579133*(r=t-2)+104.49216199393888*log(r),i=t<20?0:-254.76935184120902+.8274096064007395*(i=t-10)+115.67994401066147*log(i)):(n=351.97690566805693+.114206453784165*(n=t-55)-40.25366309332127*log(n),r=325.4494125711974+.07943456536662342*(r=t-50)-28.0852963507957*log(r),i=255),[n,r,i,1]},{round}=Math,rgb2temperature=(...e)=>{let t=unpack_default(e,`rgb`),n=t[0],r=t[2],i=1e3,a=4e4,s;for(;a-i>.4;){s=(a+i)*.5;let e=temperature2rgb(s);e[2]/e[0]>=r/n?a=s:i=s}return round(s)};Color.prototype.temp=Color.prototype.kelvin=Color.prototype.temperature=function(){return rgb2temperature(this._rgb)};const temp=(...e)=>new Color(...e,`temp`);Object.assign(chroma,{temp,kelvin:temp,temperature:temp}),input_default.format.temp=input_default.format.kelvin=input_default.format.temperature=temperature2rgb,Color.prototype.oklch=function(){return rgb2oklch(this._rgb)};const oklch=(...e)=>new Color(...e,`oklch`);Object.assign(chroma,{oklch}),input_default.format.oklch=oklch2rgb,input_default.autodetect.push({p:2,test:(...e)=>{if(e=unpack_default(e,`oklch`),type_default(e)===`array`&&e.length===3)return`oklch`}}),Object.assign(chroma,{analyze,average:average_default,bezier:bezier_default,blend,brewer:colorbrewerProxy,Color,colors:w3cx11,contrast:contrast_default,contrastAPCA:contrastAPCA_default,cubehelix:cubehelix_default,deltaE:delta_e_default,distance:distance_default,input:input_default,interpolate:mix_default,limits,mix:mix_default,random:random_default,scale:scale_default,scales:scales_default,valid:valid_default});var chroma_js_default=chroma;const LIGHTNESS_MAP=[.96,.907,.805,.697,.605,.547,.518,.445,.395,.34],SATURATION_MAP=[.32,.16,.08,.04,0,0,.04,.08,.16,.32];function getClosestLightness(e){let t=e.get(`hsl.l`);return LIGHTNESS_MAP.reduce((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e)}function generateColorsMap(e){let t=chroma_js_default(e),n=getClosestLightness(t),r=LIGHTNESS_MAP.findIndex(e=>e===n),i=LIGHTNESS_MAP.map(e=>t.set(`hsl.l`,e)).map(e=>chroma_js_default(e)).map((e,t)=>{let n=SATURATION_MAP[t]-SATURATION_MAP[r];return n>=0?e.saturate(n):e.desaturate(n*-1)});return i[r]=chroma_js_default(e),{baseColorIndex:r,colors:i}}function generateColors(e){return generateColorsMap(e).colors.map(e=>e.hex())}export{chroma_js_default as n,generateColors as t};