@tradejs/strategies 2.0.4 → 2.0.6
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/dist/index.js +944 -1113
- package/dist/index.mjs +944 -1113
- package/package.json +6 -6
package/dist/index.mjs
CHANGED
|
@@ -10,11 +10,20 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
10
10
|
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
11
11
|
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
12
12
|
});
|
|
13
|
-
var __esm = (fn, res) => function __init() {
|
|
14
|
-
|
|
13
|
+
var __esm = (fn, res, err) => function __init() {
|
|
14
|
+
if (err) throw err[0];
|
|
15
|
+
try {
|
|
16
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
17
|
+
} catch (e) {
|
|
18
|
+
throw err = [e], e;
|
|
19
|
+
}
|
|
15
20
|
};
|
|
16
21
|
var __commonJS = (cb, mod) => function __require2() {
|
|
17
|
-
|
|
22
|
+
try {
|
|
23
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
24
|
+
} catch (e) {
|
|
25
|
+
throw mod = 0, e;
|
|
26
|
+
}
|
|
18
27
|
};
|
|
19
28
|
var __export = (target, all) => {
|
|
20
29
|
for (var name in all)
|
|
@@ -2667,7 +2676,7 @@ var require_package = __commonJS({
|
|
|
2667
2676
|
module.exports = {
|
|
2668
2677
|
name: "winston",
|
|
2669
2678
|
description: "A logger for just about everything.",
|
|
2670
|
-
version: "3.
|
|
2679
|
+
version: "3.19.0",
|
|
2671
2680
|
author: "Charlie Robbins <charlie.robbins@gmail.com>",
|
|
2672
2681
|
maintainers: [
|
|
2673
2682
|
"David Hyde <dabh@alumni.stanford.edu>"
|
|
@@ -2690,7 +2699,7 @@ var require_package = __commonJS({
|
|
|
2690
2699
|
"stream"
|
|
2691
2700
|
],
|
|
2692
2701
|
dependencies: {
|
|
2693
|
-
"@dabh/diagnostics": "^2.0.
|
|
2702
|
+
"@dabh/diagnostics": "^2.0.8",
|
|
2694
2703
|
"@colors/colors": "^1.6.0",
|
|
2695
2704
|
async: "^3.2.3",
|
|
2696
2705
|
"is-stream": "^2.0.0",
|
|
@@ -2713,9 +2722,8 @@ var require_package = __commonJS({
|
|
|
2713
2722
|
"cross-spawn-async": "^2.2.5",
|
|
2714
2723
|
eslint: "^8.57.0",
|
|
2715
2724
|
hock: "^1.4.1",
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
rimraf: "5.0.1",
|
|
2725
|
+
jest: "^29.7.0",
|
|
2726
|
+
rimraf: "5.0.10",
|
|
2719
2727
|
split2: "^4.1.0",
|
|
2720
2728
|
"std-mocks": "^2.0.0",
|
|
2721
2729
|
through2: "^4.0.2",
|
|
@@ -2726,11 +2734,12 @@ var require_package = __commonJS({
|
|
|
2726
2734
|
types: "./index.d.ts",
|
|
2727
2735
|
scripts: {
|
|
2728
2736
|
lint: "eslint lib/*.js lib/winston/*.js lib/winston/**/*.js --resolve-plugins-relative-to ./node_modules/@dabh/eslint-config-populist",
|
|
2729
|
-
test: "
|
|
2730
|
-
"test:
|
|
2731
|
-
"test:
|
|
2732
|
-
"test:
|
|
2733
|
-
build: "
|
|
2737
|
+
test: "jest",
|
|
2738
|
+
"test:unit": "jest -c test/jest.config.unit.js",
|
|
2739
|
+
"test:integration": "jest -c test/jest.config.integration.js",
|
|
2740
|
+
"test:typescript": "npx --package typescript tsc --project test",
|
|
2741
|
+
build: "babel lib -d dist",
|
|
2742
|
+
prebuild: "rimraf dist",
|
|
2734
2743
|
prepublishOnly: "npm run build"
|
|
2735
2744
|
},
|
|
2736
2745
|
engines: {
|
|
@@ -3261,9 +3270,9 @@ var require_buffer_list = __commonJS({
|
|
|
3261
3270
|
}
|
|
3262
3271
|
});
|
|
3263
3272
|
|
|
3264
|
-
// ../../node_modules/
|
|
3273
|
+
// ../../node_modules/safe-buffer/index.js
|
|
3265
3274
|
var require_safe_buffer = __commonJS({
|
|
3266
|
-
"../../node_modules/
|
|
3275
|
+
"../../node_modules/safe-buffer/index.js"(exports, module) {
|
|
3267
3276
|
"use strict";
|
|
3268
3277
|
var buffer = __require("buffer");
|
|
3269
3278
|
var Buffer2 = buffer.Buffer;
|
|
@@ -3320,9 +3329,9 @@ var require_safe_buffer = __commonJS({
|
|
|
3320
3329
|
}
|
|
3321
3330
|
});
|
|
3322
3331
|
|
|
3323
|
-
// ../../node_modules/
|
|
3332
|
+
// ../../node_modules/string_decoder/lib/string_decoder.js
|
|
3324
3333
|
var require_string_decoder = __commonJS({
|
|
3325
|
-
"../../node_modules/
|
|
3334
|
+
"../../node_modules/string_decoder/lib/string_decoder.js"(exports) {
|
|
3326
3335
|
"use strict";
|
|
3327
3336
|
var Buffer2 = require_safe_buffer().Buffer;
|
|
3328
3337
|
var isEncoding = Buffer2.isEncoding || function(encoding) {
|
|
@@ -6414,306 +6423,250 @@ var require_production = __commonJS({
|
|
|
6414
6423
|
}
|
|
6415
6424
|
});
|
|
6416
6425
|
|
|
6417
|
-
// ../../node_modules
|
|
6418
|
-
var
|
|
6419
|
-
"../../node_modules
|
|
6420
|
-
"use strict";
|
|
6421
|
-
module.exports = {
|
|
6422
|
-
"aliceblue": [240, 248, 255],
|
|
6423
|
-
"antiquewhite": [250, 235, 215],
|
|
6424
|
-
"aqua": [0, 255, 255],
|
|
6425
|
-
"aquamarine": [127, 255, 212],
|
|
6426
|
-
"azure": [240, 255, 255],
|
|
6427
|
-
"beige": [245, 245, 220],
|
|
6428
|
-
"bisque": [255, 228, 196],
|
|
6429
|
-
"black": [0, 0, 0],
|
|
6430
|
-
"blanchedalmond": [255, 235, 205],
|
|
6431
|
-
"blue": [0, 0, 255],
|
|
6432
|
-
"blueviolet": [138, 43, 226],
|
|
6433
|
-
"brown": [165, 42, 42],
|
|
6434
|
-
"burlywood": [222, 184, 135],
|
|
6435
|
-
"cadetblue": [95, 158, 160],
|
|
6436
|
-
"chartreuse": [127, 255, 0],
|
|
6437
|
-
"chocolate": [210, 105, 30],
|
|
6438
|
-
"coral": [255, 127, 80],
|
|
6439
|
-
"cornflowerblue": [100, 149, 237],
|
|
6440
|
-
"cornsilk": [255, 248, 220],
|
|
6441
|
-
"crimson": [220, 20, 60],
|
|
6442
|
-
"cyan": [0, 255, 255],
|
|
6443
|
-
"darkblue": [0, 0, 139],
|
|
6444
|
-
"darkcyan": [0, 139, 139],
|
|
6445
|
-
"darkgoldenrod": [184, 134, 11],
|
|
6446
|
-
"darkgray": [169, 169, 169],
|
|
6447
|
-
"darkgreen": [0, 100, 0],
|
|
6448
|
-
"darkgrey": [169, 169, 169],
|
|
6449
|
-
"darkkhaki": [189, 183, 107],
|
|
6450
|
-
"darkmagenta": [139, 0, 139],
|
|
6451
|
-
"darkolivegreen": [85, 107, 47],
|
|
6452
|
-
"darkorange": [255, 140, 0],
|
|
6453
|
-
"darkorchid": [153, 50, 204],
|
|
6454
|
-
"darkred": [139, 0, 0],
|
|
6455
|
-
"darksalmon": [233, 150, 122],
|
|
6456
|
-
"darkseagreen": [143, 188, 143],
|
|
6457
|
-
"darkslateblue": [72, 61, 139],
|
|
6458
|
-
"darkslategray": [47, 79, 79],
|
|
6459
|
-
"darkslategrey": [47, 79, 79],
|
|
6460
|
-
"darkturquoise": [0, 206, 209],
|
|
6461
|
-
"darkviolet": [148, 0, 211],
|
|
6462
|
-
"deeppink": [255, 20, 147],
|
|
6463
|
-
"deepskyblue": [0, 191, 255],
|
|
6464
|
-
"dimgray": [105, 105, 105],
|
|
6465
|
-
"dimgrey": [105, 105, 105],
|
|
6466
|
-
"dodgerblue": [30, 144, 255],
|
|
6467
|
-
"firebrick": [178, 34, 34],
|
|
6468
|
-
"floralwhite": [255, 250, 240],
|
|
6469
|
-
"forestgreen": [34, 139, 34],
|
|
6470
|
-
"fuchsia": [255, 0, 255],
|
|
6471
|
-
"gainsboro": [220, 220, 220],
|
|
6472
|
-
"ghostwhite": [248, 248, 255],
|
|
6473
|
-
"gold": [255, 215, 0],
|
|
6474
|
-
"goldenrod": [218, 165, 32],
|
|
6475
|
-
"gray": [128, 128, 128],
|
|
6476
|
-
"green": [0, 128, 0],
|
|
6477
|
-
"greenyellow": [173, 255, 47],
|
|
6478
|
-
"grey": [128, 128, 128],
|
|
6479
|
-
"honeydew": [240, 255, 240],
|
|
6480
|
-
"hotpink": [255, 105, 180],
|
|
6481
|
-
"indianred": [205, 92, 92],
|
|
6482
|
-
"indigo": [75, 0, 130],
|
|
6483
|
-
"ivory": [255, 255, 240],
|
|
6484
|
-
"khaki": [240, 230, 140],
|
|
6485
|
-
"lavender": [230, 230, 250],
|
|
6486
|
-
"lavenderblush": [255, 240, 245],
|
|
6487
|
-
"lawngreen": [124, 252, 0],
|
|
6488
|
-
"lemonchiffon": [255, 250, 205],
|
|
6489
|
-
"lightblue": [173, 216, 230],
|
|
6490
|
-
"lightcoral": [240, 128, 128],
|
|
6491
|
-
"lightcyan": [224, 255, 255],
|
|
6492
|
-
"lightgoldenrodyellow": [250, 250, 210],
|
|
6493
|
-
"lightgray": [211, 211, 211],
|
|
6494
|
-
"lightgreen": [144, 238, 144],
|
|
6495
|
-
"lightgrey": [211, 211, 211],
|
|
6496
|
-
"lightpink": [255, 182, 193],
|
|
6497
|
-
"lightsalmon": [255, 160, 122],
|
|
6498
|
-
"lightseagreen": [32, 178, 170],
|
|
6499
|
-
"lightskyblue": [135, 206, 250],
|
|
6500
|
-
"lightslategray": [119, 136, 153],
|
|
6501
|
-
"lightslategrey": [119, 136, 153],
|
|
6502
|
-
"lightsteelblue": [176, 196, 222],
|
|
6503
|
-
"lightyellow": [255, 255, 224],
|
|
6504
|
-
"lime": [0, 255, 0],
|
|
6505
|
-
"limegreen": [50, 205, 50],
|
|
6506
|
-
"linen": [250, 240, 230],
|
|
6507
|
-
"magenta": [255, 0, 255],
|
|
6508
|
-
"maroon": [128, 0, 0],
|
|
6509
|
-
"mediumaquamarine": [102, 205, 170],
|
|
6510
|
-
"mediumblue": [0, 0, 205],
|
|
6511
|
-
"mediumorchid": [186, 85, 211],
|
|
6512
|
-
"mediumpurple": [147, 112, 219],
|
|
6513
|
-
"mediumseagreen": [60, 179, 113],
|
|
6514
|
-
"mediumslateblue": [123, 104, 238],
|
|
6515
|
-
"mediumspringgreen": [0, 250, 154],
|
|
6516
|
-
"mediumturquoise": [72, 209, 204],
|
|
6517
|
-
"mediumvioletred": [199, 21, 133],
|
|
6518
|
-
"midnightblue": [25, 25, 112],
|
|
6519
|
-
"mintcream": [245, 255, 250],
|
|
6520
|
-
"mistyrose": [255, 228, 225],
|
|
6521
|
-
"moccasin": [255, 228, 181],
|
|
6522
|
-
"navajowhite": [255, 222, 173],
|
|
6523
|
-
"navy": [0, 0, 128],
|
|
6524
|
-
"oldlace": [253, 245, 230],
|
|
6525
|
-
"olive": [128, 128, 0],
|
|
6526
|
-
"olivedrab": [107, 142, 35],
|
|
6527
|
-
"orange": [255, 165, 0],
|
|
6528
|
-
"orangered": [255, 69, 0],
|
|
6529
|
-
"orchid": [218, 112, 214],
|
|
6530
|
-
"palegoldenrod": [238, 232, 170],
|
|
6531
|
-
"palegreen": [152, 251, 152],
|
|
6532
|
-
"paleturquoise": [175, 238, 238],
|
|
6533
|
-
"palevioletred": [219, 112, 147],
|
|
6534
|
-
"papayawhip": [255, 239, 213],
|
|
6535
|
-
"peachpuff": [255, 218, 185],
|
|
6536
|
-
"peru": [205, 133, 63],
|
|
6537
|
-
"pink": [255, 192, 203],
|
|
6538
|
-
"plum": [221, 160, 221],
|
|
6539
|
-
"powderblue": [176, 224, 230],
|
|
6540
|
-
"purple": [128, 0, 128],
|
|
6541
|
-
"rebeccapurple": [102, 51, 153],
|
|
6542
|
-
"red": [255, 0, 0],
|
|
6543
|
-
"rosybrown": [188, 143, 143],
|
|
6544
|
-
"royalblue": [65, 105, 225],
|
|
6545
|
-
"saddlebrown": [139, 69, 19],
|
|
6546
|
-
"salmon": [250, 128, 114],
|
|
6547
|
-
"sandybrown": [244, 164, 96],
|
|
6548
|
-
"seagreen": [46, 139, 87],
|
|
6549
|
-
"seashell": [255, 245, 238],
|
|
6550
|
-
"sienna": [160, 82, 45],
|
|
6551
|
-
"silver": [192, 192, 192],
|
|
6552
|
-
"skyblue": [135, 206, 235],
|
|
6553
|
-
"slateblue": [106, 90, 205],
|
|
6554
|
-
"slategray": [112, 128, 144],
|
|
6555
|
-
"slategrey": [112, 128, 144],
|
|
6556
|
-
"snow": [255, 250, 250],
|
|
6557
|
-
"springgreen": [0, 255, 127],
|
|
6558
|
-
"steelblue": [70, 130, 180],
|
|
6559
|
-
"tan": [210, 180, 140],
|
|
6560
|
-
"teal": [0, 128, 128],
|
|
6561
|
-
"thistle": [216, 191, 216],
|
|
6562
|
-
"tomato": [255, 99, 71],
|
|
6563
|
-
"turquoise": [64, 224, 208],
|
|
6564
|
-
"violet": [238, 130, 238],
|
|
6565
|
-
"wheat": [245, 222, 179],
|
|
6566
|
-
"white": [255, 255, 255],
|
|
6567
|
-
"whitesmoke": [245, 245, 245],
|
|
6568
|
-
"yellow": [255, 255, 0],
|
|
6569
|
-
"yellowgreen": [154, 205, 50]
|
|
6570
|
-
};
|
|
6571
|
-
}
|
|
6572
|
-
});
|
|
6573
|
-
|
|
6574
|
-
// ../../node_modules/simple-swizzle/node_modules/is-arrayish/index.js
|
|
6575
|
-
var require_is_arrayish = __commonJS({
|
|
6576
|
-
"../../node_modules/simple-swizzle/node_modules/is-arrayish/index.js"(exports, module) {
|
|
6577
|
-
"use strict";
|
|
6578
|
-
module.exports = function isArrayish(obj) {
|
|
6579
|
-
if (!obj || typeof obj === "string") {
|
|
6580
|
-
return false;
|
|
6581
|
-
}
|
|
6582
|
-
return obj instanceof Array || Array.isArray(obj) || obj.length >= 0 && (obj.splice instanceof Function || Object.getOwnPropertyDescriptor(obj, obj.length - 1) && obj.constructor.name !== "String");
|
|
6583
|
-
};
|
|
6584
|
-
}
|
|
6585
|
-
});
|
|
6586
|
-
|
|
6587
|
-
// ../../node_modules/simple-swizzle/index.js
|
|
6588
|
-
var require_simple_swizzle = __commonJS({
|
|
6589
|
-
"../../node_modules/simple-swizzle/index.js"(exports, module) {
|
|
6426
|
+
// ../../node_modules/@so-ric/colorspace/dist/index.cjs.js
|
|
6427
|
+
var require_index_cjs = __commonJS({
|
|
6428
|
+
"../../node_modules/@so-ric/colorspace/dist/index.cjs.js"(exports, module) {
|
|
6590
6429
|
"use strict";
|
|
6591
|
-
var
|
|
6592
|
-
|
|
6593
|
-
|
|
6594
|
-
|
|
6595
|
-
|
|
6596
|
-
|
|
6597
|
-
|
|
6598
|
-
|
|
6599
|
-
|
|
6600
|
-
|
|
6601
|
-
|
|
6602
|
-
|
|
6603
|
-
|
|
6604
|
-
|
|
6430
|
+
var cssKeywords = {
|
|
6431
|
+
aliceblue: [240, 248, 255],
|
|
6432
|
+
antiquewhite: [250, 235, 215],
|
|
6433
|
+
aqua: [0, 255, 255],
|
|
6434
|
+
aquamarine: [127, 255, 212],
|
|
6435
|
+
azure: [240, 255, 255],
|
|
6436
|
+
beige: [245, 245, 220],
|
|
6437
|
+
bisque: [255, 228, 196],
|
|
6438
|
+
black: [0, 0, 0],
|
|
6439
|
+
blanchedalmond: [255, 235, 205],
|
|
6440
|
+
blue: [0, 0, 255],
|
|
6441
|
+
blueviolet: [138, 43, 226],
|
|
6442
|
+
brown: [165, 42, 42],
|
|
6443
|
+
burlywood: [222, 184, 135],
|
|
6444
|
+
cadetblue: [95, 158, 160],
|
|
6445
|
+
chartreuse: [127, 255, 0],
|
|
6446
|
+
chocolate: [210, 105, 30],
|
|
6447
|
+
coral: [255, 127, 80],
|
|
6448
|
+
cornflowerblue: [100, 149, 237],
|
|
6449
|
+
cornsilk: [255, 248, 220],
|
|
6450
|
+
crimson: [220, 20, 60],
|
|
6451
|
+
cyan: [0, 255, 255],
|
|
6452
|
+
darkblue: [0, 0, 139],
|
|
6453
|
+
darkcyan: [0, 139, 139],
|
|
6454
|
+
darkgoldenrod: [184, 134, 11],
|
|
6455
|
+
darkgray: [169, 169, 169],
|
|
6456
|
+
darkgreen: [0, 100, 0],
|
|
6457
|
+
darkgrey: [169, 169, 169],
|
|
6458
|
+
darkkhaki: [189, 183, 107],
|
|
6459
|
+
darkmagenta: [139, 0, 139],
|
|
6460
|
+
darkolivegreen: [85, 107, 47],
|
|
6461
|
+
darkorange: [255, 140, 0],
|
|
6462
|
+
darkorchid: [153, 50, 204],
|
|
6463
|
+
darkred: [139, 0, 0],
|
|
6464
|
+
darksalmon: [233, 150, 122],
|
|
6465
|
+
darkseagreen: [143, 188, 143],
|
|
6466
|
+
darkslateblue: [72, 61, 139],
|
|
6467
|
+
darkslategray: [47, 79, 79],
|
|
6468
|
+
darkslategrey: [47, 79, 79],
|
|
6469
|
+
darkturquoise: [0, 206, 209],
|
|
6470
|
+
darkviolet: [148, 0, 211],
|
|
6471
|
+
deeppink: [255, 20, 147],
|
|
6472
|
+
deepskyblue: [0, 191, 255],
|
|
6473
|
+
dimgray: [105, 105, 105],
|
|
6474
|
+
dimgrey: [105, 105, 105],
|
|
6475
|
+
dodgerblue: [30, 144, 255],
|
|
6476
|
+
firebrick: [178, 34, 34],
|
|
6477
|
+
floralwhite: [255, 250, 240],
|
|
6478
|
+
forestgreen: [34, 139, 34],
|
|
6479
|
+
fuchsia: [255, 0, 255],
|
|
6480
|
+
gainsboro: [220, 220, 220],
|
|
6481
|
+
ghostwhite: [248, 248, 255],
|
|
6482
|
+
gold: [255, 215, 0],
|
|
6483
|
+
goldenrod: [218, 165, 32],
|
|
6484
|
+
gray: [128, 128, 128],
|
|
6485
|
+
green: [0, 128, 0],
|
|
6486
|
+
greenyellow: [173, 255, 47],
|
|
6487
|
+
grey: [128, 128, 128],
|
|
6488
|
+
honeydew: [240, 255, 240],
|
|
6489
|
+
hotpink: [255, 105, 180],
|
|
6490
|
+
indianred: [205, 92, 92],
|
|
6491
|
+
indigo: [75, 0, 130],
|
|
6492
|
+
ivory: [255, 255, 240],
|
|
6493
|
+
khaki: [240, 230, 140],
|
|
6494
|
+
lavender: [230, 230, 250],
|
|
6495
|
+
lavenderblush: [255, 240, 245],
|
|
6496
|
+
lawngreen: [124, 252, 0],
|
|
6497
|
+
lemonchiffon: [255, 250, 205],
|
|
6498
|
+
lightblue: [173, 216, 230],
|
|
6499
|
+
lightcoral: [240, 128, 128],
|
|
6500
|
+
lightcyan: [224, 255, 255],
|
|
6501
|
+
lightgoldenrodyellow: [250, 250, 210],
|
|
6502
|
+
lightgray: [211, 211, 211],
|
|
6503
|
+
lightgreen: [144, 238, 144],
|
|
6504
|
+
lightgrey: [211, 211, 211],
|
|
6505
|
+
lightpink: [255, 182, 193],
|
|
6506
|
+
lightsalmon: [255, 160, 122],
|
|
6507
|
+
lightseagreen: [32, 178, 170],
|
|
6508
|
+
lightskyblue: [135, 206, 250],
|
|
6509
|
+
lightslategray: [119, 136, 153],
|
|
6510
|
+
lightslategrey: [119, 136, 153],
|
|
6511
|
+
lightsteelblue: [176, 196, 222],
|
|
6512
|
+
lightyellow: [255, 255, 224],
|
|
6513
|
+
lime: [0, 255, 0],
|
|
6514
|
+
limegreen: [50, 205, 50],
|
|
6515
|
+
linen: [250, 240, 230],
|
|
6516
|
+
magenta: [255, 0, 255],
|
|
6517
|
+
maroon: [128, 0, 0],
|
|
6518
|
+
mediumaquamarine: [102, 205, 170],
|
|
6519
|
+
mediumblue: [0, 0, 205],
|
|
6520
|
+
mediumorchid: [186, 85, 211],
|
|
6521
|
+
mediumpurple: [147, 112, 219],
|
|
6522
|
+
mediumseagreen: [60, 179, 113],
|
|
6523
|
+
mediumslateblue: [123, 104, 238],
|
|
6524
|
+
mediumspringgreen: [0, 250, 154],
|
|
6525
|
+
mediumturquoise: [72, 209, 204],
|
|
6526
|
+
mediumvioletred: [199, 21, 133],
|
|
6527
|
+
midnightblue: [25, 25, 112],
|
|
6528
|
+
mintcream: [245, 255, 250],
|
|
6529
|
+
mistyrose: [255, 228, 225],
|
|
6530
|
+
moccasin: [255, 228, 181],
|
|
6531
|
+
navajowhite: [255, 222, 173],
|
|
6532
|
+
navy: [0, 0, 128],
|
|
6533
|
+
oldlace: [253, 245, 230],
|
|
6534
|
+
olive: [128, 128, 0],
|
|
6535
|
+
olivedrab: [107, 142, 35],
|
|
6536
|
+
orange: [255, 165, 0],
|
|
6537
|
+
orangered: [255, 69, 0],
|
|
6538
|
+
orchid: [218, 112, 214],
|
|
6539
|
+
palegoldenrod: [238, 232, 170],
|
|
6540
|
+
palegreen: [152, 251, 152],
|
|
6541
|
+
paleturquoise: [175, 238, 238],
|
|
6542
|
+
palevioletred: [219, 112, 147],
|
|
6543
|
+
papayawhip: [255, 239, 213],
|
|
6544
|
+
peachpuff: [255, 218, 185],
|
|
6545
|
+
peru: [205, 133, 63],
|
|
6546
|
+
pink: [255, 192, 203],
|
|
6547
|
+
plum: [221, 160, 221],
|
|
6548
|
+
powderblue: [176, 224, 230],
|
|
6549
|
+
purple: [128, 0, 128],
|
|
6550
|
+
rebeccapurple: [102, 51, 153],
|
|
6551
|
+
red: [255, 0, 0],
|
|
6552
|
+
rosybrown: [188, 143, 143],
|
|
6553
|
+
royalblue: [65, 105, 225],
|
|
6554
|
+
saddlebrown: [139, 69, 19],
|
|
6555
|
+
salmon: [250, 128, 114],
|
|
6556
|
+
sandybrown: [244, 164, 96],
|
|
6557
|
+
seagreen: [46, 139, 87],
|
|
6558
|
+
seashell: [255, 245, 238],
|
|
6559
|
+
sienna: [160, 82, 45],
|
|
6560
|
+
silver: [192, 192, 192],
|
|
6561
|
+
skyblue: [135, 206, 235],
|
|
6562
|
+
slateblue: [106, 90, 205],
|
|
6563
|
+
slategray: [112, 128, 144],
|
|
6564
|
+
slategrey: [112, 128, 144],
|
|
6565
|
+
snow: [255, 250, 250],
|
|
6566
|
+
springgreen: [0, 255, 127],
|
|
6567
|
+
steelblue: [70, 130, 180],
|
|
6568
|
+
tan: [210, 180, 140],
|
|
6569
|
+
teal: [0, 128, 128],
|
|
6570
|
+
thistle: [216, 191, 216],
|
|
6571
|
+
tomato: [255, 99, 71],
|
|
6572
|
+
turquoise: [64, 224, 208],
|
|
6573
|
+
violet: [238, 130, 238],
|
|
6574
|
+
wheat: [245, 222, 179],
|
|
6575
|
+
white: [255, 255, 255],
|
|
6576
|
+
whitesmoke: [245, 245, 245],
|
|
6577
|
+
yellow: [255, 255, 0],
|
|
6578
|
+
yellowgreen: [154, 205, 50]
|
|
6605
6579
|
};
|
|
6606
|
-
swizzle.wrap = function(fn) {
|
|
6607
|
-
return function() {
|
|
6608
|
-
return fn(swizzle(arguments));
|
|
6609
|
-
};
|
|
6610
|
-
};
|
|
6611
|
-
}
|
|
6612
|
-
});
|
|
6613
|
-
|
|
6614
|
-
// ../../node_modules/color-string/index.js
|
|
6615
|
-
var require_color_string = __commonJS({
|
|
6616
|
-
"../../node_modules/color-string/index.js"(exports, module) {
|
|
6617
|
-
"use strict";
|
|
6618
|
-
var colorNames = require_color_name();
|
|
6619
|
-
var swizzle = require_simple_swizzle();
|
|
6620
|
-
var hasOwnProperty = Object.hasOwnProperty;
|
|
6621
6580
|
var reverseNames = /* @__PURE__ */ Object.create(null);
|
|
6622
|
-
for (name in
|
|
6623
|
-
if (
|
|
6624
|
-
reverseNames[
|
|
6581
|
+
for (const name in cssKeywords) {
|
|
6582
|
+
if (Object.hasOwn(cssKeywords, name)) {
|
|
6583
|
+
reverseNames[cssKeywords[name]] = name;
|
|
6625
6584
|
}
|
|
6626
6585
|
}
|
|
6627
|
-
var
|
|
6628
|
-
var cs = module.exports = {
|
|
6586
|
+
var cs = {
|
|
6629
6587
|
to: {},
|
|
6630
6588
|
get: {}
|
|
6631
6589
|
};
|
|
6632
6590
|
cs.get = function(string) {
|
|
6633
|
-
|
|
6634
|
-
|
|
6635
|
-
|
|
6591
|
+
const prefix = string.slice(0, 3).toLowerCase();
|
|
6592
|
+
let value;
|
|
6593
|
+
let model;
|
|
6636
6594
|
switch (prefix) {
|
|
6637
|
-
case "hsl":
|
|
6638
|
-
|
|
6595
|
+
case "hsl": {
|
|
6596
|
+
value = cs.get.hsl(string);
|
|
6639
6597
|
model = "hsl";
|
|
6640
6598
|
break;
|
|
6641
|
-
|
|
6642
|
-
|
|
6599
|
+
}
|
|
6600
|
+
case "hwb": {
|
|
6601
|
+
value = cs.get.hwb(string);
|
|
6643
6602
|
model = "hwb";
|
|
6644
6603
|
break;
|
|
6645
|
-
|
|
6646
|
-
|
|
6604
|
+
}
|
|
6605
|
+
default: {
|
|
6606
|
+
value = cs.get.rgb(string);
|
|
6647
6607
|
model = "rgb";
|
|
6648
6608
|
break;
|
|
6609
|
+
}
|
|
6649
6610
|
}
|
|
6650
|
-
if (!
|
|
6611
|
+
if (!value) {
|
|
6651
6612
|
return null;
|
|
6652
6613
|
}
|
|
6653
|
-
return { model, value
|
|
6614
|
+
return { model, value };
|
|
6654
6615
|
};
|
|
6655
6616
|
cs.get.rgb = function(string) {
|
|
6656
6617
|
if (!string) {
|
|
6657
6618
|
return null;
|
|
6658
6619
|
}
|
|
6659
|
-
|
|
6660
|
-
|
|
6661
|
-
|
|
6662
|
-
|
|
6663
|
-
|
|
6664
|
-
|
|
6665
|
-
|
|
6666
|
-
|
|
6667
|
-
|
|
6668
|
-
if (match = string.match(
|
|
6620
|
+
const abbr = /^#([a-f\d]{3,4})$/i;
|
|
6621
|
+
const hex2 = /^#([a-f\d]{6})([a-f\d]{2})?$/i;
|
|
6622
|
+
const rgba = /^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/;
|
|
6623
|
+
const per = /^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/;
|
|
6624
|
+
const keyword = /^(\w+)$/;
|
|
6625
|
+
let rgb = [0, 0, 0, 1];
|
|
6626
|
+
let match;
|
|
6627
|
+
let i;
|
|
6628
|
+
let hexAlpha;
|
|
6629
|
+
if (match = string.match(hex2)) {
|
|
6669
6630
|
hexAlpha = match[2];
|
|
6670
6631
|
match = match[1];
|
|
6671
6632
|
for (i = 0; i < 3; i++) {
|
|
6672
|
-
|
|
6673
|
-
rgb[i] = parseInt(match.slice(i2, i2 + 2), 16);
|
|
6633
|
+
const i2 = i * 2;
|
|
6634
|
+
rgb[i] = Number.parseInt(match.slice(i2, i2 + 2), 16);
|
|
6674
6635
|
}
|
|
6675
6636
|
if (hexAlpha) {
|
|
6676
|
-
rgb[3] = parseInt(hexAlpha, 16) / 255;
|
|
6637
|
+
rgb[3] = Number.parseInt(hexAlpha, 16) / 255;
|
|
6677
6638
|
}
|
|
6678
6639
|
} else if (match = string.match(abbr)) {
|
|
6679
6640
|
match = match[1];
|
|
6680
6641
|
hexAlpha = match[3];
|
|
6681
6642
|
for (i = 0; i < 3; i++) {
|
|
6682
|
-
rgb[i] = parseInt(match[i] + match[i], 16);
|
|
6643
|
+
rgb[i] = Number.parseInt(match[i] + match[i], 16);
|
|
6683
6644
|
}
|
|
6684
6645
|
if (hexAlpha) {
|
|
6685
|
-
rgb[3] = parseInt(hexAlpha + hexAlpha, 16) / 255;
|
|
6646
|
+
rgb[3] = Number.parseInt(hexAlpha + hexAlpha, 16) / 255;
|
|
6686
6647
|
}
|
|
6687
6648
|
} else if (match = string.match(rgba)) {
|
|
6688
6649
|
for (i = 0; i < 3; i++) {
|
|
6689
|
-
rgb[i] = parseInt(match[i + 1],
|
|
6650
|
+
rgb[i] = Number.parseInt(match[i + 1], 10);
|
|
6690
6651
|
}
|
|
6691
6652
|
if (match[4]) {
|
|
6692
|
-
|
|
6693
|
-
rgb[3] = parseFloat(match[4]) * 0.01;
|
|
6694
|
-
} else {
|
|
6695
|
-
rgb[3] = parseFloat(match[4]);
|
|
6696
|
-
}
|
|
6653
|
+
rgb[3] = match[5] ? Number.parseFloat(match[4]) * 0.01 : Number.parseFloat(match[4]);
|
|
6697
6654
|
}
|
|
6698
6655
|
} else if (match = string.match(per)) {
|
|
6699
6656
|
for (i = 0; i < 3; i++) {
|
|
6700
|
-
rgb[i] = Math.round(parseFloat(match[i + 1]) * 2.55);
|
|
6657
|
+
rgb[i] = Math.round(Number.parseFloat(match[i + 1]) * 2.55);
|
|
6701
6658
|
}
|
|
6702
6659
|
if (match[4]) {
|
|
6703
|
-
|
|
6704
|
-
rgb[3] = parseFloat(match[4]) * 0.01;
|
|
6705
|
-
} else {
|
|
6706
|
-
rgb[3] = parseFloat(match[4]);
|
|
6707
|
-
}
|
|
6660
|
+
rgb[3] = match[5] ? Number.parseFloat(match[4]) * 0.01 : Number.parseFloat(match[4]);
|
|
6708
6661
|
}
|
|
6709
6662
|
} else if (match = string.match(keyword)) {
|
|
6710
6663
|
if (match[1] === "transparent") {
|
|
6711
6664
|
return [0, 0, 0, 0];
|
|
6712
6665
|
}
|
|
6713
|
-
if (!
|
|
6666
|
+
if (!Object.hasOwn(cssKeywords, match[1])) {
|
|
6714
6667
|
return null;
|
|
6715
6668
|
}
|
|
6716
|
-
rgb =
|
|
6669
|
+
rgb = cssKeywords[match[1]];
|
|
6717
6670
|
rgb[3] = 1;
|
|
6718
6671
|
return rgb;
|
|
6719
6672
|
} else {
|
|
@@ -6729,14 +6682,14 @@ var require_color_string = __commonJS({
|
|
|
6729
6682
|
if (!string) {
|
|
6730
6683
|
return null;
|
|
6731
6684
|
}
|
|
6732
|
-
|
|
6733
|
-
|
|
6685
|
+
const hsl = /^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/;
|
|
6686
|
+
const match = string.match(hsl);
|
|
6734
6687
|
if (match) {
|
|
6735
|
-
|
|
6736
|
-
|
|
6737
|
-
|
|
6738
|
-
|
|
6739
|
-
|
|
6688
|
+
const alpha = Number.parseFloat(match[4]);
|
|
6689
|
+
const h = (Number.parseFloat(match[1]) % 360 + 360) % 360;
|
|
6690
|
+
const s = clamp3(Number.parseFloat(match[2]), 0, 100);
|
|
6691
|
+
const l = clamp3(Number.parseFloat(match[3]), 0, 100);
|
|
6692
|
+
const a = clamp3(Number.isNaN(alpha) ? 1 : alpha, 0, 1);
|
|
6740
6693
|
return [h, s, l, a];
|
|
6741
6694
|
}
|
|
6742
6695
|
return null;
|
|
@@ -6745,228 +6698,55 @@ var require_color_string = __commonJS({
|
|
|
6745
6698
|
if (!string) {
|
|
6746
6699
|
return null;
|
|
6747
6700
|
}
|
|
6748
|
-
|
|
6749
|
-
|
|
6701
|
+
const hwb = /^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*[\s,]\s*([+-]?[\d.]+)%\s*[\s,]\s*([+-]?[\d.]+)%\s*(?:[\s,]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/;
|
|
6702
|
+
const match = string.match(hwb);
|
|
6750
6703
|
if (match) {
|
|
6751
|
-
|
|
6752
|
-
|
|
6753
|
-
|
|
6754
|
-
|
|
6755
|
-
|
|
6704
|
+
const alpha = Number.parseFloat(match[4]);
|
|
6705
|
+
const h = (Number.parseFloat(match[1]) % 360 + 360) % 360;
|
|
6706
|
+
const w = clamp3(Number.parseFloat(match[2]), 0, 100);
|
|
6707
|
+
const b = clamp3(Number.parseFloat(match[3]), 0, 100);
|
|
6708
|
+
const a = clamp3(Number.isNaN(alpha) ? 1 : alpha, 0, 1);
|
|
6756
6709
|
return [h, w, b, a];
|
|
6757
6710
|
}
|
|
6758
6711
|
return null;
|
|
6759
6712
|
};
|
|
6760
|
-
cs.to.hex = function() {
|
|
6761
|
-
var rgba = swizzle(arguments);
|
|
6713
|
+
cs.to.hex = function(...rgba) {
|
|
6762
6714
|
return "#" + hexDouble(rgba[0]) + hexDouble(rgba[1]) + hexDouble(rgba[2]) + (rgba[3] < 1 ? hexDouble(Math.round(rgba[3] * 255)) : "");
|
|
6763
6715
|
};
|
|
6764
|
-
cs.to.rgb = function() {
|
|
6765
|
-
var rgba = swizzle(arguments);
|
|
6716
|
+
cs.to.rgb = function(...rgba) {
|
|
6766
6717
|
return rgba.length < 4 || rgba[3] === 1 ? "rgb(" + Math.round(rgba[0]) + ", " + Math.round(rgba[1]) + ", " + Math.round(rgba[2]) + ")" : "rgba(" + Math.round(rgba[0]) + ", " + Math.round(rgba[1]) + ", " + Math.round(rgba[2]) + ", " + rgba[3] + ")";
|
|
6767
6718
|
};
|
|
6768
|
-
cs.to.rgb.percent = function() {
|
|
6769
|
-
|
|
6770
|
-
|
|
6771
|
-
|
|
6772
|
-
var b = Math.round(rgba[2] / 255 * 100);
|
|
6719
|
+
cs.to.rgb.percent = function(...rgba) {
|
|
6720
|
+
const r = Math.round(rgba[0] / 255 * 100);
|
|
6721
|
+
const g = Math.round(rgba[1] / 255 * 100);
|
|
6722
|
+
const b = Math.round(rgba[2] / 255 * 100);
|
|
6773
6723
|
return rgba.length < 4 || rgba[3] === 1 ? "rgb(" + r + "%, " + g + "%, " + b + "%)" : "rgba(" + r + "%, " + g + "%, " + b + "%, " + rgba[3] + ")";
|
|
6774
6724
|
};
|
|
6775
|
-
cs.to.hsl = function() {
|
|
6776
|
-
var hsla = swizzle(arguments);
|
|
6725
|
+
cs.to.hsl = function(...hsla) {
|
|
6777
6726
|
return hsla.length < 4 || hsla[3] === 1 ? "hsl(" + hsla[0] + ", " + hsla[1] + "%, " + hsla[2] + "%)" : "hsla(" + hsla[0] + ", " + hsla[1] + "%, " + hsla[2] + "%, " + hsla[3] + ")";
|
|
6778
6727
|
};
|
|
6779
|
-
cs.to.hwb = function() {
|
|
6780
|
-
|
|
6781
|
-
var a = "";
|
|
6728
|
+
cs.to.hwb = function(...hwba) {
|
|
6729
|
+
let a = "";
|
|
6782
6730
|
if (hwba.length >= 4 && hwba[3] !== 1) {
|
|
6783
6731
|
a = ", " + hwba[3];
|
|
6784
6732
|
}
|
|
6785
6733
|
return "hwb(" + hwba[0] + ", " + hwba[1] + "%, " + hwba[2] + "%" + a + ")";
|
|
6786
6734
|
};
|
|
6787
|
-
cs.to.keyword = function(rgb) {
|
|
6735
|
+
cs.to.keyword = function(...rgb) {
|
|
6788
6736
|
return reverseNames[rgb.slice(0, 3)];
|
|
6789
6737
|
};
|
|
6790
|
-
function clamp3(
|
|
6791
|
-
return Math.min(Math.max(min,
|
|
6738
|
+
function clamp3(number_, min, max) {
|
|
6739
|
+
return Math.min(Math.max(min, number_), max);
|
|
6792
6740
|
}
|
|
6793
|
-
function hexDouble(
|
|
6794
|
-
|
|
6795
|
-
return
|
|
6741
|
+
function hexDouble(number_) {
|
|
6742
|
+
const string_ = Math.round(number_).toString(16).toUpperCase();
|
|
6743
|
+
return string_.length < 2 ? "0" + string_ : string_;
|
|
6796
6744
|
}
|
|
6797
|
-
}
|
|
6798
|
-
});
|
|
6799
|
-
|
|
6800
|
-
// ../../node_modules/color-convert/node_modules/color-name/index.js
|
|
6801
|
-
var require_color_name2 = __commonJS({
|
|
6802
|
-
"../../node_modules/color-convert/node_modules/color-name/index.js"(exports, module) {
|
|
6803
|
-
"use strict";
|
|
6804
|
-
module.exports = {
|
|
6805
|
-
"aliceblue": [240, 248, 255],
|
|
6806
|
-
"antiquewhite": [250, 235, 215],
|
|
6807
|
-
"aqua": [0, 255, 255],
|
|
6808
|
-
"aquamarine": [127, 255, 212],
|
|
6809
|
-
"azure": [240, 255, 255],
|
|
6810
|
-
"beige": [245, 245, 220],
|
|
6811
|
-
"bisque": [255, 228, 196],
|
|
6812
|
-
"black": [0, 0, 0],
|
|
6813
|
-
"blanchedalmond": [255, 235, 205],
|
|
6814
|
-
"blue": [0, 0, 255],
|
|
6815
|
-
"blueviolet": [138, 43, 226],
|
|
6816
|
-
"brown": [165, 42, 42],
|
|
6817
|
-
"burlywood": [222, 184, 135],
|
|
6818
|
-
"cadetblue": [95, 158, 160],
|
|
6819
|
-
"chartreuse": [127, 255, 0],
|
|
6820
|
-
"chocolate": [210, 105, 30],
|
|
6821
|
-
"coral": [255, 127, 80],
|
|
6822
|
-
"cornflowerblue": [100, 149, 237],
|
|
6823
|
-
"cornsilk": [255, 248, 220],
|
|
6824
|
-
"crimson": [220, 20, 60],
|
|
6825
|
-
"cyan": [0, 255, 255],
|
|
6826
|
-
"darkblue": [0, 0, 139],
|
|
6827
|
-
"darkcyan": [0, 139, 139],
|
|
6828
|
-
"darkgoldenrod": [184, 134, 11],
|
|
6829
|
-
"darkgray": [169, 169, 169],
|
|
6830
|
-
"darkgreen": [0, 100, 0],
|
|
6831
|
-
"darkgrey": [169, 169, 169],
|
|
6832
|
-
"darkkhaki": [189, 183, 107],
|
|
6833
|
-
"darkmagenta": [139, 0, 139],
|
|
6834
|
-
"darkolivegreen": [85, 107, 47],
|
|
6835
|
-
"darkorange": [255, 140, 0],
|
|
6836
|
-
"darkorchid": [153, 50, 204],
|
|
6837
|
-
"darkred": [139, 0, 0],
|
|
6838
|
-
"darksalmon": [233, 150, 122],
|
|
6839
|
-
"darkseagreen": [143, 188, 143],
|
|
6840
|
-
"darkslateblue": [72, 61, 139],
|
|
6841
|
-
"darkslategray": [47, 79, 79],
|
|
6842
|
-
"darkslategrey": [47, 79, 79],
|
|
6843
|
-
"darkturquoise": [0, 206, 209],
|
|
6844
|
-
"darkviolet": [148, 0, 211],
|
|
6845
|
-
"deeppink": [255, 20, 147],
|
|
6846
|
-
"deepskyblue": [0, 191, 255],
|
|
6847
|
-
"dimgray": [105, 105, 105],
|
|
6848
|
-
"dimgrey": [105, 105, 105],
|
|
6849
|
-
"dodgerblue": [30, 144, 255],
|
|
6850
|
-
"firebrick": [178, 34, 34],
|
|
6851
|
-
"floralwhite": [255, 250, 240],
|
|
6852
|
-
"forestgreen": [34, 139, 34],
|
|
6853
|
-
"fuchsia": [255, 0, 255],
|
|
6854
|
-
"gainsboro": [220, 220, 220],
|
|
6855
|
-
"ghostwhite": [248, 248, 255],
|
|
6856
|
-
"gold": [255, 215, 0],
|
|
6857
|
-
"goldenrod": [218, 165, 32],
|
|
6858
|
-
"gray": [128, 128, 128],
|
|
6859
|
-
"green": [0, 128, 0],
|
|
6860
|
-
"greenyellow": [173, 255, 47],
|
|
6861
|
-
"grey": [128, 128, 128],
|
|
6862
|
-
"honeydew": [240, 255, 240],
|
|
6863
|
-
"hotpink": [255, 105, 180],
|
|
6864
|
-
"indianred": [205, 92, 92],
|
|
6865
|
-
"indigo": [75, 0, 130],
|
|
6866
|
-
"ivory": [255, 255, 240],
|
|
6867
|
-
"khaki": [240, 230, 140],
|
|
6868
|
-
"lavender": [230, 230, 250],
|
|
6869
|
-
"lavenderblush": [255, 240, 245],
|
|
6870
|
-
"lawngreen": [124, 252, 0],
|
|
6871
|
-
"lemonchiffon": [255, 250, 205],
|
|
6872
|
-
"lightblue": [173, 216, 230],
|
|
6873
|
-
"lightcoral": [240, 128, 128],
|
|
6874
|
-
"lightcyan": [224, 255, 255],
|
|
6875
|
-
"lightgoldenrodyellow": [250, 250, 210],
|
|
6876
|
-
"lightgray": [211, 211, 211],
|
|
6877
|
-
"lightgreen": [144, 238, 144],
|
|
6878
|
-
"lightgrey": [211, 211, 211],
|
|
6879
|
-
"lightpink": [255, 182, 193],
|
|
6880
|
-
"lightsalmon": [255, 160, 122],
|
|
6881
|
-
"lightseagreen": [32, 178, 170],
|
|
6882
|
-
"lightskyblue": [135, 206, 250],
|
|
6883
|
-
"lightslategray": [119, 136, 153],
|
|
6884
|
-
"lightslategrey": [119, 136, 153],
|
|
6885
|
-
"lightsteelblue": [176, 196, 222],
|
|
6886
|
-
"lightyellow": [255, 255, 224],
|
|
6887
|
-
"lime": [0, 255, 0],
|
|
6888
|
-
"limegreen": [50, 205, 50],
|
|
6889
|
-
"linen": [250, 240, 230],
|
|
6890
|
-
"magenta": [255, 0, 255],
|
|
6891
|
-
"maroon": [128, 0, 0],
|
|
6892
|
-
"mediumaquamarine": [102, 205, 170],
|
|
6893
|
-
"mediumblue": [0, 0, 205],
|
|
6894
|
-
"mediumorchid": [186, 85, 211],
|
|
6895
|
-
"mediumpurple": [147, 112, 219],
|
|
6896
|
-
"mediumseagreen": [60, 179, 113],
|
|
6897
|
-
"mediumslateblue": [123, 104, 238],
|
|
6898
|
-
"mediumspringgreen": [0, 250, 154],
|
|
6899
|
-
"mediumturquoise": [72, 209, 204],
|
|
6900
|
-
"mediumvioletred": [199, 21, 133],
|
|
6901
|
-
"midnightblue": [25, 25, 112],
|
|
6902
|
-
"mintcream": [245, 255, 250],
|
|
6903
|
-
"mistyrose": [255, 228, 225],
|
|
6904
|
-
"moccasin": [255, 228, 181],
|
|
6905
|
-
"navajowhite": [255, 222, 173],
|
|
6906
|
-
"navy": [0, 0, 128],
|
|
6907
|
-
"oldlace": [253, 245, 230],
|
|
6908
|
-
"olive": [128, 128, 0],
|
|
6909
|
-
"olivedrab": [107, 142, 35],
|
|
6910
|
-
"orange": [255, 165, 0],
|
|
6911
|
-
"orangered": [255, 69, 0],
|
|
6912
|
-
"orchid": [218, 112, 214],
|
|
6913
|
-
"palegoldenrod": [238, 232, 170],
|
|
6914
|
-
"palegreen": [152, 251, 152],
|
|
6915
|
-
"paleturquoise": [175, 238, 238],
|
|
6916
|
-
"palevioletred": [219, 112, 147],
|
|
6917
|
-
"papayawhip": [255, 239, 213],
|
|
6918
|
-
"peachpuff": [255, 218, 185],
|
|
6919
|
-
"peru": [205, 133, 63],
|
|
6920
|
-
"pink": [255, 192, 203],
|
|
6921
|
-
"plum": [221, 160, 221],
|
|
6922
|
-
"powderblue": [176, 224, 230],
|
|
6923
|
-
"purple": [128, 0, 128],
|
|
6924
|
-
"rebeccapurple": [102, 51, 153],
|
|
6925
|
-
"red": [255, 0, 0],
|
|
6926
|
-
"rosybrown": [188, 143, 143],
|
|
6927
|
-
"royalblue": [65, 105, 225],
|
|
6928
|
-
"saddlebrown": [139, 69, 19],
|
|
6929
|
-
"salmon": [250, 128, 114],
|
|
6930
|
-
"sandybrown": [244, 164, 96],
|
|
6931
|
-
"seagreen": [46, 139, 87],
|
|
6932
|
-
"seashell": [255, 245, 238],
|
|
6933
|
-
"sienna": [160, 82, 45],
|
|
6934
|
-
"silver": [192, 192, 192],
|
|
6935
|
-
"skyblue": [135, 206, 235],
|
|
6936
|
-
"slateblue": [106, 90, 205],
|
|
6937
|
-
"slategray": [112, 128, 144],
|
|
6938
|
-
"slategrey": [112, 128, 144],
|
|
6939
|
-
"snow": [255, 250, 250],
|
|
6940
|
-
"springgreen": [0, 255, 127],
|
|
6941
|
-
"steelblue": [70, 130, 180],
|
|
6942
|
-
"tan": [210, 180, 140],
|
|
6943
|
-
"teal": [0, 128, 128],
|
|
6944
|
-
"thistle": [216, 191, 216],
|
|
6945
|
-
"tomato": [255, 99, 71],
|
|
6946
|
-
"turquoise": [64, 224, 208],
|
|
6947
|
-
"violet": [238, 130, 238],
|
|
6948
|
-
"wheat": [245, 222, 179],
|
|
6949
|
-
"white": [255, 255, 255],
|
|
6950
|
-
"whitesmoke": [245, 245, 245],
|
|
6951
|
-
"yellow": [255, 255, 0],
|
|
6952
|
-
"yellowgreen": [154, 205, 50]
|
|
6953
|
-
};
|
|
6954
|
-
}
|
|
6955
|
-
});
|
|
6956
|
-
|
|
6957
|
-
// ../../node_modules/color-convert/conversions.js
|
|
6958
|
-
var require_conversions = __commonJS({
|
|
6959
|
-
"../../node_modules/color-convert/conversions.js"(exports, module) {
|
|
6960
|
-
"use strict";
|
|
6961
|
-
var cssKeywords = require_color_name2();
|
|
6962
6745
|
var reverseKeywords = {};
|
|
6963
|
-
for (key
|
|
6964
|
-
|
|
6965
|
-
reverseKeywords[cssKeywords[key]] = key;
|
|
6966
|
-
}
|
|
6746
|
+
for (const key of Object.keys(cssKeywords)) {
|
|
6747
|
+
reverseKeywords[cssKeywords[key]] = key;
|
|
6967
6748
|
}
|
|
6968
|
-
var
|
|
6969
|
-
var convert = module.exports = {
|
|
6749
|
+
var convert$1 = {
|
|
6970
6750
|
rgb: { channels: 3, labels: "rgb" },
|
|
6971
6751
|
hsl: { channels: 3, labels: "hsl" },
|
|
6972
6752
|
hsv: { channels: 3, labels: "hsv" },
|
|
@@ -6974,7 +6754,9 @@ var require_conversions = __commonJS({
|
|
|
6974
6754
|
cmyk: { channels: 4, labels: "cmyk" },
|
|
6975
6755
|
xyz: { channels: 3, labels: "xyz" },
|
|
6976
6756
|
lab: { channels: 3, labels: "lab" },
|
|
6757
|
+
oklab: { channels: 3, labels: ["okl", "oka", "okb"] },
|
|
6977
6758
|
lch: { channels: 3, labels: "lch" },
|
|
6759
|
+
oklch: { channels: 3, labels: ["okl", "okc", "okh"] },
|
|
6978
6760
|
hex: { channels: 1, labels: ["hex"] },
|
|
6979
6761
|
keyword: { channels: 1, labels: ["keyword"] },
|
|
6980
6762
|
ansi16: { channels: 1, labels: ["ansi16"] },
|
|
@@ -6983,52 +6765,62 @@ var require_conversions = __commonJS({
|
|
|
6983
6765
|
apple: { channels: 3, labels: ["r16", "g16", "b16"] },
|
|
6984
6766
|
gray: { channels: 1, labels: ["gray"] }
|
|
6985
6767
|
};
|
|
6986
|
-
|
|
6987
|
-
|
|
6988
|
-
|
|
6989
|
-
|
|
6990
|
-
|
|
6991
|
-
|
|
6992
|
-
|
|
6993
|
-
|
|
6994
|
-
|
|
6995
|
-
|
|
6996
|
-
|
|
6997
|
-
|
|
6998
|
-
|
|
6999
|
-
|
|
7000
|
-
|
|
7001
|
-
|
|
7002
|
-
|
|
7003
|
-
}
|
|
7004
|
-
|
|
7005
|
-
|
|
7006
|
-
|
|
7007
|
-
|
|
7008
|
-
|
|
7009
|
-
|
|
7010
|
-
|
|
7011
|
-
|
|
7012
|
-
|
|
7013
|
-
|
|
7014
|
-
|
|
7015
|
-
|
|
7016
|
-
|
|
7017
|
-
|
|
7018
|
-
|
|
7019
|
-
|
|
7020
|
-
|
|
7021
|
-
|
|
7022
|
-
|
|
7023
|
-
|
|
7024
|
-
|
|
7025
|
-
|
|
6768
|
+
var LAB_FT = (6 / 29) ** 3;
|
|
6769
|
+
function srgbNonlinearTransform(c) {
|
|
6770
|
+
const cc = c > 31308e-7 ? 1.055 * c ** (1 / 2.4) - 0.055 : c * 12.92;
|
|
6771
|
+
return Math.min(Math.max(0, cc), 1);
|
|
6772
|
+
}
|
|
6773
|
+
function srgbNonlinearTransformInv(c) {
|
|
6774
|
+
return c > 0.04045 ? ((c + 0.055) / 1.055) ** 2.4 : c / 12.92;
|
|
6775
|
+
}
|
|
6776
|
+
for (const model of Object.keys(convert$1)) {
|
|
6777
|
+
if (!("channels" in convert$1[model])) {
|
|
6778
|
+
throw new Error("missing channels property: " + model);
|
|
6779
|
+
}
|
|
6780
|
+
if (!("labels" in convert$1[model])) {
|
|
6781
|
+
throw new Error("missing channel labels property: " + model);
|
|
6782
|
+
}
|
|
6783
|
+
if (convert$1[model].labels.length !== convert$1[model].channels) {
|
|
6784
|
+
throw new Error("channel and label counts mismatch: " + model);
|
|
6785
|
+
}
|
|
6786
|
+
const { channels, labels } = convert$1[model];
|
|
6787
|
+
delete convert$1[model].channels;
|
|
6788
|
+
delete convert$1[model].labels;
|
|
6789
|
+
Object.defineProperty(convert$1[model], "channels", { value: channels });
|
|
6790
|
+
Object.defineProperty(convert$1[model], "labels", { value: labels });
|
|
6791
|
+
}
|
|
6792
|
+
convert$1.rgb.hsl = function(rgb) {
|
|
6793
|
+
const r = rgb[0] / 255;
|
|
6794
|
+
const g = rgb[1] / 255;
|
|
6795
|
+
const b = rgb[2] / 255;
|
|
6796
|
+
const min = Math.min(r, g, b);
|
|
6797
|
+
const max = Math.max(r, g, b);
|
|
6798
|
+
const delta = max - min;
|
|
6799
|
+
let h;
|
|
6800
|
+
let s;
|
|
6801
|
+
switch (max) {
|
|
6802
|
+
case min: {
|
|
6803
|
+
h = 0;
|
|
6804
|
+
break;
|
|
6805
|
+
}
|
|
6806
|
+
case r: {
|
|
6807
|
+
h = (g - b) / delta;
|
|
6808
|
+
break;
|
|
6809
|
+
}
|
|
6810
|
+
case g: {
|
|
6811
|
+
h = 2 + (b - r) / delta;
|
|
6812
|
+
break;
|
|
6813
|
+
}
|
|
6814
|
+
case b: {
|
|
6815
|
+
h = 4 + (r - g) / delta;
|
|
6816
|
+
break;
|
|
6817
|
+
}
|
|
7026
6818
|
}
|
|
7027
6819
|
h = Math.min(h * 60, 360);
|
|
7028
6820
|
if (h < 0) {
|
|
7029
6821
|
h += 360;
|
|
7030
6822
|
}
|
|
7031
|
-
l = (min + max) / 2;
|
|
6823
|
+
const l = (min + max) / 2;
|
|
7032
6824
|
if (max === min) {
|
|
7033
6825
|
s = 0;
|
|
7034
6826
|
} else if (l <= 0.5) {
|
|
@@ -7038,33 +6830,41 @@ var require_conversions = __commonJS({
|
|
|
7038
6830
|
}
|
|
7039
6831
|
return [h, s * 100, l * 100];
|
|
7040
6832
|
};
|
|
7041
|
-
convert.rgb.hsv = function(rgb) {
|
|
7042
|
-
|
|
7043
|
-
|
|
7044
|
-
|
|
7045
|
-
|
|
7046
|
-
|
|
7047
|
-
|
|
7048
|
-
|
|
7049
|
-
|
|
7050
|
-
|
|
7051
|
-
|
|
7052
|
-
|
|
6833
|
+
convert$1.rgb.hsv = function(rgb) {
|
|
6834
|
+
let rdif;
|
|
6835
|
+
let gdif;
|
|
6836
|
+
let bdif;
|
|
6837
|
+
let h;
|
|
6838
|
+
let s;
|
|
6839
|
+
const r = rgb[0] / 255;
|
|
6840
|
+
const g = rgb[1] / 255;
|
|
6841
|
+
const b = rgb[2] / 255;
|
|
6842
|
+
const v = Math.max(r, g, b);
|
|
6843
|
+
const diff = v - Math.min(r, g, b);
|
|
6844
|
+
const diffc = function(c) {
|
|
7053
6845
|
return (v - c) / 6 / diff + 1 / 2;
|
|
7054
6846
|
};
|
|
7055
6847
|
if (diff === 0) {
|
|
7056
|
-
h =
|
|
6848
|
+
h = 0;
|
|
6849
|
+
s = 0;
|
|
7057
6850
|
} else {
|
|
7058
6851
|
s = diff / v;
|
|
7059
6852
|
rdif = diffc(r);
|
|
7060
6853
|
gdif = diffc(g);
|
|
7061
6854
|
bdif = diffc(b);
|
|
7062
|
-
|
|
7063
|
-
|
|
7064
|
-
|
|
7065
|
-
|
|
7066
|
-
|
|
7067
|
-
|
|
6855
|
+
switch (v) {
|
|
6856
|
+
case r: {
|
|
6857
|
+
h = bdif - gdif;
|
|
6858
|
+
break;
|
|
6859
|
+
}
|
|
6860
|
+
case g: {
|
|
6861
|
+
h = 1 / 3 + rdif - bdif;
|
|
6862
|
+
break;
|
|
6863
|
+
}
|
|
6864
|
+
case b: {
|
|
6865
|
+
h = 2 / 3 + gdif - rdif;
|
|
6866
|
+
break;
|
|
6867
|
+
}
|
|
7068
6868
|
}
|
|
7069
6869
|
if (h < 0) {
|
|
7070
6870
|
h += 1;
|
|
@@ -7078,106 +6878,99 @@ var require_conversions = __commonJS({
|
|
|
7078
6878
|
v * 100
|
|
7079
6879
|
];
|
|
7080
6880
|
};
|
|
7081
|
-
convert.rgb.hwb = function(rgb) {
|
|
7082
|
-
|
|
7083
|
-
|
|
7084
|
-
|
|
7085
|
-
|
|
7086
|
-
|
|
6881
|
+
convert$1.rgb.hwb = function(rgb) {
|
|
6882
|
+
const r = rgb[0];
|
|
6883
|
+
const g = rgb[1];
|
|
6884
|
+
let b = rgb[2];
|
|
6885
|
+
const h = convert$1.rgb.hsl(rgb)[0];
|
|
6886
|
+
const w = 1 / 255 * Math.min(r, Math.min(g, b));
|
|
7087
6887
|
b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
|
|
7088
6888
|
return [h, w * 100, b * 100];
|
|
7089
6889
|
};
|
|
7090
|
-
convert.rgb.
|
|
7091
|
-
|
|
7092
|
-
|
|
7093
|
-
|
|
7094
|
-
|
|
7095
|
-
|
|
7096
|
-
|
|
7097
|
-
|
|
7098
|
-
|
|
7099
|
-
|
|
7100
|
-
|
|
7101
|
-
|
|
6890
|
+
convert$1.rgb.oklab = function(rgb) {
|
|
6891
|
+
const r = srgbNonlinearTransformInv(rgb[0] / 255);
|
|
6892
|
+
const g = srgbNonlinearTransformInv(rgb[1] / 255);
|
|
6893
|
+
const b = srgbNonlinearTransformInv(rgb[2] / 255);
|
|
6894
|
+
const lp = Math.cbrt(0.4122214708 * r + 0.5363325363 * g + 0.0514459929 * b);
|
|
6895
|
+
const mp = Math.cbrt(0.2119034982 * r + 0.6806995451 * g + 0.1073969566 * b);
|
|
6896
|
+
const sp = Math.cbrt(0.0883024619 * r + 0.2817188376 * g + 0.6299787005 * b);
|
|
6897
|
+
const l = 0.2104542553 * lp + 0.793617785 * mp - 0.0040720468 * sp;
|
|
6898
|
+
const aa = 1.9779984951 * lp - 2.428592205 * mp + 0.4505937099 * sp;
|
|
6899
|
+
const bb = 0.0259040371 * lp + 0.7827717662 * mp - 0.808675766 * sp;
|
|
6900
|
+
return [l * 100, aa * 100, bb * 100];
|
|
6901
|
+
};
|
|
6902
|
+
convert$1.rgb.cmyk = function(rgb) {
|
|
6903
|
+
const r = rgb[0] / 255;
|
|
6904
|
+
const g = rgb[1] / 255;
|
|
6905
|
+
const b = rgb[2] / 255;
|
|
6906
|
+
const k = Math.min(1 - r, 1 - g, 1 - b);
|
|
6907
|
+
const c = (1 - r - k) / (1 - k) || 0;
|
|
6908
|
+
const m = (1 - g - k) / (1 - k) || 0;
|
|
6909
|
+
const y = (1 - b - k) / (1 - k) || 0;
|
|
7102
6910
|
return [c * 100, m * 100, y * 100, k * 100];
|
|
7103
6911
|
};
|
|
7104
6912
|
function comparativeDistance(x, y) {
|
|
7105
|
-
return
|
|
6913
|
+
return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2;
|
|
7106
6914
|
}
|
|
7107
|
-
convert.rgb.keyword = function(rgb) {
|
|
7108
|
-
|
|
6915
|
+
convert$1.rgb.keyword = function(rgb) {
|
|
6916
|
+
const reversed = reverseKeywords[rgb];
|
|
7109
6917
|
if (reversed) {
|
|
7110
6918
|
return reversed;
|
|
7111
6919
|
}
|
|
7112
|
-
|
|
7113
|
-
|
|
7114
|
-
for (
|
|
7115
|
-
|
|
7116
|
-
|
|
7117
|
-
|
|
7118
|
-
|
|
7119
|
-
|
|
7120
|
-
currentClosestKeyword = keyword;
|
|
7121
|
-
}
|
|
6920
|
+
let currentClosestDistance = Number.POSITIVE_INFINITY;
|
|
6921
|
+
let currentClosestKeyword;
|
|
6922
|
+
for (const keyword of Object.keys(cssKeywords)) {
|
|
6923
|
+
const value = cssKeywords[keyword];
|
|
6924
|
+
const distance = comparativeDistance(rgb, value);
|
|
6925
|
+
if (distance < currentClosestDistance) {
|
|
6926
|
+
currentClosestDistance = distance;
|
|
6927
|
+
currentClosestKeyword = keyword;
|
|
7122
6928
|
}
|
|
7123
6929
|
}
|
|
7124
6930
|
return currentClosestKeyword;
|
|
7125
6931
|
};
|
|
7126
|
-
convert.keyword.rgb = function(keyword) {
|
|
6932
|
+
convert$1.keyword.rgb = function(keyword) {
|
|
7127
6933
|
return cssKeywords[keyword];
|
|
7128
6934
|
};
|
|
7129
|
-
convert.rgb.xyz = function(rgb) {
|
|
7130
|
-
|
|
7131
|
-
|
|
7132
|
-
|
|
7133
|
-
|
|
7134
|
-
|
|
7135
|
-
|
|
7136
|
-
var x = r * 0.4124 + g * 0.3576 + b * 0.1805;
|
|
7137
|
-
var y = r * 0.2126 + g * 0.7152 + b * 0.0722;
|
|
7138
|
-
var z = r * 0.0193 + g * 0.1192 + b * 0.9505;
|
|
6935
|
+
convert$1.rgb.xyz = function(rgb) {
|
|
6936
|
+
const r = srgbNonlinearTransformInv(rgb[0] / 255);
|
|
6937
|
+
const g = srgbNonlinearTransformInv(rgb[1] / 255);
|
|
6938
|
+
const b = srgbNonlinearTransformInv(rgb[2] / 255);
|
|
6939
|
+
const x = r * 0.4124564 + g * 0.3575761 + b * 0.1804375;
|
|
6940
|
+
const y = r * 0.2126729 + g * 0.7151522 + b * 0.072175;
|
|
6941
|
+
const z = r * 0.0193339 + g * 0.119192 + b * 0.9503041;
|
|
7139
6942
|
return [x * 100, y * 100, z * 100];
|
|
7140
6943
|
};
|
|
7141
|
-
convert.rgb.lab = function(rgb) {
|
|
7142
|
-
|
|
7143
|
-
|
|
7144
|
-
|
|
7145
|
-
|
|
7146
|
-
var l;
|
|
7147
|
-
var a;
|
|
7148
|
-
var b;
|
|
6944
|
+
convert$1.rgb.lab = function(rgb) {
|
|
6945
|
+
const xyz = convert$1.rgb.xyz(rgb);
|
|
6946
|
+
let x = xyz[0];
|
|
6947
|
+
let y = xyz[1];
|
|
6948
|
+
let z = xyz[2];
|
|
7149
6949
|
x /= 95.047;
|
|
7150
6950
|
y /= 100;
|
|
7151
6951
|
z /= 108.883;
|
|
7152
|
-
x = x >
|
|
7153
|
-
y = y >
|
|
7154
|
-
z = z >
|
|
7155
|
-
l = 116 * y - 16;
|
|
7156
|
-
a = 500 * (x - y);
|
|
7157
|
-
b = 200 * (y - z);
|
|
6952
|
+
x = x > LAB_FT ? x ** (1 / 3) : 7.787 * x + 16 / 116;
|
|
6953
|
+
y = y > LAB_FT ? y ** (1 / 3) : 7.787 * y + 16 / 116;
|
|
6954
|
+
z = z > LAB_FT ? z ** (1 / 3) : 7.787 * z + 16 / 116;
|
|
6955
|
+
const l = 116 * y - 16;
|
|
6956
|
+
const a = 500 * (x - y);
|
|
6957
|
+
const b = 200 * (y - z);
|
|
7158
6958
|
return [l, a, b];
|
|
7159
6959
|
};
|
|
7160
|
-
convert.hsl.rgb = function(hsl) {
|
|
7161
|
-
|
|
7162
|
-
|
|
7163
|
-
|
|
7164
|
-
|
|
7165
|
-
|
|
7166
|
-
var t3;
|
|
7167
|
-
var rgb;
|
|
7168
|
-
var val;
|
|
6960
|
+
convert$1.hsl.rgb = function(hsl) {
|
|
6961
|
+
const h = hsl[0] / 360;
|
|
6962
|
+
const s = hsl[1] / 100;
|
|
6963
|
+
const l = hsl[2] / 100;
|
|
6964
|
+
let t3;
|
|
6965
|
+
let value;
|
|
7169
6966
|
if (s === 0) {
|
|
7170
|
-
|
|
7171
|
-
return [
|
|
7172
|
-
}
|
|
7173
|
-
if (l < 0.5) {
|
|
7174
|
-
t2 = l * (1 + s);
|
|
7175
|
-
} else {
|
|
7176
|
-
t2 = l + s - l * s;
|
|
6967
|
+
value = l * 255;
|
|
6968
|
+
return [value, value, value];
|
|
7177
6969
|
}
|
|
7178
|
-
|
|
7179
|
-
|
|
7180
|
-
|
|
6970
|
+
const t2 = l < 0.5 ? l * (1 + s) : l + s - l * s;
|
|
6971
|
+
const t1 = 2 * l - t2;
|
|
6972
|
+
const rgb = [0, 0, 0];
|
|
6973
|
+
for (let i = 0; i < 3; i++) {
|
|
7181
6974
|
t3 = h + 1 / 3 * -(i - 1);
|
|
7182
6975
|
if (t3 < 0) {
|
|
7183
6976
|
t3++;
|
|
@@ -7186,253 +6979,285 @@ var require_conversions = __commonJS({
|
|
|
7186
6979
|
t3--;
|
|
7187
6980
|
}
|
|
7188
6981
|
if (6 * t3 < 1) {
|
|
7189
|
-
|
|
6982
|
+
value = t1 + (t2 - t1) * 6 * t3;
|
|
7190
6983
|
} else if (2 * t3 < 1) {
|
|
7191
|
-
|
|
6984
|
+
value = t2;
|
|
7192
6985
|
} else if (3 * t3 < 2) {
|
|
7193
|
-
|
|
6986
|
+
value = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
|
|
7194
6987
|
} else {
|
|
7195
|
-
|
|
6988
|
+
value = t1;
|
|
7196
6989
|
}
|
|
7197
|
-
rgb[i] =
|
|
6990
|
+
rgb[i] = value * 255;
|
|
7198
6991
|
}
|
|
7199
6992
|
return rgb;
|
|
7200
6993
|
};
|
|
7201
|
-
convert.hsl.hsv = function(hsl) {
|
|
7202
|
-
|
|
7203
|
-
|
|
7204
|
-
|
|
7205
|
-
|
|
7206
|
-
|
|
7207
|
-
var sv;
|
|
7208
|
-
var v;
|
|
6994
|
+
convert$1.hsl.hsv = function(hsl) {
|
|
6995
|
+
const h = hsl[0];
|
|
6996
|
+
let s = hsl[1] / 100;
|
|
6997
|
+
let l = hsl[2] / 100;
|
|
6998
|
+
let smin = s;
|
|
6999
|
+
const lmin = Math.max(l, 0.01);
|
|
7209
7000
|
l *= 2;
|
|
7210
7001
|
s *= l <= 1 ? l : 2 - l;
|
|
7211
7002
|
smin *= lmin <= 1 ? lmin : 2 - lmin;
|
|
7212
|
-
v = (l + s) / 2;
|
|
7213
|
-
sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s);
|
|
7003
|
+
const v = (l + s) / 2;
|
|
7004
|
+
const sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s);
|
|
7214
7005
|
return [h, sv * 100, v * 100];
|
|
7215
7006
|
};
|
|
7216
|
-
convert.hsv.rgb = function(hsv) {
|
|
7217
|
-
|
|
7218
|
-
|
|
7219
|
-
|
|
7220
|
-
|
|
7221
|
-
|
|
7222
|
-
|
|
7223
|
-
|
|
7224
|
-
|
|
7007
|
+
convert$1.hsv.rgb = function(hsv) {
|
|
7008
|
+
const h = hsv[0] / 60;
|
|
7009
|
+
const s = hsv[1] / 100;
|
|
7010
|
+
let v = hsv[2] / 100;
|
|
7011
|
+
const hi = Math.floor(h) % 6;
|
|
7012
|
+
const f = h - Math.floor(h);
|
|
7013
|
+
const p = 255 * v * (1 - s);
|
|
7014
|
+
const q = 255 * v * (1 - s * f);
|
|
7015
|
+
const t = 255 * v * (1 - s * (1 - f));
|
|
7225
7016
|
v *= 255;
|
|
7226
7017
|
switch (hi) {
|
|
7227
|
-
case 0:
|
|
7018
|
+
case 0: {
|
|
7228
7019
|
return [v, t, p];
|
|
7229
|
-
|
|
7020
|
+
}
|
|
7021
|
+
case 1: {
|
|
7230
7022
|
return [q, v, p];
|
|
7231
|
-
|
|
7023
|
+
}
|
|
7024
|
+
case 2: {
|
|
7232
7025
|
return [p, v, t];
|
|
7233
|
-
|
|
7026
|
+
}
|
|
7027
|
+
case 3: {
|
|
7234
7028
|
return [p, q, v];
|
|
7235
|
-
|
|
7029
|
+
}
|
|
7030
|
+
case 4: {
|
|
7236
7031
|
return [t, p, v];
|
|
7237
|
-
|
|
7032
|
+
}
|
|
7033
|
+
case 5: {
|
|
7238
7034
|
return [v, p, q];
|
|
7035
|
+
}
|
|
7239
7036
|
}
|
|
7240
7037
|
};
|
|
7241
|
-
convert.hsv.hsl = function(hsv) {
|
|
7242
|
-
|
|
7243
|
-
|
|
7244
|
-
|
|
7245
|
-
|
|
7246
|
-
|
|
7247
|
-
|
|
7248
|
-
var l;
|
|
7038
|
+
convert$1.hsv.hsl = function(hsv) {
|
|
7039
|
+
const h = hsv[0];
|
|
7040
|
+
const s = hsv[1] / 100;
|
|
7041
|
+
const v = hsv[2] / 100;
|
|
7042
|
+
const vmin = Math.max(v, 0.01);
|
|
7043
|
+
let sl;
|
|
7044
|
+
let l;
|
|
7249
7045
|
l = (2 - s) * v;
|
|
7250
|
-
lmin = (2 - s) * vmin;
|
|
7046
|
+
const lmin = (2 - s) * vmin;
|
|
7251
7047
|
sl = s * vmin;
|
|
7252
7048
|
sl /= lmin <= 1 ? lmin : 2 - lmin;
|
|
7253
7049
|
sl = sl || 0;
|
|
7254
7050
|
l /= 2;
|
|
7255
7051
|
return [h, sl * 100, l * 100];
|
|
7256
7052
|
};
|
|
7257
|
-
convert.hwb.rgb = function(hwb) {
|
|
7258
|
-
|
|
7259
|
-
|
|
7260
|
-
|
|
7261
|
-
|
|
7262
|
-
|
|
7263
|
-
var v;
|
|
7264
|
-
var f;
|
|
7265
|
-
var n;
|
|
7053
|
+
convert$1.hwb.rgb = function(hwb) {
|
|
7054
|
+
const h = hwb[0] / 360;
|
|
7055
|
+
let wh = hwb[1] / 100;
|
|
7056
|
+
let bl = hwb[2] / 100;
|
|
7057
|
+
const ratio = wh + bl;
|
|
7058
|
+
let f;
|
|
7266
7059
|
if (ratio > 1) {
|
|
7267
7060
|
wh /= ratio;
|
|
7268
7061
|
bl /= ratio;
|
|
7269
7062
|
}
|
|
7270
|
-
i = Math.floor(6 * h);
|
|
7271
|
-
v = 1 - bl;
|
|
7063
|
+
const i = Math.floor(6 * h);
|
|
7064
|
+
const v = 1 - bl;
|
|
7272
7065
|
f = 6 * h - i;
|
|
7273
7066
|
if ((i & 1) !== 0) {
|
|
7274
7067
|
f = 1 - f;
|
|
7275
7068
|
}
|
|
7276
|
-
n = wh + f * (v - wh);
|
|
7277
|
-
|
|
7278
|
-
|
|
7279
|
-
|
|
7069
|
+
const n = wh + f * (v - wh);
|
|
7070
|
+
let r;
|
|
7071
|
+
let g;
|
|
7072
|
+
let b;
|
|
7280
7073
|
switch (i) {
|
|
7281
7074
|
default:
|
|
7282
7075
|
case 6:
|
|
7283
|
-
case 0:
|
|
7076
|
+
case 0: {
|
|
7284
7077
|
r = v;
|
|
7285
7078
|
g = n;
|
|
7286
7079
|
b = wh;
|
|
7287
7080
|
break;
|
|
7288
|
-
|
|
7081
|
+
}
|
|
7082
|
+
case 1: {
|
|
7289
7083
|
r = n;
|
|
7290
7084
|
g = v;
|
|
7291
7085
|
b = wh;
|
|
7292
7086
|
break;
|
|
7293
|
-
|
|
7087
|
+
}
|
|
7088
|
+
case 2: {
|
|
7294
7089
|
r = wh;
|
|
7295
7090
|
g = v;
|
|
7296
7091
|
b = n;
|
|
7297
7092
|
break;
|
|
7298
|
-
|
|
7093
|
+
}
|
|
7094
|
+
case 3: {
|
|
7299
7095
|
r = wh;
|
|
7300
7096
|
g = n;
|
|
7301
7097
|
b = v;
|
|
7302
7098
|
break;
|
|
7303
|
-
|
|
7099
|
+
}
|
|
7100
|
+
case 4: {
|
|
7304
7101
|
r = n;
|
|
7305
7102
|
g = wh;
|
|
7306
7103
|
b = v;
|
|
7307
7104
|
break;
|
|
7308
|
-
|
|
7105
|
+
}
|
|
7106
|
+
case 5: {
|
|
7309
7107
|
r = v;
|
|
7310
7108
|
g = wh;
|
|
7311
7109
|
b = n;
|
|
7312
7110
|
break;
|
|
7111
|
+
}
|
|
7313
7112
|
}
|
|
7314
7113
|
return [r * 255, g * 255, b * 255];
|
|
7315
7114
|
};
|
|
7316
|
-
convert.cmyk.rgb = function(cmyk) {
|
|
7317
|
-
|
|
7318
|
-
|
|
7319
|
-
|
|
7320
|
-
|
|
7321
|
-
|
|
7322
|
-
|
|
7323
|
-
|
|
7324
|
-
r = 1 - Math.min(1, c * (1 - k) + k);
|
|
7325
|
-
g = 1 - Math.min(1, m * (1 - k) + k);
|
|
7326
|
-
b = 1 - Math.min(1, y * (1 - k) + k);
|
|
7115
|
+
convert$1.cmyk.rgb = function(cmyk) {
|
|
7116
|
+
const c = cmyk[0] / 100;
|
|
7117
|
+
const m = cmyk[1] / 100;
|
|
7118
|
+
const y = cmyk[2] / 100;
|
|
7119
|
+
const k = cmyk[3] / 100;
|
|
7120
|
+
const r = 1 - Math.min(1, c * (1 - k) + k);
|
|
7121
|
+
const g = 1 - Math.min(1, m * (1 - k) + k);
|
|
7122
|
+
const b = 1 - Math.min(1, y * (1 - k) + k);
|
|
7327
7123
|
return [r * 255, g * 255, b * 255];
|
|
7328
7124
|
};
|
|
7329
|
-
convert.xyz.rgb = function(xyz) {
|
|
7330
|
-
|
|
7331
|
-
|
|
7332
|
-
|
|
7333
|
-
|
|
7334
|
-
|
|
7335
|
-
|
|
7336
|
-
r = x * 3.
|
|
7337
|
-
g = x * -0.
|
|
7338
|
-
b = x * 0.
|
|
7339
|
-
r =
|
|
7340
|
-
g =
|
|
7341
|
-
b =
|
|
7342
|
-
r = Math.min(Math.max(0, r), 1);
|
|
7343
|
-
g = Math.min(Math.max(0, g), 1);
|
|
7344
|
-
b = Math.min(Math.max(0, b), 1);
|
|
7125
|
+
convert$1.xyz.rgb = function(xyz) {
|
|
7126
|
+
const x = xyz[0] / 100;
|
|
7127
|
+
const y = xyz[1] / 100;
|
|
7128
|
+
const z = xyz[2] / 100;
|
|
7129
|
+
let r;
|
|
7130
|
+
let g;
|
|
7131
|
+
let b;
|
|
7132
|
+
r = x * 3.2404542 + y * -1.5371385 + z * -0.4985314;
|
|
7133
|
+
g = x * -0.969266 + y * 1.8760108 + z * 0.041556;
|
|
7134
|
+
b = x * 0.0556434 + y * -0.2040259 + z * 1.0572252;
|
|
7135
|
+
r = srgbNonlinearTransform(r);
|
|
7136
|
+
g = srgbNonlinearTransform(g);
|
|
7137
|
+
b = srgbNonlinearTransform(b);
|
|
7345
7138
|
return [r * 255, g * 255, b * 255];
|
|
7346
7139
|
};
|
|
7347
|
-
convert.xyz.lab = function(xyz) {
|
|
7348
|
-
|
|
7349
|
-
|
|
7350
|
-
|
|
7351
|
-
var l;
|
|
7352
|
-
var a;
|
|
7353
|
-
var b;
|
|
7140
|
+
convert$1.xyz.lab = function(xyz) {
|
|
7141
|
+
let x = xyz[0];
|
|
7142
|
+
let y = xyz[1];
|
|
7143
|
+
let z = xyz[2];
|
|
7354
7144
|
x /= 95.047;
|
|
7355
7145
|
y /= 100;
|
|
7356
7146
|
z /= 108.883;
|
|
7357
|
-
x = x >
|
|
7358
|
-
y = y >
|
|
7359
|
-
z = z >
|
|
7360
|
-
l = 116 * y - 16;
|
|
7361
|
-
a = 500 * (x - y);
|
|
7362
|
-
b = 200 * (y - z);
|
|
7147
|
+
x = x > LAB_FT ? x ** (1 / 3) : 7.787 * x + 16 / 116;
|
|
7148
|
+
y = y > LAB_FT ? y ** (1 / 3) : 7.787 * y + 16 / 116;
|
|
7149
|
+
z = z > LAB_FT ? z ** (1 / 3) : 7.787 * z + 16 / 116;
|
|
7150
|
+
const l = 116 * y - 16;
|
|
7151
|
+
const a = 500 * (x - y);
|
|
7152
|
+
const b = 200 * (y - z);
|
|
7363
7153
|
return [l, a, b];
|
|
7364
7154
|
};
|
|
7365
|
-
convert.
|
|
7366
|
-
|
|
7367
|
-
|
|
7368
|
-
|
|
7369
|
-
|
|
7370
|
-
|
|
7371
|
-
|
|
7155
|
+
convert$1.xyz.oklab = function(xyz) {
|
|
7156
|
+
const x = xyz[0] / 100;
|
|
7157
|
+
const y = xyz[1] / 100;
|
|
7158
|
+
const z = xyz[2] / 100;
|
|
7159
|
+
const lp = Math.cbrt(0.8189330101 * x + 0.3618667424 * y - 0.1288597137 * z);
|
|
7160
|
+
const mp = Math.cbrt(0.0329845436 * x + 0.9293118715 * y + 0.0361456387 * z);
|
|
7161
|
+
const sp = Math.cbrt(0.0482003018 * x + 0.2643662691 * y + 0.633851707 * z);
|
|
7162
|
+
const l = 0.2104542553 * lp + 0.793617785 * mp - 0.0040720468 * sp;
|
|
7163
|
+
const a = 1.9779984951 * lp - 2.428592205 * mp + 0.4505937099 * sp;
|
|
7164
|
+
const b = 0.0259040371 * lp + 0.7827717662 * mp - 0.808675766 * sp;
|
|
7165
|
+
return [l * 100, a * 100, b * 100];
|
|
7166
|
+
};
|
|
7167
|
+
convert$1.oklab.oklch = function(oklab) {
|
|
7168
|
+
return convert$1.lab.lch(oklab);
|
|
7169
|
+
};
|
|
7170
|
+
convert$1.oklab.xyz = function(oklab) {
|
|
7171
|
+
const ll = oklab[0] / 100;
|
|
7172
|
+
const a = oklab[1] / 100;
|
|
7173
|
+
const b = oklab[2] / 100;
|
|
7174
|
+
const l = (0.999999998 * ll + 0.396337792 * a + 0.215803758 * b) ** 3;
|
|
7175
|
+
const m = (1.000000008 * ll - 0.105561342 * a - 0.063854175 * b) ** 3;
|
|
7176
|
+
const s = (1.000000055 * ll - 0.089484182 * a - 1.291485538 * b) ** 3;
|
|
7177
|
+
const x = 1.227013851 * l - 0.55779998 * m + 0.281256149 * s;
|
|
7178
|
+
const y = -0.040580178 * l + 1.11225687 * m - 0.071676679 * s;
|
|
7179
|
+
const z = -0.076381285 * l - 0.421481978 * m + 1.58616322 * s;
|
|
7180
|
+
return [x * 100, y * 100, z * 100];
|
|
7181
|
+
};
|
|
7182
|
+
convert$1.oklab.rgb = function(oklab) {
|
|
7183
|
+
const ll = oklab[0] / 100;
|
|
7184
|
+
const aa = oklab[1] / 100;
|
|
7185
|
+
const bb = oklab[2] / 100;
|
|
7186
|
+
const l = (ll + 0.3963377774 * aa + 0.2158037573 * bb) ** 3;
|
|
7187
|
+
const m = (ll - 0.1055613458 * aa - 0.0638541728 * bb) ** 3;
|
|
7188
|
+
const s = (ll - 0.0894841775 * aa - 1.291485548 * bb) ** 3;
|
|
7189
|
+
const r = srgbNonlinearTransform(4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s);
|
|
7190
|
+
const g = srgbNonlinearTransform(-1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s);
|
|
7191
|
+
const b = srgbNonlinearTransform(-0.0041960863 * l - 0.7034186147 * m + 1.707614701 * s);
|
|
7192
|
+
return [r * 255, g * 255, b * 255];
|
|
7193
|
+
};
|
|
7194
|
+
convert$1.oklch.oklab = function(oklch) {
|
|
7195
|
+
return convert$1.lch.lab(oklch);
|
|
7196
|
+
};
|
|
7197
|
+
convert$1.lab.xyz = function(lab) {
|
|
7198
|
+
const l = lab[0];
|
|
7199
|
+
const a = lab[1];
|
|
7200
|
+
const b = lab[2];
|
|
7201
|
+
let x;
|
|
7202
|
+
let y;
|
|
7203
|
+
let z;
|
|
7372
7204
|
y = (l + 16) / 116;
|
|
7373
7205
|
x = a / 500 + y;
|
|
7374
7206
|
z = y - b / 200;
|
|
7375
|
-
|
|
7376
|
-
|
|
7377
|
-
|
|
7378
|
-
y = y2 >
|
|
7379
|
-
x = x2 >
|
|
7380
|
-
z = z2 >
|
|
7207
|
+
const y2 = y ** 3;
|
|
7208
|
+
const x2 = x ** 3;
|
|
7209
|
+
const z2 = z ** 3;
|
|
7210
|
+
y = y2 > LAB_FT ? y2 : (y - 16 / 116) / 7.787;
|
|
7211
|
+
x = x2 > LAB_FT ? x2 : (x - 16 / 116) / 7.787;
|
|
7212
|
+
z = z2 > LAB_FT ? z2 : (z - 16 / 116) / 7.787;
|
|
7381
7213
|
x *= 95.047;
|
|
7382
7214
|
y *= 100;
|
|
7383
7215
|
z *= 108.883;
|
|
7384
7216
|
return [x, y, z];
|
|
7385
7217
|
};
|
|
7386
|
-
convert.lab.lch = function(lab) {
|
|
7387
|
-
|
|
7388
|
-
|
|
7389
|
-
|
|
7390
|
-
|
|
7391
|
-
|
|
7392
|
-
var c;
|
|
7393
|
-
hr = Math.atan2(b, a);
|
|
7218
|
+
convert$1.lab.lch = function(lab) {
|
|
7219
|
+
const l = lab[0];
|
|
7220
|
+
const a = lab[1];
|
|
7221
|
+
const b = lab[2];
|
|
7222
|
+
let h;
|
|
7223
|
+
const hr = Math.atan2(b, a);
|
|
7394
7224
|
h = hr * 360 / 2 / Math.PI;
|
|
7395
7225
|
if (h < 0) {
|
|
7396
7226
|
h += 360;
|
|
7397
7227
|
}
|
|
7398
|
-
c = Math.sqrt(a * a + b * b);
|
|
7228
|
+
const c = Math.sqrt(a * a + b * b);
|
|
7399
7229
|
return [l, c, h];
|
|
7400
7230
|
};
|
|
7401
|
-
convert.lch.lab = function(lch) {
|
|
7402
|
-
|
|
7403
|
-
|
|
7404
|
-
|
|
7405
|
-
|
|
7406
|
-
|
|
7407
|
-
|
|
7408
|
-
hr = h / 360 * 2 * Math.PI;
|
|
7409
|
-
a = c * Math.cos(hr);
|
|
7410
|
-
b = c * Math.sin(hr);
|
|
7231
|
+
convert$1.lch.lab = function(lch) {
|
|
7232
|
+
const l = lch[0];
|
|
7233
|
+
const c = lch[1];
|
|
7234
|
+
const h = lch[2];
|
|
7235
|
+
const hr = h / 360 * 2 * Math.PI;
|
|
7236
|
+
const a = c * Math.cos(hr);
|
|
7237
|
+
const b = c * Math.sin(hr);
|
|
7411
7238
|
return [l, a, b];
|
|
7412
7239
|
};
|
|
7413
|
-
convert.rgb.ansi16 = function(args) {
|
|
7414
|
-
|
|
7415
|
-
|
|
7416
|
-
var b = args[2];
|
|
7417
|
-
var value = 1 in arguments ? arguments[1] : convert.rgb.hsv(args)[2];
|
|
7240
|
+
convert$1.rgb.ansi16 = function(args, saturation = null) {
|
|
7241
|
+
const [r, g, b] = args;
|
|
7242
|
+
let value = saturation === null ? convert$1.rgb.hsv(args)[2] : saturation;
|
|
7418
7243
|
value = Math.round(value / 50);
|
|
7419
7244
|
if (value === 0) {
|
|
7420
7245
|
return 30;
|
|
7421
7246
|
}
|
|
7422
|
-
|
|
7247
|
+
let ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
|
|
7423
7248
|
if (value === 2) {
|
|
7424
7249
|
ansi += 60;
|
|
7425
7250
|
}
|
|
7426
7251
|
return ansi;
|
|
7427
7252
|
};
|
|
7428
|
-
convert.hsv.ansi16 = function(args) {
|
|
7429
|
-
return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
|
|
7253
|
+
convert$1.hsv.ansi16 = function(args) {
|
|
7254
|
+
return convert$1.rgb.ansi16(convert$1.hsv.rgb(args), args[2]);
|
|
7430
7255
|
};
|
|
7431
|
-
convert.rgb.ansi256 = function(args) {
|
|
7432
|
-
|
|
7433
|
-
|
|
7434
|
-
|
|
7435
|
-
if (r === g && g === b) {
|
|
7256
|
+
convert$1.rgb.ansi256 = function(args) {
|
|
7257
|
+
const r = args[0];
|
|
7258
|
+
const g = args[1];
|
|
7259
|
+
const b = args[2];
|
|
7260
|
+
if (r >> 4 === g >> 4 && g >> 4 === b >> 4) {
|
|
7436
7261
|
if (r < 8) {
|
|
7437
7262
|
return 16;
|
|
7438
7263
|
}
|
|
@@ -7441,11 +7266,12 @@ var require_conversions = __commonJS({
|
|
|
7441
7266
|
}
|
|
7442
7267
|
return Math.round((r - 8) / 247 * 24) + 232;
|
|
7443
7268
|
}
|
|
7444
|
-
|
|
7269
|
+
const ansi = 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
|
|
7445
7270
|
return ansi;
|
|
7446
7271
|
};
|
|
7447
|
-
convert.ansi16.rgb = function(args) {
|
|
7448
|
-
|
|
7272
|
+
convert$1.ansi16.rgb = function(args) {
|
|
7273
|
+
args = args[0];
|
|
7274
|
+
let color = args % 10;
|
|
7449
7275
|
if (color === 0 || color === 7) {
|
|
7450
7276
|
if (args > 50) {
|
|
7451
7277
|
color += 3.5;
|
|
@@ -7453,60 +7279,54 @@ var require_conversions = __commonJS({
|
|
|
7453
7279
|
color = color / 10.5 * 255;
|
|
7454
7280
|
return [color, color, color];
|
|
7455
7281
|
}
|
|
7456
|
-
|
|
7457
|
-
|
|
7458
|
-
|
|
7459
|
-
|
|
7282
|
+
const mult = (Math.trunc(args > 50) + 1) * 0.5;
|
|
7283
|
+
const r = (color & 1) * mult * 255;
|
|
7284
|
+
const g = (color >> 1 & 1) * mult * 255;
|
|
7285
|
+
const b = (color >> 2 & 1) * mult * 255;
|
|
7460
7286
|
return [r, g, b];
|
|
7461
7287
|
};
|
|
7462
|
-
convert.ansi256.rgb = function(args) {
|
|
7288
|
+
convert$1.ansi256.rgb = function(args) {
|
|
7289
|
+
args = args[0];
|
|
7463
7290
|
if (args >= 232) {
|
|
7464
|
-
|
|
7291
|
+
const c = (args - 232) * 10 + 8;
|
|
7465
7292
|
return [c, c, c];
|
|
7466
7293
|
}
|
|
7467
7294
|
args -= 16;
|
|
7468
|
-
|
|
7469
|
-
|
|
7470
|
-
|
|
7471
|
-
|
|
7295
|
+
let rem;
|
|
7296
|
+
const r = Math.floor(args / 36) / 5 * 255;
|
|
7297
|
+
const g = Math.floor((rem = args % 36) / 6) / 5 * 255;
|
|
7298
|
+
const b = rem % 6 / 5 * 255;
|
|
7472
7299
|
return [r, g, b];
|
|
7473
7300
|
};
|
|
7474
|
-
convert.rgb.hex = function(args) {
|
|
7475
|
-
|
|
7476
|
-
|
|
7477
|
-
return "000000".
|
|
7301
|
+
convert$1.rgb.hex = function(args) {
|
|
7302
|
+
const integer = ((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255);
|
|
7303
|
+
const string = integer.toString(16).toUpperCase();
|
|
7304
|
+
return "000000".slice(string.length) + string;
|
|
7478
7305
|
};
|
|
7479
|
-
convert.hex.rgb = function(args) {
|
|
7480
|
-
|
|
7306
|
+
convert$1.hex.rgb = function(args) {
|
|
7307
|
+
const match = args.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);
|
|
7481
7308
|
if (!match) {
|
|
7482
7309
|
return [0, 0, 0];
|
|
7483
7310
|
}
|
|
7484
|
-
|
|
7311
|
+
let colorString = match[0];
|
|
7485
7312
|
if (match[0].length === 3) {
|
|
7486
|
-
colorString = colorString.
|
|
7487
|
-
|
|
7488
|
-
|
|
7489
|
-
|
|
7490
|
-
|
|
7491
|
-
|
|
7492
|
-
var g = integer >> 8 & 255;
|
|
7493
|
-
var b = integer & 255;
|
|
7313
|
+
colorString = [...colorString].map((char) => char + char).join("");
|
|
7314
|
+
}
|
|
7315
|
+
const integer = Number.parseInt(colorString, 16);
|
|
7316
|
+
const r = integer >> 16 & 255;
|
|
7317
|
+
const g = integer >> 8 & 255;
|
|
7318
|
+
const b = integer & 255;
|
|
7494
7319
|
return [r, g, b];
|
|
7495
7320
|
};
|
|
7496
|
-
convert.rgb.hcg = function(rgb) {
|
|
7497
|
-
|
|
7498
|
-
|
|
7499
|
-
|
|
7500
|
-
|
|
7501
|
-
|
|
7502
|
-
|
|
7503
|
-
|
|
7504
|
-
|
|
7505
|
-
if (chroma < 1) {
|
|
7506
|
-
grayscale = min / (1 - chroma);
|
|
7507
|
-
} else {
|
|
7508
|
-
grayscale = 0;
|
|
7509
|
-
}
|
|
7321
|
+
convert$1.rgb.hcg = function(rgb) {
|
|
7322
|
+
const r = rgb[0] / 255;
|
|
7323
|
+
const g = rgb[1] / 255;
|
|
7324
|
+
const b = rgb[2] / 255;
|
|
7325
|
+
const max = Math.max(Math.max(r, g), b);
|
|
7326
|
+
const min = Math.min(Math.min(r, g), b);
|
|
7327
|
+
const chroma = max - min;
|
|
7328
|
+
let hue;
|
|
7329
|
+
const grayscale = chroma < 1 ? min / (1 - chroma) : 0;
|
|
7510
7330
|
if (chroma <= 0) {
|
|
7511
7331
|
hue = 0;
|
|
7512
7332
|
} else if (max === r) {
|
|
@@ -7514,79 +7334,80 @@ var require_conversions = __commonJS({
|
|
|
7514
7334
|
} else if (max === g) {
|
|
7515
7335
|
hue = 2 + (b - r) / chroma;
|
|
7516
7336
|
} else {
|
|
7517
|
-
hue = 4 + (r - g) / chroma
|
|
7337
|
+
hue = 4 + (r - g) / chroma;
|
|
7518
7338
|
}
|
|
7519
7339
|
hue /= 6;
|
|
7520
7340
|
hue %= 1;
|
|
7521
7341
|
return [hue * 360, chroma * 100, grayscale * 100];
|
|
7522
7342
|
};
|
|
7523
|
-
convert.hsl.hcg = function(hsl) {
|
|
7524
|
-
|
|
7525
|
-
|
|
7526
|
-
|
|
7527
|
-
|
|
7528
|
-
if (l < 0.5) {
|
|
7529
|
-
c = 2 * s * l;
|
|
7530
|
-
} else {
|
|
7531
|
-
c = 2 * s * (1 - l);
|
|
7532
|
-
}
|
|
7343
|
+
convert$1.hsl.hcg = function(hsl) {
|
|
7344
|
+
const s = hsl[1] / 100;
|
|
7345
|
+
const l = hsl[2] / 100;
|
|
7346
|
+
const c = l < 0.5 ? 2 * s * l : 2 * s * (1 - l);
|
|
7347
|
+
let f = 0;
|
|
7533
7348
|
if (c < 1) {
|
|
7534
7349
|
f = (l - 0.5 * c) / (1 - c);
|
|
7535
7350
|
}
|
|
7536
7351
|
return [hsl[0], c * 100, f * 100];
|
|
7537
7352
|
};
|
|
7538
|
-
convert.hsv.hcg = function(hsv) {
|
|
7539
|
-
|
|
7540
|
-
|
|
7541
|
-
|
|
7542
|
-
|
|
7353
|
+
convert$1.hsv.hcg = function(hsv) {
|
|
7354
|
+
const s = hsv[1] / 100;
|
|
7355
|
+
const v = hsv[2] / 100;
|
|
7356
|
+
const c = s * v;
|
|
7357
|
+
let f = 0;
|
|
7543
7358
|
if (c < 1) {
|
|
7544
7359
|
f = (v - c) / (1 - c);
|
|
7545
7360
|
}
|
|
7546
7361
|
return [hsv[0], c * 100, f * 100];
|
|
7547
7362
|
};
|
|
7548
|
-
convert.hcg.rgb = function(hcg) {
|
|
7549
|
-
|
|
7550
|
-
|
|
7551
|
-
|
|
7363
|
+
convert$1.hcg.rgb = function(hcg) {
|
|
7364
|
+
const h = hcg[0] / 360;
|
|
7365
|
+
const c = hcg[1] / 100;
|
|
7366
|
+
const g = hcg[2] / 100;
|
|
7552
7367
|
if (c === 0) {
|
|
7553
7368
|
return [g * 255, g * 255, g * 255];
|
|
7554
7369
|
}
|
|
7555
|
-
|
|
7556
|
-
|
|
7557
|
-
|
|
7558
|
-
|
|
7559
|
-
|
|
7370
|
+
const pure = [0, 0, 0];
|
|
7371
|
+
const hi = h % 1 * 6;
|
|
7372
|
+
const v = hi % 1;
|
|
7373
|
+
const w = 1 - v;
|
|
7374
|
+
let mg = 0;
|
|
7560
7375
|
switch (Math.floor(hi)) {
|
|
7561
|
-
case 0:
|
|
7376
|
+
case 0: {
|
|
7562
7377
|
pure[0] = 1;
|
|
7563
7378
|
pure[1] = v;
|
|
7564
7379
|
pure[2] = 0;
|
|
7565
7380
|
break;
|
|
7566
|
-
|
|
7381
|
+
}
|
|
7382
|
+
case 1: {
|
|
7567
7383
|
pure[0] = w;
|
|
7568
7384
|
pure[1] = 1;
|
|
7569
7385
|
pure[2] = 0;
|
|
7570
7386
|
break;
|
|
7571
|
-
|
|
7387
|
+
}
|
|
7388
|
+
case 2: {
|
|
7572
7389
|
pure[0] = 0;
|
|
7573
7390
|
pure[1] = 1;
|
|
7574
7391
|
pure[2] = v;
|
|
7575
7392
|
break;
|
|
7576
|
-
|
|
7393
|
+
}
|
|
7394
|
+
case 3: {
|
|
7577
7395
|
pure[0] = 0;
|
|
7578
7396
|
pure[1] = w;
|
|
7579
7397
|
pure[2] = 1;
|
|
7580
7398
|
break;
|
|
7581
|
-
|
|
7399
|
+
}
|
|
7400
|
+
case 4: {
|
|
7582
7401
|
pure[0] = v;
|
|
7583
7402
|
pure[1] = 0;
|
|
7584
7403
|
pure[2] = 1;
|
|
7585
7404
|
break;
|
|
7586
|
-
|
|
7405
|
+
}
|
|
7406
|
+
default: {
|
|
7587
7407
|
pure[0] = 1;
|
|
7588
7408
|
pure[1] = 0;
|
|
7589
7409
|
pure[2] = w;
|
|
7410
|
+
}
|
|
7590
7411
|
}
|
|
7591
7412
|
mg = (1 - c) * g;
|
|
7592
7413
|
return [
|
|
@@ -7595,21 +7416,21 @@ var require_conversions = __commonJS({
|
|
|
7595
7416
|
(c * pure[2] + mg) * 255
|
|
7596
7417
|
];
|
|
7597
7418
|
};
|
|
7598
|
-
convert.hcg.hsv = function(hcg) {
|
|
7599
|
-
|
|
7600
|
-
|
|
7601
|
-
|
|
7602
|
-
|
|
7419
|
+
convert$1.hcg.hsv = function(hcg) {
|
|
7420
|
+
const c = hcg[1] / 100;
|
|
7421
|
+
const g = hcg[2] / 100;
|
|
7422
|
+
const v = c + g * (1 - c);
|
|
7423
|
+
let f = 0;
|
|
7603
7424
|
if (v > 0) {
|
|
7604
7425
|
f = c / v;
|
|
7605
7426
|
}
|
|
7606
7427
|
return [hcg[0], f * 100, v * 100];
|
|
7607
7428
|
};
|
|
7608
|
-
convert.hcg.hsl = function(hcg) {
|
|
7609
|
-
|
|
7610
|
-
|
|
7611
|
-
|
|
7612
|
-
|
|
7429
|
+
convert$1.hcg.hsl = function(hcg) {
|
|
7430
|
+
const c = hcg[1] / 100;
|
|
7431
|
+
const g = hcg[2] / 100;
|
|
7432
|
+
const l = g * (1 - c) + 0.5 * c;
|
|
7433
|
+
let s = 0;
|
|
7613
7434
|
if (l > 0 && l < 0.5) {
|
|
7614
7435
|
s = c / (2 * l);
|
|
7615
7436
|
} else if (l >= 0.5 && l < 1) {
|
|
@@ -7617,67 +7438,60 @@ var require_conversions = __commonJS({
|
|
|
7617
7438
|
}
|
|
7618
7439
|
return [hcg[0], s * 100, l * 100];
|
|
7619
7440
|
};
|
|
7620
|
-
convert.hcg.hwb = function(hcg) {
|
|
7621
|
-
|
|
7622
|
-
|
|
7623
|
-
|
|
7441
|
+
convert$1.hcg.hwb = function(hcg) {
|
|
7442
|
+
const c = hcg[1] / 100;
|
|
7443
|
+
const g = hcg[2] / 100;
|
|
7444
|
+
const v = c + g * (1 - c);
|
|
7624
7445
|
return [hcg[0], (v - c) * 100, (1 - v) * 100];
|
|
7625
7446
|
};
|
|
7626
|
-
convert.hwb.hcg = function(hwb) {
|
|
7627
|
-
|
|
7628
|
-
|
|
7629
|
-
|
|
7630
|
-
|
|
7631
|
-
|
|
7447
|
+
convert$1.hwb.hcg = function(hwb) {
|
|
7448
|
+
const w = hwb[1] / 100;
|
|
7449
|
+
const b = hwb[2] / 100;
|
|
7450
|
+
const v = 1 - b;
|
|
7451
|
+
const c = v - w;
|
|
7452
|
+
let g = 0;
|
|
7632
7453
|
if (c < 1) {
|
|
7633
7454
|
g = (v - c) / (1 - c);
|
|
7634
7455
|
}
|
|
7635
7456
|
return [hwb[0], c * 100, g * 100];
|
|
7636
7457
|
};
|
|
7637
|
-
convert.apple.rgb = function(apple) {
|
|
7458
|
+
convert$1.apple.rgb = function(apple) {
|
|
7638
7459
|
return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255];
|
|
7639
7460
|
};
|
|
7640
|
-
convert.rgb.apple = function(rgb) {
|
|
7461
|
+
convert$1.rgb.apple = function(rgb) {
|
|
7641
7462
|
return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535];
|
|
7642
7463
|
};
|
|
7643
|
-
convert.gray.rgb = function(args) {
|
|
7464
|
+
convert$1.gray.rgb = function(args) {
|
|
7644
7465
|
return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
|
|
7645
7466
|
};
|
|
7646
|
-
convert.gray.hsl =
|
|
7467
|
+
convert$1.gray.hsl = function(args) {
|
|
7647
7468
|
return [0, 0, args[0]];
|
|
7648
7469
|
};
|
|
7649
|
-
convert.gray.
|
|
7470
|
+
convert$1.gray.hsv = convert$1.gray.hsl;
|
|
7471
|
+
convert$1.gray.hwb = function(gray) {
|
|
7650
7472
|
return [0, 100, gray[0]];
|
|
7651
7473
|
};
|
|
7652
|
-
convert.gray.cmyk = function(gray) {
|
|
7474
|
+
convert$1.gray.cmyk = function(gray) {
|
|
7653
7475
|
return [0, 0, 0, gray[0]];
|
|
7654
7476
|
};
|
|
7655
|
-
convert.gray.lab = function(gray) {
|
|
7477
|
+
convert$1.gray.lab = function(gray) {
|
|
7656
7478
|
return [gray[0], 0, 0];
|
|
7657
7479
|
};
|
|
7658
|
-
convert.gray.hex = function(gray) {
|
|
7659
|
-
|
|
7660
|
-
|
|
7661
|
-
|
|
7662
|
-
return "000000".
|
|
7480
|
+
convert$1.gray.hex = function(gray) {
|
|
7481
|
+
const value = Math.round(gray[0] / 100 * 255) & 255;
|
|
7482
|
+
const integer = (value << 16) + (value << 8) + value;
|
|
7483
|
+
const string = integer.toString(16).toUpperCase();
|
|
7484
|
+
return "000000".slice(string.length) + string;
|
|
7663
7485
|
};
|
|
7664
|
-
convert.rgb.gray = function(rgb) {
|
|
7665
|
-
|
|
7666
|
-
return [
|
|
7486
|
+
convert$1.rgb.gray = function(rgb) {
|
|
7487
|
+
const value = (rgb[0] + rgb[1] + rgb[2]) / 3;
|
|
7488
|
+
return [value / 255 * 100];
|
|
7667
7489
|
};
|
|
7668
|
-
}
|
|
7669
|
-
});
|
|
7670
|
-
|
|
7671
|
-
// ../../node_modules/color-convert/route.js
|
|
7672
|
-
var require_route = __commonJS({
|
|
7673
|
-
"../../node_modules/color-convert/route.js"(exports, module) {
|
|
7674
|
-
"use strict";
|
|
7675
|
-
var conversions = require_conversions();
|
|
7676
7490
|
function buildGraph() {
|
|
7677
|
-
|
|
7678
|
-
|
|
7679
|
-
for (
|
|
7680
|
-
graph[
|
|
7491
|
+
const graph = {};
|
|
7492
|
+
const models2 = Object.keys(convert$1);
|
|
7493
|
+
for (let { length } = models2, i = 0; i < length; i++) {
|
|
7494
|
+
graph[models2[i]] = {
|
|
7681
7495
|
// http://jsperf.com/1-vs-infinity
|
|
7682
7496
|
// micro-opt, but this is simple.
|
|
7683
7497
|
distance: -1,
|
|
@@ -7687,15 +7501,15 @@ var require_route = __commonJS({
|
|
|
7687
7501
|
return graph;
|
|
7688
7502
|
}
|
|
7689
7503
|
function deriveBFS(fromModel) {
|
|
7690
|
-
|
|
7691
|
-
|
|
7504
|
+
const graph = buildGraph();
|
|
7505
|
+
const queue = [fromModel];
|
|
7692
7506
|
graph[fromModel].distance = 0;
|
|
7693
|
-
while (queue.length) {
|
|
7694
|
-
|
|
7695
|
-
|
|
7696
|
-
for (
|
|
7697
|
-
|
|
7698
|
-
|
|
7507
|
+
while (queue.length > 0) {
|
|
7508
|
+
const current = queue.pop();
|
|
7509
|
+
const adjacents = Object.keys(convert$1[current]);
|
|
7510
|
+
for (let { length } = adjacents, i = 0; i < length; i++) {
|
|
7511
|
+
const adjacent = adjacents[i];
|
|
7512
|
+
const node = graph[adjacent];
|
|
7699
7513
|
if (node.distance === -1) {
|
|
7700
7514
|
node.distance = graph[current].distance + 1;
|
|
7701
7515
|
node.parent = current;
|
|
@@ -7711,49 +7525,41 @@ var require_route = __commonJS({
|
|
|
7711
7525
|
};
|
|
7712
7526
|
}
|
|
7713
7527
|
function wrapConversion(toModel, graph) {
|
|
7714
|
-
|
|
7715
|
-
|
|
7716
|
-
|
|
7528
|
+
const path = [graph[toModel].parent, toModel];
|
|
7529
|
+
let fn = convert$1[graph[toModel].parent][toModel];
|
|
7530
|
+
let cur = graph[toModel].parent;
|
|
7717
7531
|
while (graph[cur].parent) {
|
|
7718
7532
|
path.unshift(graph[cur].parent);
|
|
7719
|
-
fn = link(
|
|
7533
|
+
fn = link(convert$1[graph[cur].parent][cur], fn);
|
|
7720
7534
|
cur = graph[cur].parent;
|
|
7721
7535
|
}
|
|
7722
7536
|
fn.conversion = path;
|
|
7723
7537
|
return fn;
|
|
7724
7538
|
}
|
|
7725
|
-
|
|
7726
|
-
|
|
7727
|
-
|
|
7728
|
-
|
|
7729
|
-
for (
|
|
7730
|
-
|
|
7731
|
-
|
|
7539
|
+
function route(fromModel) {
|
|
7540
|
+
const graph = deriveBFS(fromModel);
|
|
7541
|
+
const conversion = {};
|
|
7542
|
+
const models2 = Object.keys(graph);
|
|
7543
|
+
for (let { length } = models2, i = 0; i < length; i++) {
|
|
7544
|
+
const toModel = models2[i];
|
|
7545
|
+
const node = graph[toModel];
|
|
7732
7546
|
if (node.parent === null) {
|
|
7733
7547
|
continue;
|
|
7734
7548
|
}
|
|
7735
7549
|
conversion[toModel] = wrapConversion(toModel, graph);
|
|
7736
7550
|
}
|
|
7737
7551
|
return conversion;
|
|
7738
|
-
}
|
|
7739
|
-
}
|
|
7740
|
-
});
|
|
7741
|
-
|
|
7742
|
-
// ../../node_modules/color-convert/index.js
|
|
7743
|
-
var require_color_convert = __commonJS({
|
|
7744
|
-
"../../node_modules/color-convert/index.js"(exports, module) {
|
|
7745
|
-
"use strict";
|
|
7746
|
-
var conversions = require_conversions();
|
|
7747
|
-
var route = require_route();
|
|
7552
|
+
}
|
|
7748
7553
|
var convert = {};
|
|
7749
|
-
var models = Object.keys(
|
|
7554
|
+
var models = Object.keys(convert$1);
|
|
7750
7555
|
function wrapRaw(fn) {
|
|
7751
|
-
|
|
7752
|
-
|
|
7753
|
-
|
|
7556
|
+
const wrappedFn = function(...args) {
|
|
7557
|
+
const arg0 = args[0];
|
|
7558
|
+
if (arg0 === void 0 || arg0 === null) {
|
|
7559
|
+
return arg0;
|
|
7754
7560
|
}
|
|
7755
|
-
if (
|
|
7756
|
-
args =
|
|
7561
|
+
if (arg0.length > 1) {
|
|
7562
|
+
args = arg0;
|
|
7757
7563
|
}
|
|
7758
7564
|
return fn(args);
|
|
7759
7565
|
};
|
|
@@ -7763,16 +7569,17 @@ var require_color_convert = __commonJS({
|
|
|
7763
7569
|
return wrappedFn;
|
|
7764
7570
|
}
|
|
7765
7571
|
function wrapRounded(fn) {
|
|
7766
|
-
|
|
7767
|
-
|
|
7768
|
-
|
|
7572
|
+
const wrappedFn = function(...args) {
|
|
7573
|
+
const arg0 = args[0];
|
|
7574
|
+
if (arg0 === void 0 || arg0 === null) {
|
|
7575
|
+
return arg0;
|
|
7769
7576
|
}
|
|
7770
|
-
if (
|
|
7771
|
-
args =
|
|
7577
|
+
if (arg0.length > 1) {
|
|
7578
|
+
args = arg0;
|
|
7772
7579
|
}
|
|
7773
|
-
|
|
7580
|
+
const result = fn(args);
|
|
7774
7581
|
if (typeof result === "object") {
|
|
7775
|
-
for (
|
|
7582
|
+
for (let { length } = result, i = 0; i < length; i++) {
|
|
7776
7583
|
result[i] = Math.round(result[i]);
|
|
7777
7584
|
}
|
|
7778
7585
|
}
|
|
@@ -7783,45 +7590,34 @@ var require_color_convert = __commonJS({
|
|
|
7783
7590
|
}
|
|
7784
7591
|
return wrappedFn;
|
|
7785
7592
|
}
|
|
7786
|
-
|
|
7593
|
+
for (const fromModel of models) {
|
|
7787
7594
|
convert[fromModel] = {};
|
|
7788
|
-
Object.defineProperty(convert[fromModel], "channels", { value:
|
|
7789
|
-
Object.defineProperty(convert[fromModel], "labels", { value:
|
|
7790
|
-
|
|
7791
|
-
|
|
7792
|
-
|
|
7793
|
-
|
|
7595
|
+
Object.defineProperty(convert[fromModel], "channels", { value: convert$1[fromModel].channels });
|
|
7596
|
+
Object.defineProperty(convert[fromModel], "labels", { value: convert$1[fromModel].labels });
|
|
7597
|
+
const routes = route(fromModel);
|
|
7598
|
+
const routeModels = Object.keys(routes);
|
|
7599
|
+
for (const toModel of routeModels) {
|
|
7600
|
+
const fn = routes[toModel];
|
|
7794
7601
|
convert[fromModel][toModel] = wrapRounded(fn);
|
|
7795
7602
|
convert[fromModel][toModel].raw = wrapRaw(fn);
|
|
7796
|
-
}
|
|
7797
|
-
}
|
|
7798
|
-
module.exports = convert;
|
|
7799
|
-
}
|
|
7800
|
-
});
|
|
7801
|
-
|
|
7802
|
-
// ../../node_modules/color/index.js
|
|
7803
|
-
var require_color = __commonJS({
|
|
7804
|
-
"../../node_modules/color/index.js"(exports, module) {
|
|
7805
|
-
"use strict";
|
|
7806
|
-
var colorString = require_color_string();
|
|
7807
|
-
var convert = require_color_convert();
|
|
7808
|
-
var _slice = [].slice;
|
|
7603
|
+
}
|
|
7604
|
+
}
|
|
7809
7605
|
var skippedModels = [
|
|
7810
|
-
//
|
|
7606
|
+
// To be honest, I don't really feel like keyword belongs in color convert, but eh.
|
|
7811
7607
|
"keyword",
|
|
7812
|
-
//
|
|
7608
|
+
// Gray conflicts with some method names, and has its own method defined.
|
|
7813
7609
|
"gray",
|
|
7814
|
-
//
|
|
7610
|
+
// Shouldn't really be in color-convert either...
|
|
7815
7611
|
"hex"
|
|
7816
7612
|
];
|
|
7817
7613
|
var hashedModelKeys = {};
|
|
7818
|
-
Object.keys(convert)
|
|
7819
|
-
hashedModelKeys[
|
|
7820
|
-
}
|
|
7614
|
+
for (const model of Object.keys(convert)) {
|
|
7615
|
+
hashedModelKeys[[...convert[model].labels].sort().join("")] = model;
|
|
7616
|
+
}
|
|
7821
7617
|
var limiters = {};
|
|
7822
|
-
function Color(
|
|
7618
|
+
function Color(object, model) {
|
|
7823
7619
|
if (!(this instanceof Color)) {
|
|
7824
|
-
return new Color(
|
|
7620
|
+
return new Color(object, model);
|
|
7825
7621
|
}
|
|
7826
7622
|
if (model && model in skippedModels) {
|
|
7827
7623
|
model = null;
|
|
@@ -7829,63 +7625,62 @@ var require_color = __commonJS({
|
|
|
7829
7625
|
if (model && !(model in convert)) {
|
|
7830
7626
|
throw new Error("Unknown model: " + model);
|
|
7831
7627
|
}
|
|
7832
|
-
|
|
7833
|
-
|
|
7834
|
-
if (
|
|
7628
|
+
let i;
|
|
7629
|
+
let channels;
|
|
7630
|
+
if (object == null) {
|
|
7835
7631
|
this.model = "rgb";
|
|
7836
7632
|
this.color = [0, 0, 0];
|
|
7837
7633
|
this.valpha = 1;
|
|
7838
|
-
} else if (
|
|
7839
|
-
this.model =
|
|
7840
|
-
this.color =
|
|
7841
|
-
this.valpha =
|
|
7842
|
-
} else if (typeof
|
|
7843
|
-
|
|
7634
|
+
} else if (object instanceof Color) {
|
|
7635
|
+
this.model = object.model;
|
|
7636
|
+
this.color = [...object.color];
|
|
7637
|
+
this.valpha = object.valpha;
|
|
7638
|
+
} else if (typeof object === "string") {
|
|
7639
|
+
const result = cs.get(object);
|
|
7844
7640
|
if (result === null) {
|
|
7845
|
-
throw new Error("Unable to parse color from string: " +
|
|
7641
|
+
throw new Error("Unable to parse color from string: " + object);
|
|
7846
7642
|
}
|
|
7847
7643
|
this.model = result.model;
|
|
7848
7644
|
channels = convert[this.model].channels;
|
|
7849
7645
|
this.color = result.value.slice(0, channels);
|
|
7850
7646
|
this.valpha = typeof result.value[channels] === "number" ? result.value[channels] : 1;
|
|
7851
|
-
} else if (
|
|
7647
|
+
} else if (object.length > 0) {
|
|
7852
7648
|
this.model = model || "rgb";
|
|
7853
7649
|
channels = convert[this.model].channels;
|
|
7854
|
-
|
|
7855
|
-
this.color = zeroArray(
|
|
7856
|
-
this.valpha = typeof
|
|
7857
|
-
} else if (typeof
|
|
7858
|
-
obj &= 16777215;
|
|
7650
|
+
const newArray = Array.prototype.slice.call(object, 0, channels);
|
|
7651
|
+
this.color = zeroArray(newArray, channels);
|
|
7652
|
+
this.valpha = typeof object[channels] === "number" ? object[channels] : 1;
|
|
7653
|
+
} else if (typeof object === "number") {
|
|
7859
7654
|
this.model = "rgb";
|
|
7860
7655
|
this.color = [
|
|
7861
|
-
|
|
7862
|
-
|
|
7863
|
-
|
|
7656
|
+
object >> 16 & 255,
|
|
7657
|
+
object >> 8 & 255,
|
|
7658
|
+
object & 255
|
|
7864
7659
|
];
|
|
7865
7660
|
this.valpha = 1;
|
|
7866
7661
|
} else {
|
|
7867
7662
|
this.valpha = 1;
|
|
7868
|
-
|
|
7869
|
-
if ("alpha" in
|
|
7663
|
+
const keys = Object.keys(object);
|
|
7664
|
+
if ("alpha" in object) {
|
|
7870
7665
|
keys.splice(keys.indexOf("alpha"), 1);
|
|
7871
|
-
this.valpha = typeof
|
|
7666
|
+
this.valpha = typeof object.alpha === "number" ? object.alpha : 0;
|
|
7872
7667
|
}
|
|
7873
|
-
|
|
7668
|
+
const hashedKeys = keys.sort().join("");
|
|
7874
7669
|
if (!(hashedKeys in hashedModelKeys)) {
|
|
7875
|
-
throw new Error("Unable to parse color from object: " + JSON.stringify(
|
|
7670
|
+
throw new Error("Unable to parse color from object: " + JSON.stringify(object));
|
|
7876
7671
|
}
|
|
7877
7672
|
this.model = hashedModelKeys[hashedKeys];
|
|
7878
|
-
|
|
7879
|
-
|
|
7673
|
+
const { labels } = convert[this.model];
|
|
7674
|
+
const color = [];
|
|
7880
7675
|
for (i = 0; i < labels.length; i++) {
|
|
7881
|
-
color.push(
|
|
7676
|
+
color.push(object[labels[i]]);
|
|
7882
7677
|
}
|
|
7883
7678
|
this.color = zeroArray(color);
|
|
7884
7679
|
}
|
|
7885
7680
|
if (limiters[this.model]) {
|
|
7886
7681
|
channels = convert[this.model].channels;
|
|
7887
7682
|
for (i = 0; i < channels; i++) {
|
|
7888
|
-
|
|
7683
|
+
const limit = limiters[this.model][i];
|
|
7889
7684
|
if (limit) {
|
|
7890
7685
|
this.color[i] = limit(this.color[i]);
|
|
7891
7686
|
}
|
|
@@ -7897,31 +7692,31 @@ var require_color = __commonJS({
|
|
|
7897
7692
|
}
|
|
7898
7693
|
}
|
|
7899
7694
|
Color.prototype = {
|
|
7900
|
-
toString
|
|
7695
|
+
toString() {
|
|
7901
7696
|
return this.string();
|
|
7902
7697
|
},
|
|
7903
|
-
toJSON
|
|
7698
|
+
toJSON() {
|
|
7904
7699
|
return this[this.model]();
|
|
7905
7700
|
},
|
|
7906
|
-
string
|
|
7907
|
-
|
|
7701
|
+
string(places) {
|
|
7702
|
+
let self2 = this.model in cs.to ? this : this.rgb();
|
|
7908
7703
|
self2 = self2.round(typeof places === "number" ? places : 1);
|
|
7909
|
-
|
|
7910
|
-
return
|
|
7704
|
+
const arguments_ = self2.valpha === 1 ? self2.color : [...self2.color, this.valpha];
|
|
7705
|
+
return cs.to[self2.model](...arguments_);
|
|
7911
7706
|
},
|
|
7912
|
-
percentString
|
|
7913
|
-
|
|
7914
|
-
|
|
7915
|
-
return
|
|
7707
|
+
percentString(places) {
|
|
7708
|
+
const self2 = this.rgb().round(typeof places === "number" ? places : 1);
|
|
7709
|
+
const arguments_ = self2.valpha === 1 ? self2.color : [...self2.color, this.valpha];
|
|
7710
|
+
return cs.to.rgb.percent(...arguments_);
|
|
7916
7711
|
},
|
|
7917
|
-
array
|
|
7918
|
-
return this.valpha === 1 ? this.color
|
|
7712
|
+
array() {
|
|
7713
|
+
return this.valpha === 1 ? [...this.color] : [...this.color, this.valpha];
|
|
7919
7714
|
},
|
|
7920
|
-
object
|
|
7921
|
-
|
|
7922
|
-
|
|
7923
|
-
|
|
7924
|
-
for (
|
|
7715
|
+
object() {
|
|
7716
|
+
const result = {};
|
|
7717
|
+
const { channels } = convert[this.model];
|
|
7718
|
+
const { labels } = convert[this.model];
|
|
7719
|
+
for (let i = 0; i < channels; i++) {
|
|
7925
7720
|
result[labels[i]] = this.color[i];
|
|
7926
7721
|
}
|
|
7927
7722
|
if (this.valpha !== 1) {
|
|
@@ -7929,8 +7724,8 @@ var require_color = __commonJS({
|
|
|
7929
7724
|
}
|
|
7930
7725
|
return result;
|
|
7931
7726
|
},
|
|
7932
|
-
unitArray
|
|
7933
|
-
|
|
7727
|
+
unitArray() {
|
|
7728
|
+
const rgb = this.rgb().color;
|
|
7934
7729
|
rgb[0] /= 255;
|
|
7935
7730
|
rgb[1] /= 255;
|
|
7936
7731
|
rgb[2] /= 255;
|
|
@@ -7939,8 +7734,8 @@ var require_color = __commonJS({
|
|
|
7939
7734
|
}
|
|
7940
7735
|
return rgb;
|
|
7941
7736
|
},
|
|
7942
|
-
unitObject
|
|
7943
|
-
|
|
7737
|
+
unitObject() {
|
|
7738
|
+
const rgb = this.rgb().object();
|
|
7944
7739
|
rgb.r /= 255;
|
|
7945
7740
|
rgb.g /= 255;
|
|
7946
7741
|
rgb.b /= 255;
|
|
@@ -7949,24 +7744,21 @@ var require_color = __commonJS({
|
|
|
7949
7744
|
}
|
|
7950
7745
|
return rgb;
|
|
7951
7746
|
},
|
|
7952
|
-
round
|
|
7747
|
+
round(places) {
|
|
7953
7748
|
places = Math.max(places || 0, 0);
|
|
7954
|
-
return new Color(this.color.map(roundToPlace(places))
|
|
7749
|
+
return new Color([...this.color.map(roundToPlace(places)), this.valpha], this.model);
|
|
7955
7750
|
},
|
|
7956
|
-
alpha
|
|
7957
|
-
if (
|
|
7958
|
-
return new Color(this.color
|
|
7751
|
+
alpha(value) {
|
|
7752
|
+
if (value !== void 0) {
|
|
7753
|
+
return new Color([...this.color, Math.max(0, Math.min(1, value))], this.model);
|
|
7959
7754
|
}
|
|
7960
7755
|
return this.valpha;
|
|
7961
7756
|
},
|
|
7962
|
-
//
|
|
7757
|
+
// Rgb
|
|
7963
7758
|
red: getset("rgb", 0, maxfn(255)),
|
|
7964
7759
|
green: getset("rgb", 1, maxfn(255)),
|
|
7965
7760
|
blue: getset("rgb", 2, maxfn(255)),
|
|
7966
|
-
hue: getset(["hsl", "hsv", "hsl", "hwb", "hcg"], 0,
|
|
7967
|
-
return (val % 360 + 360) % 360;
|
|
7968
|
-
}),
|
|
7969
|
-
// eslint-disable-line brace-style
|
|
7761
|
+
hue: getset(["hsl", "hsv", "hsl", "hwb", "hcg"], 0, (value) => (value % 360 + 360) % 360),
|
|
7970
7762
|
saturationl: getset("hsl", 1, maxfn(100)),
|
|
7971
7763
|
lightness: getset("hsl", 2, maxfn(100)),
|
|
7972
7764
|
saturationv: getset("hsv", 1, maxfn(100)),
|
|
@@ -7979,127 +7771,138 @@ var require_color = __commonJS({
|
|
|
7979
7771
|
magenta: getset("cmyk", 1, maxfn(100)),
|
|
7980
7772
|
yellow: getset("cmyk", 2, maxfn(100)),
|
|
7981
7773
|
black: getset("cmyk", 3, maxfn(100)),
|
|
7982
|
-
x: getset("xyz", 0, maxfn(
|
|
7774
|
+
x: getset("xyz", 0, maxfn(95.047)),
|
|
7983
7775
|
y: getset("xyz", 1, maxfn(100)),
|
|
7984
|
-
z: getset("xyz", 2, maxfn(
|
|
7776
|
+
z: getset("xyz", 2, maxfn(108.833)),
|
|
7985
7777
|
l: getset("lab", 0, maxfn(100)),
|
|
7986
7778
|
a: getset("lab", 1),
|
|
7987
7779
|
b: getset("lab", 2),
|
|
7988
|
-
keyword
|
|
7989
|
-
if (
|
|
7990
|
-
return new Color(
|
|
7780
|
+
keyword(value) {
|
|
7781
|
+
if (value !== void 0) {
|
|
7782
|
+
return new Color(value);
|
|
7991
7783
|
}
|
|
7992
7784
|
return convert[this.model].keyword(this.color);
|
|
7993
7785
|
},
|
|
7994
|
-
hex
|
|
7995
|
-
if (
|
|
7996
|
-
return new Color(
|
|
7786
|
+
hex(value) {
|
|
7787
|
+
if (value !== void 0) {
|
|
7788
|
+
return new Color(value);
|
|
7789
|
+
}
|
|
7790
|
+
return cs.to.hex(...this.rgb().round().color);
|
|
7791
|
+
},
|
|
7792
|
+
hexa(value) {
|
|
7793
|
+
if (value !== void 0) {
|
|
7794
|
+
return new Color(value);
|
|
7795
|
+
}
|
|
7796
|
+
const rgbArray = this.rgb().round().color;
|
|
7797
|
+
let alphaHex = Math.round(this.valpha * 255).toString(16).toUpperCase();
|
|
7798
|
+
if (alphaHex.length === 1) {
|
|
7799
|
+
alphaHex = "0" + alphaHex;
|
|
7997
7800
|
}
|
|
7998
|
-
return
|
|
7801
|
+
return cs.to.hex(...rgbArray) + alphaHex;
|
|
7999
7802
|
},
|
|
8000
|
-
rgbNumber
|
|
8001
|
-
|
|
7803
|
+
rgbNumber() {
|
|
7804
|
+
const rgb = this.rgb().color;
|
|
8002
7805
|
return (rgb[0] & 255) << 16 | (rgb[1] & 255) << 8 | rgb[2] & 255;
|
|
8003
7806
|
},
|
|
8004
|
-
luminosity
|
|
8005
|
-
|
|
8006
|
-
|
|
8007
|
-
for (
|
|
8008
|
-
|
|
8009
|
-
lum[i] = chan <= 0.
|
|
7807
|
+
luminosity() {
|
|
7808
|
+
const rgb = this.rgb().color;
|
|
7809
|
+
const lum = [];
|
|
7810
|
+
for (const [i, element] of rgb.entries()) {
|
|
7811
|
+
const chan = element / 255;
|
|
7812
|
+
lum[i] = chan <= 0.04045 ? chan / 12.92 : ((chan + 0.055) / 1.055) ** 2.4;
|
|
8010
7813
|
}
|
|
8011
7814
|
return 0.2126 * lum[0] + 0.7152 * lum[1] + 0.0722 * lum[2];
|
|
8012
7815
|
},
|
|
8013
|
-
contrast
|
|
8014
|
-
|
|
8015
|
-
|
|
7816
|
+
contrast(color2) {
|
|
7817
|
+
const lum1 = this.luminosity();
|
|
7818
|
+
const lum2 = color2.luminosity();
|
|
8016
7819
|
if (lum1 > lum2) {
|
|
8017
7820
|
return (lum1 + 0.05) / (lum2 + 0.05);
|
|
8018
7821
|
}
|
|
8019
7822
|
return (lum2 + 0.05) / (lum1 + 0.05);
|
|
8020
7823
|
},
|
|
8021
|
-
level
|
|
8022
|
-
|
|
8023
|
-
if (contrastRatio >= 7
|
|
7824
|
+
level(color2) {
|
|
7825
|
+
const contrastRatio = this.contrast(color2);
|
|
7826
|
+
if (contrastRatio >= 7) {
|
|
8024
7827
|
return "AAA";
|
|
8025
7828
|
}
|
|
8026
7829
|
return contrastRatio >= 4.5 ? "AA" : "";
|
|
8027
7830
|
},
|
|
8028
|
-
isDark
|
|
8029
|
-
|
|
8030
|
-
|
|
7831
|
+
isDark() {
|
|
7832
|
+
const rgb = this.rgb().color;
|
|
7833
|
+
const yiq = (rgb[0] * 2126 + rgb[1] * 7152 + rgb[2] * 722) / 1e4;
|
|
8031
7834
|
return yiq < 128;
|
|
8032
7835
|
},
|
|
8033
|
-
isLight
|
|
7836
|
+
isLight() {
|
|
8034
7837
|
return !this.isDark();
|
|
8035
7838
|
},
|
|
8036
|
-
negate
|
|
8037
|
-
|
|
8038
|
-
for (
|
|
7839
|
+
negate() {
|
|
7840
|
+
const rgb = this.rgb();
|
|
7841
|
+
for (let i = 0; i < 3; i++) {
|
|
8039
7842
|
rgb.color[i] = 255 - rgb.color[i];
|
|
8040
7843
|
}
|
|
8041
7844
|
return rgb;
|
|
8042
7845
|
},
|
|
8043
|
-
lighten
|
|
8044
|
-
|
|
7846
|
+
lighten(ratio) {
|
|
7847
|
+
const hsl = this.hsl();
|
|
8045
7848
|
hsl.color[2] += hsl.color[2] * ratio;
|
|
8046
7849
|
return hsl;
|
|
8047
7850
|
},
|
|
8048
|
-
darken
|
|
8049
|
-
|
|
7851
|
+
darken(ratio) {
|
|
7852
|
+
const hsl = this.hsl();
|
|
8050
7853
|
hsl.color[2] -= hsl.color[2] * ratio;
|
|
8051
7854
|
return hsl;
|
|
8052
7855
|
},
|
|
8053
|
-
saturate
|
|
8054
|
-
|
|
7856
|
+
saturate(ratio) {
|
|
7857
|
+
const hsl = this.hsl();
|
|
8055
7858
|
hsl.color[1] += hsl.color[1] * ratio;
|
|
8056
7859
|
return hsl;
|
|
8057
7860
|
},
|
|
8058
|
-
desaturate
|
|
8059
|
-
|
|
7861
|
+
desaturate(ratio) {
|
|
7862
|
+
const hsl = this.hsl();
|
|
8060
7863
|
hsl.color[1] -= hsl.color[1] * ratio;
|
|
8061
7864
|
return hsl;
|
|
8062
7865
|
},
|
|
8063
|
-
whiten
|
|
8064
|
-
|
|
7866
|
+
whiten(ratio) {
|
|
7867
|
+
const hwb = this.hwb();
|
|
8065
7868
|
hwb.color[1] += hwb.color[1] * ratio;
|
|
8066
7869
|
return hwb;
|
|
8067
7870
|
},
|
|
8068
|
-
blacken
|
|
8069
|
-
|
|
7871
|
+
blacken(ratio) {
|
|
7872
|
+
const hwb = this.hwb();
|
|
8070
7873
|
hwb.color[2] += hwb.color[2] * ratio;
|
|
8071
7874
|
return hwb;
|
|
8072
7875
|
},
|
|
8073
|
-
grayscale
|
|
8074
|
-
|
|
8075
|
-
|
|
8076
|
-
return Color.rgb(
|
|
7876
|
+
grayscale() {
|
|
7877
|
+
const rgb = this.rgb().color;
|
|
7878
|
+
const value = rgb[0] * 0.3 + rgb[1] * 0.59 + rgb[2] * 0.11;
|
|
7879
|
+
return Color.rgb(value, value, value);
|
|
8077
7880
|
},
|
|
8078
|
-
fade
|
|
7881
|
+
fade(ratio) {
|
|
8079
7882
|
return this.alpha(this.valpha - this.valpha * ratio);
|
|
8080
7883
|
},
|
|
8081
|
-
opaquer
|
|
7884
|
+
opaquer(ratio) {
|
|
8082
7885
|
return this.alpha(this.valpha + this.valpha * ratio);
|
|
8083
7886
|
},
|
|
8084
|
-
rotate
|
|
8085
|
-
|
|
8086
|
-
|
|
7887
|
+
rotate(degrees) {
|
|
7888
|
+
const hsl = this.hsl();
|
|
7889
|
+
let hue = hsl.color[0];
|
|
8087
7890
|
hue = (hue + degrees) % 360;
|
|
8088
7891
|
hue = hue < 0 ? 360 + hue : hue;
|
|
8089
7892
|
hsl.color[0] = hue;
|
|
8090
7893
|
return hsl;
|
|
8091
7894
|
},
|
|
8092
|
-
mix
|
|
7895
|
+
mix(mixinColor, weight) {
|
|
8093
7896
|
if (!mixinColor || !mixinColor.rgb) {
|
|
8094
7897
|
throw new Error('Argument to "mix" was not a Color instance, but rather an instance of ' + typeof mixinColor);
|
|
8095
7898
|
}
|
|
8096
|
-
|
|
8097
|
-
|
|
8098
|
-
|
|
8099
|
-
|
|
8100
|
-
|
|
8101
|
-
|
|
8102
|
-
|
|
7899
|
+
const color1 = mixinColor.rgb();
|
|
7900
|
+
const color2 = this.rgb();
|
|
7901
|
+
const p = weight === void 0 ? 0.5 : weight;
|
|
7902
|
+
const w = 2 * p - 1;
|
|
7903
|
+
const a = color1.alpha() - color2.alpha();
|
|
7904
|
+
const w1 = ((w * a === -1 ? w : (w + a) / (1 + w * a)) + 1) / 2;
|
|
7905
|
+
const w2 = 1 - w1;
|
|
8103
7906
|
return Color.rgb(
|
|
8104
7907
|
w1 * color1.red() + w2 * color2.red(),
|
|
8105
7908
|
w1 * color1.green() + w2 * color2.green(),
|
|
@@ -8108,50 +7911,50 @@ var require_color = __commonJS({
|
|
|
8108
7911
|
);
|
|
8109
7912
|
}
|
|
8110
7913
|
};
|
|
8111
|
-
Object.keys(convert)
|
|
8112
|
-
if (skippedModels.
|
|
8113
|
-
|
|
7914
|
+
for (const model of Object.keys(convert)) {
|
|
7915
|
+
if (skippedModels.includes(model)) {
|
|
7916
|
+
continue;
|
|
8114
7917
|
}
|
|
8115
|
-
|
|
8116
|
-
Color.prototype[model] = function() {
|
|
7918
|
+
const { channels } = convert[model];
|
|
7919
|
+
Color.prototype[model] = function(...arguments_) {
|
|
8117
7920
|
if (this.model === model) {
|
|
8118
7921
|
return new Color(this);
|
|
8119
7922
|
}
|
|
8120
|
-
if (
|
|
8121
|
-
return new Color(
|
|
7923
|
+
if (arguments_.length > 0) {
|
|
7924
|
+
return new Color(arguments_, model);
|
|
8122
7925
|
}
|
|
8123
|
-
|
|
8124
|
-
return new Color(assertArray(convert[this.model][model].raw(this.color)).concat(newAlpha), model);
|
|
7926
|
+
return new Color([...assertArray(convert[this.model][model].raw(this.color)), this.valpha], model);
|
|
8125
7927
|
};
|
|
8126
|
-
Color[model] = function(
|
|
7928
|
+
Color[model] = function(...arguments_) {
|
|
7929
|
+
let color = arguments_[0];
|
|
8127
7930
|
if (typeof color === "number") {
|
|
8128
|
-
color = zeroArray(
|
|
7931
|
+
color = zeroArray(arguments_, channels);
|
|
8129
7932
|
}
|
|
8130
7933
|
return new Color(color, model);
|
|
8131
7934
|
};
|
|
8132
|
-
}
|
|
8133
|
-
function roundTo(
|
|
8134
|
-
return Number(
|
|
7935
|
+
}
|
|
7936
|
+
function roundTo(number, places) {
|
|
7937
|
+
return Number(number.toFixed(places));
|
|
8135
7938
|
}
|
|
8136
7939
|
function roundToPlace(places) {
|
|
8137
|
-
return function(
|
|
8138
|
-
return roundTo(
|
|
7940
|
+
return function(number) {
|
|
7941
|
+
return roundTo(number, places);
|
|
8139
7942
|
};
|
|
8140
7943
|
}
|
|
8141
7944
|
function getset(model, channel, modifier) {
|
|
8142
7945
|
model = Array.isArray(model) ? model : [model];
|
|
8143
|
-
|
|
8144
|
-
(limiters[m]
|
|
8145
|
-
}
|
|
7946
|
+
for (const m of model) {
|
|
7947
|
+
(limiters[m] ||= [])[channel] = modifier;
|
|
7948
|
+
}
|
|
8146
7949
|
model = model[0];
|
|
8147
|
-
return function(
|
|
8148
|
-
|
|
8149
|
-
if (
|
|
7950
|
+
return function(value) {
|
|
7951
|
+
let result;
|
|
7952
|
+
if (value !== void 0) {
|
|
8150
7953
|
if (modifier) {
|
|
8151
|
-
|
|
7954
|
+
value = modifier(value);
|
|
8152
7955
|
}
|
|
8153
7956
|
result = this[model]();
|
|
8154
|
-
result.color[channel] =
|
|
7957
|
+
result.color[channel] = value;
|
|
8155
7958
|
return result;
|
|
8156
7959
|
}
|
|
8157
7960
|
result = this[model]().color[channel];
|
|
@@ -8166,26 +7969,21 @@ var require_color = __commonJS({
|
|
|
8166
7969
|
return Math.max(0, Math.min(max, v));
|
|
8167
7970
|
};
|
|
8168
7971
|
}
|
|
8169
|
-
function assertArray(
|
|
8170
|
-
return Array.isArray(
|
|
7972
|
+
function assertArray(value) {
|
|
7973
|
+
return Array.isArray(value) ? value : [value];
|
|
8171
7974
|
}
|
|
8172
|
-
function zeroArray(
|
|
8173
|
-
for (
|
|
8174
|
-
if (typeof
|
|
8175
|
-
|
|
7975
|
+
function zeroArray(array, length) {
|
|
7976
|
+
for (let i = 0; i < length; i++) {
|
|
7977
|
+
if (typeof array[i] !== "number") {
|
|
7978
|
+
array[i] = 0;
|
|
8176
7979
|
}
|
|
8177
7980
|
}
|
|
8178
|
-
return
|
|
7981
|
+
return array;
|
|
8179
7982
|
}
|
|
8180
|
-
|
|
8181
|
-
|
|
8182
|
-
}
|
|
8183
|
-
|
|
8184
|
-
// ../../node_modules/text-hex/index.js
|
|
8185
|
-
var require_text_hex = __commonJS({
|
|
8186
|
-
"../../node_modules/text-hex/index.js"(exports, module) {
|
|
8187
|
-
"use strict";
|
|
8188
|
-
module.exports = function hex(str) {
|
|
7983
|
+
function getDefaultExportFromCjs(x) {
|
|
7984
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
7985
|
+
}
|
|
7986
|
+
var textHex = function hex2(str) {
|
|
8189
7987
|
for (var i = 0, hash = 0; i < str.length; hash = str.charCodeAt(i++) + ((hash << 5) - hash)) ;
|
|
8190
7988
|
var color = Math.floor(
|
|
8191
7989
|
Math.abs(
|
|
@@ -8194,24 +7992,17 @@ var require_text_hex = __commonJS({
|
|
|
8194
7992
|
).toString(16);
|
|
8195
7993
|
return "#" + Array(6 - color.length + 1).join("0") + color;
|
|
8196
7994
|
};
|
|
8197
|
-
|
|
8198
|
-
|
|
8199
|
-
|
|
8200
|
-
|
|
8201
|
-
var require_colorspace = __commonJS({
|
|
8202
|
-
"../../node_modules/colorspace/index.js"(exports, module) {
|
|
8203
|
-
"use strict";
|
|
8204
|
-
var color = require_color();
|
|
8205
|
-
var hex = require_text_hex();
|
|
8206
|
-
module.exports = function colorspace(namespace, delimiter) {
|
|
8207
|
-
var split = namespace.split(delimiter || ":");
|
|
8208
|
-
var base = hex(split[0]);
|
|
7995
|
+
var hex = /* @__PURE__ */ getDefaultExportFromCjs(textHex);
|
|
7996
|
+
function colorspace(namespace, delimiter) {
|
|
7997
|
+
const split = namespace.split(delimiter || ":");
|
|
7998
|
+
let base = hex(split[0]);
|
|
8209
7999
|
if (!split.length) return base;
|
|
8210
|
-
for (
|
|
8211
|
-
base =
|
|
8000
|
+
for (let i = 0, l = split.length - 1; i < l; i++) {
|
|
8001
|
+
base = Color(base).mix(Color(hex(split[i + 1]))).saturate(1).hex();
|
|
8212
8002
|
}
|
|
8213
8003
|
return base;
|
|
8214
|
-
}
|
|
8004
|
+
}
|
|
8005
|
+
module.exports = colorspace;
|
|
8215
8006
|
}
|
|
8216
8007
|
});
|
|
8217
8008
|
|
|
@@ -8262,7 +8053,7 @@ var require_kuler = __commonJS({
|
|
|
8262
8053
|
var require_namespace_ansi = __commonJS({
|
|
8263
8054
|
"../../node_modules/@dabh/diagnostics/modifiers/namespace-ansi.js"(exports, module) {
|
|
8264
8055
|
"use strict";
|
|
8265
|
-
var colorspace =
|
|
8056
|
+
var colorspace = require_index_cjs();
|
|
8266
8057
|
var kuler = require_kuler();
|
|
8267
8058
|
module.exports = function ansiModifier(args, options) {
|
|
8268
8059
|
var namespace = options.namespace;
|
|
@@ -8545,6 +8336,28 @@ var require_file = __commonJS({
|
|
|
8545
8336
|
}
|
|
8546
8337
|
}
|
|
8547
8338
|
}
|
|
8339
|
+
/**
|
|
8340
|
+
* Called by Node.js Writable stream before emitting 'finish'.
|
|
8341
|
+
* Ensures all buffered data is flushed to the underlying file stream
|
|
8342
|
+
* before the transport signals completion.
|
|
8343
|
+
* @param {Function} callback - Callback to signal completion.
|
|
8344
|
+
* @private
|
|
8345
|
+
*/
|
|
8346
|
+
_final(callback) {
|
|
8347
|
+
if (this._opening) {
|
|
8348
|
+
this.once("open", () => this._final(callback));
|
|
8349
|
+
return;
|
|
8350
|
+
}
|
|
8351
|
+
this._stream.end();
|
|
8352
|
+
if (!this._dest) {
|
|
8353
|
+
return callback();
|
|
8354
|
+
}
|
|
8355
|
+
if (this._dest.writableFinished) {
|
|
8356
|
+
return callback();
|
|
8357
|
+
}
|
|
8358
|
+
this._dest.once("finish", callback);
|
|
8359
|
+
this._dest.once("error", callback);
|
|
8360
|
+
}
|
|
8548
8361
|
/**
|
|
8549
8362
|
* Core logging method exposed to Winston. Metadata is optional.
|
|
8550
8363
|
* @param {Object} info - TODO: add param description.
|
|
@@ -10218,6 +10031,7 @@ var require_logger = __commonJS({
|
|
|
10218
10031
|
if (info instanceof Error) {
|
|
10219
10032
|
infoClone.stack = info.stack;
|
|
10220
10033
|
infoClone.message = info.message;
|
|
10034
|
+
infoClone.cause = info.cause;
|
|
10221
10035
|
}
|
|
10222
10036
|
logger2.write(infoClone);
|
|
10223
10037
|
}
|
|
@@ -10287,6 +10101,23 @@ var require_logger = __commonJS({
|
|
|
10287
10101
|
this.rejections.handle(rejectionHandlers);
|
|
10288
10102
|
}
|
|
10289
10103
|
}
|
|
10104
|
+
/* eslint-disable valid-jsdoc */
|
|
10105
|
+
/**
|
|
10106
|
+
* Helper method to get the highest logging level associated with a logger
|
|
10107
|
+
*
|
|
10108
|
+
* @returns { number | null } - The highest configured logging level, null
|
|
10109
|
+
* for invalid configuration
|
|
10110
|
+
*/
|
|
10111
|
+
getHighestLogLevel() {
|
|
10112
|
+
const configuredLevelValue = getLevelValue(this.levels, this.level);
|
|
10113
|
+
if (!this.transports || this.transports.length === 0) {
|
|
10114
|
+
return configuredLevelValue;
|
|
10115
|
+
}
|
|
10116
|
+
return this.transports.reduce((max, transport) => {
|
|
10117
|
+
const levelValue = getLevelValue(this.levels, transport.level);
|
|
10118
|
+
return levelValue !== null && levelValue > max ? levelValue : max;
|
|
10119
|
+
}, configuredLevelValue);
|
|
10120
|
+
}
|
|
10290
10121
|
isLevelEnabled(level) {
|
|
10291
10122
|
const givenLevelValue = getLevelValue(this.levels, level);
|
|
10292
10123
|
if (givenLevelValue === null) {
|