@likec4/core 1.47.0 → 1.48.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.
- package/LICENSE +1 -1
- package/dist/_chunks/Builder.view-element.mjs +3284 -0
- package/dist/_chunks/LikeC4Model.d.mts +1287 -0
- package/dist/_chunks/LikeC4Styles.mjs +691 -0
- package/dist/_chunks/RichText.d.mts +84 -0
- package/dist/_chunks/RichText.mjs +148 -0
- package/dist/_chunks/_aux.d.mts +289 -0
- package/dist/_chunks/_aux.mjs +18 -0
- package/dist/_chunks/_types.d.mts +781 -0
- package/dist/_chunks/_types2.d.mts +38 -0
- package/dist/_chunks/assignTagColors.mjs +24 -0
- package/dist/_chunks/calcDriftsFromSnapshot.mjs +379 -0
- package/dist/_chunks/connection.mjs +0 -0
- package/dist/_chunks/const.d.mts +43 -0
- package/dist/_chunks/const.mjs +33 -0
- package/dist/_chunks/expression-model.d.mts +192 -0
- package/dist/_chunks/expression-model.mjs +103 -0
- package/dist/_chunks/expression.d.mts +347 -0
- package/dist/_chunks/expression.mjs +107 -0
- package/dist/_chunks/find.d.mts +82 -0
- package/dist/_chunks/find.mjs +646 -0
- package/dist/_chunks/find2.d.mts +78 -0
- package/dist/_chunks/find2.mjs +287 -0
- package/dist/_chunks/fqnRef.d.mts +58 -0
- package/dist/_chunks/fqnRef.mjs +41 -0
- package/dist/_chunks/geometry.mjs +335 -0
- package/dist/_chunks/index.d.mts +169 -0
- package/dist/_chunks/index2.d.mts +937 -0
- package/dist/_chunks/index3.d.mts +146 -0
- package/dist/_chunks/index4.d.mts +62 -0
- package/dist/_chunks/index5.d.mts +42 -0
- package/dist/_chunks/index6.d.mts +43 -0
- package/dist/{shared/core.OtRNdMxy.d.mts → _chunks/index7.d.mts} +113 -197
- package/dist/_chunks/index8.d.mts +144 -0
- package/dist/_chunks/invariant.mjs +18 -0
- package/dist/_chunks/iterable.mjs +146 -0
- package/dist/_chunks/libs/@mantine/colors-generator.mjs +3416 -0
- package/dist/_chunks/libs/@ungap/structured-clone.mjs +213 -0
- package/dist/_chunks/libs/bail.mjs +14 -0
- package/dist/_chunks/libs/ccount.mjs +25 -0
- package/dist/_chunks/libs/character-entities-html4.mjs +263 -0
- package/dist/_chunks/libs/character-entities-legacy.mjs +117 -0
- package/dist/_chunks/libs/character-entities.mjs +2136 -0
- package/dist/_chunks/libs/comma-separated-tokens.mjs +18 -0
- package/dist/_chunks/libs/decode-named-character-reference.mjs +21 -0
- package/dist/_chunks/libs/defu.mjs +42 -0
- package/dist/_chunks/libs/devlop.mjs +5 -0
- package/dist/_chunks/libs/escape-string-regexp.mjs +8 -0
- package/dist/_chunks/libs/extend.mjs +77 -0
- package/dist/_chunks/libs/graphology-dag.mjs +703 -0
- package/dist/_chunks/libs/graphology-types.d.mts +601 -0
- package/dist/_chunks/libs/graphology.d.mts +6 -0
- package/dist/_chunks/libs/graphology.mjs +4565 -0
- package/dist/_chunks/libs/hast-util-sanitize.mjs +863 -0
- package/dist/_chunks/libs/hast-util-to-html.mjs +2696 -0
- package/dist/_chunks/libs/is-plain-obj.mjs +9 -0
- package/dist/_chunks/libs/longest-streak.mjs +30 -0
- package/dist/_chunks/libs/markdown-table.mjs +290 -0
- package/dist/_chunks/libs/mdast-util-find-and-replace.mjs +653 -0
- package/dist/_chunks/libs/mdast-util-from-markdown.mjs +8522 -0
- package/dist/_chunks/libs/mdast-util-gfm.mjs +2393 -0
- package/dist/_chunks/libs/mdast-util-to-hast.mjs +1803 -0
- package/dist/_chunks/libs/micromark-extension-gfm.mjs +2243 -0
- package/dist/_chunks/libs/mnemonist.d.mts +254 -0
- package/dist/_chunks/libs/mnemonist.mjs +1978 -0
- package/dist/_chunks/libs/natural-compare-lite.mjs +42 -0
- package/dist/_chunks/libs/rehype-sanitize.mjs +29 -0
- package/dist/_chunks/libs/rehype-stringify.mjs +34 -0
- package/dist/_chunks/libs/remark-gfm.mjs +36 -0
- package/dist/_chunks/libs/remark-github-blockquote-alert.mjs +100 -0
- package/dist/_chunks/libs/remark-parse.mjs +39 -0
- package/dist/_chunks/libs/remark-rehype.mjs +171 -0
- package/dist/_chunks/libs/remeda.mjs +702 -0
- package/dist/_chunks/libs/trough.mjs +158 -0
- package/dist/_chunks/libs/unified.mjs +2212 -0
- package/dist/_chunks/mnemonist.d.mts +1 -0
- package/dist/_chunks/mnemonist.mjs +0 -0
- package/dist/_chunks/model.mjs +1898 -0
- package/dist/_chunks/model2.mjs +0 -0
- package/dist/_chunks/relationships-view.mjs +132 -0
- package/dist/_chunks/rolldown-runtime.mjs +42 -0
- package/dist/{shared/core.C_3y3eqV.d.mts → _chunks/scalar.d.mts} +13 -43
- package/dist/_chunks/scalar.mjs +84 -0
- package/dist/_chunks/utils.mjs +483 -0
- package/dist/builder/index.d.mts +11 -775
- package/dist/builder/index.mjs +631 -1022
- package/dist/compute-view/index.d.mts +85 -56
- package/dist/compute-view/index.mjs +247 -214
- package/dist/compute-view/relationships-view/index.d.mts +16 -51
- package/dist/compute-view/relationships-view/index.mjs +6 -184
- package/dist/geometry/index.d.mts +2 -109
- package/dist/geometry/index.mjs +2 -327
- package/dist/index.d.mts +18 -20
- package/dist/index.mjs +27 -18
- package/dist/model/connection/deployment/index.d.mts +12 -15
- package/dist/model/connection/deployment/index.mjs +9 -2
- package/dist/model/connection/index.d.mts +14 -75
- package/dist/model/connection/index.mjs +10 -3
- package/dist/model/connection/model/index.d.mts +12 -15
- package/dist/model/connection/model/index.mjs +8 -2
- package/dist/model/index.d.mts +15 -57
- package/dist/model/index.mjs +11 -4
- package/dist/styles/index.d.mts +9 -117
- package/dist/styles/index.mjs +26 -59
- package/dist/types/RichText.d.mts +3 -0
- package/dist/types/RichText.mjs +7 -0
- package/dist/types/_aux.d.mts +3 -4
- package/dist/types/_aux.mjs +2 -7
- package/dist/types/expression-model.d.mts +6 -190
- package/dist/types/expression-model.mjs +6 -108
- package/dist/types/expression.d.mts +5 -6
- package/dist/types/expression.mjs +6 -112
- package/dist/types/fqnRef.d.mts +4 -60
- package/dist/types/fqnRef.mjs +6 -44
- package/dist/types/index.d.mts +9 -47
- package/dist/types/index.mjs +14 -16
- package/dist/types/scalar.d.mts +2 -2
- package/dist/types/scalar.mjs +7 -4
- package/dist/utils/graphology/index.d.mts +2 -1864
- package/dist/utils/graphology/index.mjs +3 -1
- package/dist/utils/index.d.mts +11 -124
- package/dist/utils/index.mjs +16 -43
- package/dist/utils/iterable/index.d.mts +9 -132
- package/dist/utils/iterable/index.mjs +2 -61
- package/dist/utils/mnemonist.d.mts +2 -0
- package/dist/utils/mnemonist.mjs +12 -0
- package/package.json +17 -22
- package/compute-view/relationships/package.json +0 -4
- package/dist/shared/core.3ZhnKAlZ.mjs +0 -106
- package/dist/shared/core.78IWAHAE.mjs +0 -332
- package/dist/shared/core.B85MJLTf.mjs +0 -5
- package/dist/shared/core.BFd1lU9R.mjs +0 -29
- package/dist/shared/core.BKlholso.mjs +0 -3
- package/dist/shared/core.BNN-3vPH.mjs +0 -1255
- package/dist/shared/core.BPGOjone.d.mts +0 -46
- package/dist/shared/core.BP_QHEXs.mjs +0 -785
- package/dist/shared/core.BbE4y-yl.mjs +0 -177
- package/dist/shared/core.Bdy3hhTc.mjs +0 -28382
- package/dist/shared/core.BfCKSW-g.d.mts +0 -1266
- package/dist/shared/core.BhNcrwzK.mjs +0 -7
- package/dist/shared/core.BkVA6gjl.mjs +0 -5
- package/dist/shared/core.BoYfZOBm.mjs +0 -3
- package/dist/shared/core.BsSXS-_R.mjs +0 -7
- package/dist/shared/core.C3JowhaZ.mjs +0 -32
- package/dist/shared/core.C4x8aaWa.mjs +0 -27
- package/dist/shared/core.CAgYpDtM.d.mts +0 -98
- package/dist/shared/core.CHf8VEa3.mjs +0 -1206
- package/dist/shared/core.CLSZtnFh.mjs +0 -69
- package/dist/shared/core.CbT8JVYL.mjs +0 -5
- package/dist/shared/core.CdNCAwq7.mjs +0 -176
- package/dist/shared/core.CmGY9blO.mjs +0 -6717
- package/dist/shared/core.CmPXpJ8l.mjs +0 -21
- package/dist/shared/core.Coi_LOUZ.mjs +0 -7
- package/dist/shared/core.CqAJJpK_.mjs +0 -3
- package/dist/shared/core.CywrQs86.d.mts +0 -31
- package/dist/shared/core.D00YbOhQ.d.mts +0 -300
- package/dist/shared/core.D0WZutNd.mjs +0 -94
- package/dist/shared/core.D4npX2q8.mjs +0 -18
- package/dist/shared/core.DB0Ue5Wx.d.mts +0 -70
- package/dist/shared/core.DC5IAaDT.d.mts +0 -334
- package/dist/shared/core.DE9qzhn8.d.mts +0 -83
- package/dist/shared/core.DGcIbsj4.mjs +0 -3946
- package/dist/shared/core.DH7TXqXf.mjs +0 -136
- package/dist/shared/core.DKhRkHRN.d.mts +0 -41
- package/dist/shared/core.DRJma0Ol.mjs +0 -22
- package/dist/shared/core.DU5SRqNF.mjs +0 -2209
- package/dist/shared/core.DXhDWKFZ.d.mts +0 -3
- package/dist/shared/core.DbfO90vF.mjs +0 -434
- package/dist/shared/core.DcS-0zys.mjs +0 -10
- package/dist/shared/core.Dh119QSP.mjs +0 -4995
- package/dist/shared/core.DjcWextK.mjs +0 -1371
- package/dist/shared/core.Dojz4bvg.d.mts +0 -504
- package/dist/shared/core.FZ305VYd.mjs +0 -21
- package/dist/shared/core.RfnaEmgA.mjs +0 -7
- package/dist/shared/core.btEq3i3f.mjs +0 -300
- package/dist/shared/core.oSV6SRfk.mjs +0 -13
- package/dist/shared/core.om36dXXW.mjs +0 -41
- package/dist/shared/core.osFs8tU7.d.mts +0 -466
- package/dist/shared/core.q10OP9oJ.mjs +0 -5
- package/dist/shared/core.tpvDGvdC.d.mts +0 -87
- package/dist/shared/core.uFk_o9X6.mjs +0 -13
|
@@ -0,0 +1,3416 @@
|
|
|
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
|
|
2282
|
+
/**
|
|
2283
|
+
* @license
|
|
2284
|
+
*
|
|
2285
|
+
* The APCA contrast prediction algorithm is based of the formulas published
|
|
2286
|
+
* in the APCA-1.0.98G specification by Myndex. The specification is available at:
|
|
2287
|
+
* https://raw.githubusercontent.com/Myndex/apca-w3/master/images/APCAw3_0.1.17_APCA0.0.98G.svg
|
|
2288
|
+
*
|
|
2289
|
+
* Note that the APCA implementation is still beta, so please update to
|
|
2290
|
+
* future versions of chroma.js when they become available.
|
|
2291
|
+
*
|
|
2292
|
+
* You can read more about the APCA Readability Criterion at
|
|
2293
|
+
* https://readtech.org/ARC/
|
|
2294
|
+
*/
|
|
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 };
|