@tsparticles/plugin-hsv-color 3.0.3 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/385.min.js +2 -0
- package/385.min.js.LICENSE.txt +1 -0
- package/browser/HsvColorManager.js +47 -35
- package/browser/index.js +1 -1
- package/cjs/HsvColorManager.js +46 -34
- package/cjs/index.js +25 -2
- package/dist_browser_HsvColorManager_js.js +30 -0
- package/esm/HsvColorManager.js +47 -35
- package/esm/index.js +1 -1
- package/package.json +2 -2
- package/report.html +3 -3
- package/tsparticles.plugin.hsvColor.js +241 -197
- package/tsparticles.plugin.hsvColor.min.js +1 -1
- package/tsparticles.plugin.hsvColor.min.js.LICENSE.txt +1 -1
- package/umd/HsvColorManager.js +46 -34
- package/umd/index.js +27 -3
package/385.min.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see 385.min.js.LICENSE.txt */
|
|
2
|
+
(this.webpackChunk_tsparticles_plugin_hsv_color=this.webpackChunk_tsparticles_plugin_hsv_color||[]).push([[385],{385:(s,r,e)=>{e.d(r,{HsvColorManager:()=>o});var t=e(533);const a=255;function n(s){const r={b:0,g:0,r:0},e=s.h/60,n=s.s/t.percentDenominator,o=s.v/t.percentDenominator,h=o*n,v=h*(1-Math.abs(e%2-1));let i;if(e>=0&&e<=1?i={r:h,g:v,b:0}:e>1&&e<=2?i={r:v,g:h,b:0}:e>2&&e<=3?i={r:0,g:h,b:v}:e>3&&e<=4?i={r:0,g:v,b:h}:e>4&&e<=5?i={r:v,g:0,b:h}:e>5&&e<=6&&(i={r:h,g:0,b:v}),i){const s=o-h;r.r=Math.floor((i.r+s)*a),r.g=Math.floor((i.g+s)*a),r.b=Math.floor((i.b+s)*a)}return r}class o{constructor(){this.key="hsv",this.stringPrefix="hsv"}handleColor(s){const r=s.value.hsv??s.value;if(void 0!==r.h&&void 0!==r.v)return n(r)}handleRangeColor(s){const r=s.value.hsv??s.value;if(void 0!==r.h&&void 0!==r.v)return n({h:(0,t.getRangeValue)(r.h),s:(0,t.getRangeValue)(r.s),v:(0,t.getRangeValue)(r.v)})}parseString(s){if(!s.startsWith("hsv"))return;const r=/hsva?\(\s*(\d+)°\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(,\s*([\d.%]+)\s*)?\)/i.exec(s),e=1,a=2,o=3,h=5;return r?{a:(v={a:r.length>4?(0,t.parseAlpha)(r[h]):1,h:parseInt(r[e],10),s:parseInt(r[a],10),v:parseInt(r[o],10)}).a,...n(v)}:void 0;var v}}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! tsParticles HSV Color Plugin v3.2.0 by Matteo Bruni */
|
|
@@ -1,25 +1,31 @@
|
|
|
1
|
-
import { getRangeValue, getStyleFromHsl, parseAlpha, } from "@tsparticles/engine";
|
|
1
|
+
import { getRangeValue, getStyleFromHsl, parseAlpha, percentDenominator, } from "@tsparticles/engine";
|
|
2
|
+
const rgbFactor = 255, double = 2, half = 0.5;
|
|
2
3
|
export function rgbToHsv(rgb) {
|
|
3
4
|
const rgbPercent = {
|
|
4
|
-
r: rgb.r /
|
|
5
|
-
g: rgb.g /
|
|
6
|
-
b: rgb.b /
|
|
5
|
+
r: rgb.r / rgbFactor,
|
|
6
|
+
g: rgb.g / rgbFactor,
|
|
7
|
+
b: rgb.b / rgbFactor,
|
|
7
8
|
}, xMax = Math.max(rgbPercent.r, rgbPercent.g, rgbPercent.b), xMin = Math.min(rgbPercent.r, rgbPercent.g, rgbPercent.b), v = xMax, c = xMax - xMin;
|
|
8
9
|
let h = 0;
|
|
10
|
+
const phaseOffset = {
|
|
11
|
+
r: 0,
|
|
12
|
+
g: 2,
|
|
13
|
+
b: 4,
|
|
14
|
+
}, phaseValue = 60;
|
|
9
15
|
if (v === rgbPercent.r) {
|
|
10
|
-
h =
|
|
16
|
+
h = phaseValue * (phaseOffset.r + (rgbPercent.g - rgbPercent.b) / c);
|
|
11
17
|
}
|
|
12
18
|
else if (v === rgbPercent.g) {
|
|
13
|
-
h =
|
|
19
|
+
h = phaseValue * (phaseOffset.g + (rgbPercent.b - rgbPercent.r) / c);
|
|
14
20
|
}
|
|
15
21
|
else if (v === rgbPercent.b) {
|
|
16
|
-
h =
|
|
22
|
+
h = phaseValue * (phaseOffset.b + (rgbPercent.r - rgbPercent.g) / c);
|
|
17
23
|
}
|
|
18
|
-
const s = !v ?
|
|
24
|
+
const defaultSaturation = 0, s = !v ? defaultSaturation : c / v;
|
|
19
25
|
return {
|
|
20
26
|
h,
|
|
21
|
-
s: s *
|
|
22
|
-
v: v *
|
|
27
|
+
s: s * percentDenominator,
|
|
28
|
+
v: v * percentDenominator,
|
|
23
29
|
};
|
|
24
30
|
}
|
|
25
31
|
export function rgbaToHsva(rgba) {
|
|
@@ -32,11 +38,11 @@ export function getStyleFromHsv(color, opacity) {
|
|
|
32
38
|
return getStyleFromHsl(hsvToHsl(color), opacity);
|
|
33
39
|
}
|
|
34
40
|
export function hslToHsv(hsl) {
|
|
35
|
-
const l = hsl.l /
|
|
41
|
+
const l = hsl.l / percentDenominator, sl = hsl.s / percentDenominator, offset = 1, noValue = 0, v = l + sl * Math.min(l, offset - l), sv = !v ? noValue : double * (offset - l / v);
|
|
36
42
|
return {
|
|
37
43
|
h: hsl.h,
|
|
38
|
-
s: sv *
|
|
39
|
-
v: v *
|
|
44
|
+
s: sv * percentDenominator,
|
|
45
|
+
v: v * percentDenominator,
|
|
40
46
|
};
|
|
41
47
|
}
|
|
42
48
|
export function hslaToHsva(hsla) {
|
|
@@ -46,11 +52,11 @@ export function hslaToHsva(hsla) {
|
|
|
46
52
|
};
|
|
47
53
|
}
|
|
48
54
|
export function hsvToHsl(hsv) {
|
|
49
|
-
const v = hsv.v /
|
|
55
|
+
const v = hsv.v / percentDenominator, sv = hsv.s / percentDenominator, offset = 1, noValue = 0, l = v * (offset - sv * half), sl = !l || l === offset ? noValue : (v - l) / Math.min(l, offset - l);
|
|
50
56
|
return {
|
|
51
57
|
h: hsv.h,
|
|
52
|
-
l: l *
|
|
53
|
-
s: sl *
|
|
58
|
+
l: l * percentDenominator,
|
|
59
|
+
s: sl * percentDenominator,
|
|
54
60
|
};
|
|
55
61
|
}
|
|
56
62
|
export function hsvaToHsla(hsva) {
|
|
@@ -60,48 +66,49 @@ export function hsvaToHsla(hsva) {
|
|
|
60
66
|
};
|
|
61
67
|
}
|
|
62
68
|
export function hsvToRgb(hsv) {
|
|
63
|
-
const result = { b: 0, g: 0, r: 0 }, hsvPercent = {
|
|
64
|
-
h: hsv.h /
|
|
65
|
-
s: hsv.s /
|
|
66
|
-
v: hsv.v /
|
|
67
|
-
}, c = hsvPercent.v * hsvPercent.s, x = c * (
|
|
69
|
+
const result = { b: 0, g: 0, r: 0 }, phase = 60, hsvPercent = {
|
|
70
|
+
h: hsv.h / phase,
|
|
71
|
+
s: hsv.s / percentDenominator,
|
|
72
|
+
v: hsv.v / percentDenominator,
|
|
73
|
+
}, offset = 1, hPercentFactor = 2, c = hsvPercent.v * hsvPercent.s, x = c * (offset - Math.abs((hsvPercent.h % hPercentFactor) - offset));
|
|
68
74
|
let tempRgb;
|
|
69
|
-
|
|
75
|
+
const cxzRange = { min: 0, max: 1 }, xczRange = { min: 1, max: 2 }, zcxRange = { min: 2, max: 3 }, zxcRange = { min: 3, max: 4 }, xzcRange = { min: 4, max: 5 }, czxRange = { min: 5, max: 6 };
|
|
76
|
+
if (hsvPercent.h >= cxzRange.min && hsvPercent.h <= cxzRange.max) {
|
|
70
77
|
tempRgb = {
|
|
71
78
|
r: c,
|
|
72
79
|
g: x,
|
|
73
80
|
b: 0,
|
|
74
81
|
};
|
|
75
82
|
}
|
|
76
|
-
else if (hsvPercent.h >
|
|
83
|
+
else if (hsvPercent.h > xczRange.min && hsvPercent.h <= xczRange.max) {
|
|
77
84
|
tempRgb = {
|
|
78
85
|
r: x,
|
|
79
86
|
g: c,
|
|
80
87
|
b: 0,
|
|
81
88
|
};
|
|
82
89
|
}
|
|
83
|
-
else if (hsvPercent.h >
|
|
90
|
+
else if (hsvPercent.h > zcxRange.min && hsvPercent.h <= zcxRange.max) {
|
|
84
91
|
tempRgb = {
|
|
85
92
|
r: 0,
|
|
86
93
|
g: c,
|
|
87
94
|
b: x,
|
|
88
95
|
};
|
|
89
96
|
}
|
|
90
|
-
else if (hsvPercent.h >
|
|
97
|
+
else if (hsvPercent.h > zxcRange.min && hsvPercent.h <= zxcRange.max) {
|
|
91
98
|
tempRgb = {
|
|
92
99
|
r: 0,
|
|
93
100
|
g: x,
|
|
94
101
|
b: c,
|
|
95
102
|
};
|
|
96
103
|
}
|
|
97
|
-
else if (hsvPercent.h >
|
|
104
|
+
else if (hsvPercent.h > xzcRange.min && hsvPercent.h <= xzcRange.max) {
|
|
98
105
|
tempRgb = {
|
|
99
106
|
r: x,
|
|
100
107
|
g: 0,
|
|
101
108
|
b: c,
|
|
102
109
|
};
|
|
103
110
|
}
|
|
104
|
-
else if (hsvPercent.h >
|
|
111
|
+
else if (hsvPercent.h > czxRange.min && hsvPercent.h <= czxRange.max) {
|
|
105
112
|
tempRgb = {
|
|
106
113
|
r: c,
|
|
107
114
|
g: 0,
|
|
@@ -110,9 +117,9 @@ export function hsvToRgb(hsv) {
|
|
|
110
117
|
}
|
|
111
118
|
if (tempRgb) {
|
|
112
119
|
const m = hsvPercent.v - c;
|
|
113
|
-
result.r = Math.floor((tempRgb.r + m) *
|
|
114
|
-
result.g = Math.floor((tempRgb.g + m) *
|
|
115
|
-
result.b = Math.floor((tempRgb.b + m) *
|
|
120
|
+
result.r = Math.floor((tempRgb.r + m) * rgbFactor);
|
|
121
|
+
result.g = Math.floor((tempRgb.g + m) * rgbFactor);
|
|
122
|
+
result.b = Math.floor((tempRgb.b + m) * rgbFactor);
|
|
116
123
|
}
|
|
117
124
|
return result;
|
|
118
125
|
}
|
|
@@ -147,13 +154,18 @@ export class HsvColorManager {
|
|
|
147
154
|
if (!input.startsWith("hsv")) {
|
|
148
155
|
return;
|
|
149
156
|
}
|
|
150
|
-
const regex = /hsva?\(\s*(\d+)°\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(,\s*([\d.%]+)\s*)?\)/i, result = regex.exec(input)
|
|
157
|
+
const regex = /hsva?\(\s*(\d+)°\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(,\s*([\d.%]+)\s*)?\)/i, result = regex.exec(input), fullLength = 4, indexes = {
|
|
158
|
+
h: 1,
|
|
159
|
+
s: 2,
|
|
160
|
+
v: 3,
|
|
161
|
+
a: 5,
|
|
162
|
+
}, defaultAlpha = 1, radix = 10;
|
|
151
163
|
return result
|
|
152
164
|
? hsvaToRgba({
|
|
153
|
-
a: result.length >
|
|
154
|
-
h: parseInt(result[
|
|
155
|
-
s: parseInt(result[
|
|
156
|
-
v: parseInt(result[
|
|
165
|
+
a: result.length > fullLength ? parseAlpha(result[indexes.a]) : defaultAlpha,
|
|
166
|
+
h: parseInt(result[indexes.h], radix),
|
|
167
|
+
s: parseInt(result[indexes.s], radix),
|
|
168
|
+
v: parseInt(result[indexes.v], radix),
|
|
157
169
|
})
|
|
158
170
|
: undefined;
|
|
159
171
|
}
|
package/browser/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { HsvColorManager } from "./HsvColorManager.js";
|
|
2
1
|
import { addColorManager } from "@tsparticles/engine";
|
|
3
2
|
export async function loadHsvColorPlugin() {
|
|
3
|
+
const { HsvColorManager } = await import("./HsvColorManager.js");
|
|
4
4
|
addColorManager(new HsvColorManager());
|
|
5
5
|
}
|
package/cjs/HsvColorManager.js
CHANGED
|
@@ -2,27 +2,33 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.HsvColorManager = exports.hsvaToRgba = exports.hsvToRgb = exports.hsvaToHsla = exports.hsvToHsl = exports.hslaToHsva = exports.hslToHsv = exports.getStyleFromHsv = exports.rgbaToHsva = exports.rgbToHsv = void 0;
|
|
4
4
|
const engine_1 = require("@tsparticles/engine");
|
|
5
|
+
const rgbFactor = 255, double = 2, half = 0.5;
|
|
5
6
|
function rgbToHsv(rgb) {
|
|
6
7
|
const rgbPercent = {
|
|
7
|
-
r: rgb.r /
|
|
8
|
-
g: rgb.g /
|
|
9
|
-
b: rgb.b /
|
|
8
|
+
r: rgb.r / rgbFactor,
|
|
9
|
+
g: rgb.g / rgbFactor,
|
|
10
|
+
b: rgb.b / rgbFactor,
|
|
10
11
|
}, xMax = Math.max(rgbPercent.r, rgbPercent.g, rgbPercent.b), xMin = Math.min(rgbPercent.r, rgbPercent.g, rgbPercent.b), v = xMax, c = xMax - xMin;
|
|
11
12
|
let h = 0;
|
|
13
|
+
const phaseOffset = {
|
|
14
|
+
r: 0,
|
|
15
|
+
g: 2,
|
|
16
|
+
b: 4,
|
|
17
|
+
}, phaseValue = 60;
|
|
12
18
|
if (v === rgbPercent.r) {
|
|
13
|
-
h =
|
|
19
|
+
h = phaseValue * (phaseOffset.r + (rgbPercent.g - rgbPercent.b) / c);
|
|
14
20
|
}
|
|
15
21
|
else if (v === rgbPercent.g) {
|
|
16
|
-
h =
|
|
22
|
+
h = phaseValue * (phaseOffset.g + (rgbPercent.b - rgbPercent.r) / c);
|
|
17
23
|
}
|
|
18
24
|
else if (v === rgbPercent.b) {
|
|
19
|
-
h =
|
|
25
|
+
h = phaseValue * (phaseOffset.b + (rgbPercent.r - rgbPercent.g) / c);
|
|
20
26
|
}
|
|
21
|
-
const s = !v ?
|
|
27
|
+
const defaultSaturation = 0, s = !v ? defaultSaturation : c / v;
|
|
22
28
|
return {
|
|
23
29
|
h,
|
|
24
|
-
s: s *
|
|
25
|
-
v: v *
|
|
30
|
+
s: s * engine_1.percentDenominator,
|
|
31
|
+
v: v * engine_1.percentDenominator,
|
|
26
32
|
};
|
|
27
33
|
}
|
|
28
34
|
exports.rgbToHsv = rgbToHsv;
|
|
@@ -38,11 +44,11 @@ function getStyleFromHsv(color, opacity) {
|
|
|
38
44
|
}
|
|
39
45
|
exports.getStyleFromHsv = getStyleFromHsv;
|
|
40
46
|
function hslToHsv(hsl) {
|
|
41
|
-
const l = hsl.l /
|
|
47
|
+
const l = hsl.l / engine_1.percentDenominator, sl = hsl.s / engine_1.percentDenominator, offset = 1, noValue = 0, v = l + sl * Math.min(l, offset - l), sv = !v ? noValue : double * (offset - l / v);
|
|
42
48
|
return {
|
|
43
49
|
h: hsl.h,
|
|
44
|
-
s: sv *
|
|
45
|
-
v: v *
|
|
50
|
+
s: sv * engine_1.percentDenominator,
|
|
51
|
+
v: v * engine_1.percentDenominator,
|
|
46
52
|
};
|
|
47
53
|
}
|
|
48
54
|
exports.hslToHsv = hslToHsv;
|
|
@@ -54,11 +60,11 @@ function hslaToHsva(hsla) {
|
|
|
54
60
|
}
|
|
55
61
|
exports.hslaToHsva = hslaToHsva;
|
|
56
62
|
function hsvToHsl(hsv) {
|
|
57
|
-
const v = hsv.v /
|
|
63
|
+
const v = hsv.v / engine_1.percentDenominator, sv = hsv.s / engine_1.percentDenominator, offset = 1, noValue = 0, l = v * (offset - sv * half), sl = !l || l === offset ? noValue : (v - l) / Math.min(l, offset - l);
|
|
58
64
|
return {
|
|
59
65
|
h: hsv.h,
|
|
60
|
-
l: l *
|
|
61
|
-
s: sl *
|
|
66
|
+
l: l * engine_1.percentDenominator,
|
|
67
|
+
s: sl * engine_1.percentDenominator,
|
|
62
68
|
};
|
|
63
69
|
}
|
|
64
70
|
exports.hsvToHsl = hsvToHsl;
|
|
@@ -70,48 +76,49 @@ function hsvaToHsla(hsva) {
|
|
|
70
76
|
}
|
|
71
77
|
exports.hsvaToHsla = hsvaToHsla;
|
|
72
78
|
function hsvToRgb(hsv) {
|
|
73
|
-
const result = { b: 0, g: 0, r: 0 }, hsvPercent = {
|
|
74
|
-
h: hsv.h /
|
|
75
|
-
s: hsv.s /
|
|
76
|
-
v: hsv.v /
|
|
77
|
-
}, c = hsvPercent.v * hsvPercent.s, x = c * (
|
|
79
|
+
const result = { b: 0, g: 0, r: 0 }, phase = 60, hsvPercent = {
|
|
80
|
+
h: hsv.h / phase,
|
|
81
|
+
s: hsv.s / engine_1.percentDenominator,
|
|
82
|
+
v: hsv.v / engine_1.percentDenominator,
|
|
83
|
+
}, offset = 1, hPercentFactor = 2, c = hsvPercent.v * hsvPercent.s, x = c * (offset - Math.abs((hsvPercent.h % hPercentFactor) - offset));
|
|
78
84
|
let tempRgb;
|
|
79
|
-
|
|
85
|
+
const cxzRange = { min: 0, max: 1 }, xczRange = { min: 1, max: 2 }, zcxRange = { min: 2, max: 3 }, zxcRange = { min: 3, max: 4 }, xzcRange = { min: 4, max: 5 }, czxRange = { min: 5, max: 6 };
|
|
86
|
+
if (hsvPercent.h >= cxzRange.min && hsvPercent.h <= cxzRange.max) {
|
|
80
87
|
tempRgb = {
|
|
81
88
|
r: c,
|
|
82
89
|
g: x,
|
|
83
90
|
b: 0,
|
|
84
91
|
};
|
|
85
92
|
}
|
|
86
|
-
else if (hsvPercent.h >
|
|
93
|
+
else if (hsvPercent.h > xczRange.min && hsvPercent.h <= xczRange.max) {
|
|
87
94
|
tempRgb = {
|
|
88
95
|
r: x,
|
|
89
96
|
g: c,
|
|
90
97
|
b: 0,
|
|
91
98
|
};
|
|
92
99
|
}
|
|
93
|
-
else if (hsvPercent.h >
|
|
100
|
+
else if (hsvPercent.h > zcxRange.min && hsvPercent.h <= zcxRange.max) {
|
|
94
101
|
tempRgb = {
|
|
95
102
|
r: 0,
|
|
96
103
|
g: c,
|
|
97
104
|
b: x,
|
|
98
105
|
};
|
|
99
106
|
}
|
|
100
|
-
else if (hsvPercent.h >
|
|
107
|
+
else if (hsvPercent.h > zxcRange.min && hsvPercent.h <= zxcRange.max) {
|
|
101
108
|
tempRgb = {
|
|
102
109
|
r: 0,
|
|
103
110
|
g: x,
|
|
104
111
|
b: c,
|
|
105
112
|
};
|
|
106
113
|
}
|
|
107
|
-
else if (hsvPercent.h >
|
|
114
|
+
else if (hsvPercent.h > xzcRange.min && hsvPercent.h <= xzcRange.max) {
|
|
108
115
|
tempRgb = {
|
|
109
116
|
r: x,
|
|
110
117
|
g: 0,
|
|
111
118
|
b: c,
|
|
112
119
|
};
|
|
113
120
|
}
|
|
114
|
-
else if (hsvPercent.h >
|
|
121
|
+
else if (hsvPercent.h > czxRange.min && hsvPercent.h <= czxRange.max) {
|
|
115
122
|
tempRgb = {
|
|
116
123
|
r: c,
|
|
117
124
|
g: 0,
|
|
@@ -120,9 +127,9 @@ function hsvToRgb(hsv) {
|
|
|
120
127
|
}
|
|
121
128
|
if (tempRgb) {
|
|
122
129
|
const m = hsvPercent.v - c;
|
|
123
|
-
result.r = Math.floor((tempRgb.r + m) *
|
|
124
|
-
result.g = Math.floor((tempRgb.g + m) *
|
|
125
|
-
result.b = Math.floor((tempRgb.b + m) *
|
|
130
|
+
result.r = Math.floor((tempRgb.r + m) * rgbFactor);
|
|
131
|
+
result.g = Math.floor((tempRgb.g + m) * rgbFactor);
|
|
132
|
+
result.b = Math.floor((tempRgb.b + m) * rgbFactor);
|
|
126
133
|
}
|
|
127
134
|
return result;
|
|
128
135
|
}
|
|
@@ -159,13 +166,18 @@ class HsvColorManager {
|
|
|
159
166
|
if (!input.startsWith("hsv")) {
|
|
160
167
|
return;
|
|
161
168
|
}
|
|
162
|
-
const regex = /hsva?\(\s*(\d+)°\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(,\s*([\d.%]+)\s*)?\)/i, result = regex.exec(input)
|
|
169
|
+
const regex = /hsva?\(\s*(\d+)°\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(,\s*([\d.%]+)\s*)?\)/i, result = regex.exec(input), fullLength = 4, indexes = {
|
|
170
|
+
h: 1,
|
|
171
|
+
s: 2,
|
|
172
|
+
v: 3,
|
|
173
|
+
a: 5,
|
|
174
|
+
}, defaultAlpha = 1, radix = 10;
|
|
163
175
|
return result
|
|
164
176
|
? hsvaToRgba({
|
|
165
|
-
a: result.length >
|
|
166
|
-
h: parseInt(result[
|
|
167
|
-
s: parseInt(result[
|
|
168
|
-
v: parseInt(result[
|
|
177
|
+
a: result.length > fullLength ? (0, engine_1.parseAlpha)(result[indexes.a]) : defaultAlpha,
|
|
178
|
+
h: parseInt(result[indexes.h], radix),
|
|
179
|
+
s: parseInt(result[indexes.s], radix),
|
|
180
|
+
v: parseInt(result[indexes.v], radix),
|
|
169
181
|
})
|
|
170
182
|
: undefined;
|
|
171
183
|
}
|
package/cjs/index.js
CHANGED
|
@@ -1,9 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
26
|
exports.loadHsvColorPlugin = void 0;
|
|
4
|
-
const HsvColorManager_js_1 = require("./HsvColorManager.js");
|
|
5
27
|
const engine_1 = require("@tsparticles/engine");
|
|
6
28
|
async function loadHsvColorPlugin() {
|
|
7
|
-
|
|
29
|
+
const { HsvColorManager } = await Promise.resolve().then(() => __importStar(require("./HsvColorManager.js")));
|
|
30
|
+
(0, engine_1.addColorManager)(new HsvColorManager());
|
|
8
31
|
}
|
|
9
32
|
exports.loadHsvColorPlugin = loadHsvColorPlugin;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Author : Matteo Bruni
|
|
3
|
+
* MIT license: https://opensource.org/licenses/MIT
|
|
4
|
+
* Demo / Generator : https://particles.js.org/
|
|
5
|
+
* GitHub : https://www.github.com/matteobruni/tsparticles
|
|
6
|
+
* How to use? : Check the GitHub README
|
|
7
|
+
* v3.2.0
|
|
8
|
+
*/
|
|
9
|
+
"use strict";
|
|
10
|
+
/*
|
|
11
|
+
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
12
|
+
* This devtool is neither made for production nor for readable output files.
|
|
13
|
+
* It uses "eval()" calls to create a separate source file in the browser devtools.
|
|
14
|
+
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
|
|
15
|
+
* or disable the default devtool with "devtool: false".
|
|
16
|
+
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
|
|
17
|
+
*/
|
|
18
|
+
(this["webpackChunk_tsparticles_plugin_hsv_color"] = this["webpackChunk_tsparticles_plugin_hsv_color"] || []).push([["dist_browser_HsvColorManager_js"],{
|
|
19
|
+
|
|
20
|
+
/***/ "./dist/browser/HsvColorManager.js":
|
|
21
|
+
/*!*****************************************!*\
|
|
22
|
+
!*** ./dist/browser/HsvColorManager.js ***!
|
|
23
|
+
\*****************************************/
|
|
24
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
25
|
+
|
|
26
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ HsvColorManager: () => (/* binding */ HsvColorManager),\n/* harmony export */ getStyleFromHsv: () => (/* binding */ getStyleFromHsv),\n/* harmony export */ hslToHsv: () => (/* binding */ hslToHsv),\n/* harmony export */ hslaToHsva: () => (/* binding */ hslaToHsva),\n/* harmony export */ hsvToHsl: () => (/* binding */ hsvToHsl),\n/* harmony export */ hsvToRgb: () => (/* binding */ hsvToRgb),\n/* harmony export */ hsvaToHsla: () => (/* binding */ hsvaToHsla),\n/* harmony export */ hsvaToRgba: () => (/* binding */ hsvaToRgba),\n/* harmony export */ rgbToHsv: () => (/* binding */ rgbToHsv),\n/* harmony export */ rgbaToHsva: () => (/* binding */ rgbaToHsva)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n\nconst rgbFactor = 255,\n double = 2,\n half = 0.5;\nfunction rgbToHsv(rgb) {\n const rgbPercent = {\n r: rgb.r / rgbFactor,\n g: rgb.g / rgbFactor,\n b: rgb.b / rgbFactor\n },\n xMax = Math.max(rgbPercent.r, rgbPercent.g, rgbPercent.b),\n xMin = Math.min(rgbPercent.r, rgbPercent.g, rgbPercent.b),\n v = xMax,\n c = xMax - xMin;\n let h = 0;\n const phaseOffset = {\n r: 0,\n g: 2,\n b: 4\n },\n phaseValue = 60;\n if (v === rgbPercent.r) {\n h = phaseValue * (phaseOffset.r + (rgbPercent.g - rgbPercent.b) / c);\n } else if (v === rgbPercent.g) {\n h = phaseValue * (phaseOffset.g + (rgbPercent.b - rgbPercent.r) / c);\n } else if (v === rgbPercent.b) {\n h = phaseValue * (phaseOffset.b + (rgbPercent.r - rgbPercent.g) / c);\n }\n const defaultSaturation = 0,\n s = !v ? defaultSaturation : c / v;\n return {\n h,\n s: s * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.percentDenominator,\n v: v * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.percentDenominator\n };\n}\nfunction rgbaToHsva(rgba) {\n return {\n a: rgba.a,\n ...rgbToHsv(rgba)\n };\n}\nfunction getStyleFromHsv(color, opacity) {\n return (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getStyleFromHsl)(hsvToHsl(color), opacity);\n}\nfunction hslToHsv(hsl) {\n const l = hsl.l / _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.percentDenominator,\n sl = hsl.s / _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.percentDenominator,\n offset = 1,\n noValue = 0,\n v = l + sl * Math.min(l, offset - l),\n sv = !v ? noValue : double * (offset - l / v);\n return {\n h: hsl.h,\n s: sv * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.percentDenominator,\n v: v * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.percentDenominator\n };\n}\nfunction hslaToHsva(hsla) {\n return {\n a: hsla.a,\n ...hslToHsv(hsla)\n };\n}\nfunction hsvToHsl(hsv) {\n const v = hsv.v / _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.percentDenominator,\n sv = hsv.s / _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.percentDenominator,\n offset = 1,\n noValue = 0,\n l = v * (offset - sv * half),\n sl = !l || l === offset ? noValue : (v - l) / Math.min(l, offset - l);\n return {\n h: hsv.h,\n l: l * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.percentDenominator,\n s: sl * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.percentDenominator\n };\n}\nfunction hsvaToHsla(hsva) {\n return {\n a: hsva.a,\n ...hsvToHsl(hsva)\n };\n}\nfunction hsvToRgb(hsv) {\n const result = {\n b: 0,\n g: 0,\n r: 0\n },\n phase = 60,\n hsvPercent = {\n h: hsv.h / phase,\n s: hsv.s / _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.percentDenominator,\n v: hsv.v / _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.percentDenominator\n },\n offset = 1,\n hPercentFactor = 2,\n c = hsvPercent.v * hsvPercent.s,\n x = c * (offset - Math.abs(hsvPercent.h % hPercentFactor - offset));\n let tempRgb;\n const cxzRange = {\n min: 0,\n max: 1\n },\n xczRange = {\n min: 1,\n max: 2\n },\n zcxRange = {\n min: 2,\n max: 3\n },\n zxcRange = {\n min: 3,\n max: 4\n },\n xzcRange = {\n min: 4,\n max: 5\n },\n czxRange = {\n min: 5,\n max: 6\n };\n if (hsvPercent.h >= cxzRange.min && hsvPercent.h <= cxzRange.max) {\n tempRgb = {\n r: c,\n g: x,\n b: 0\n };\n } else if (hsvPercent.h > xczRange.min && hsvPercent.h <= xczRange.max) {\n tempRgb = {\n r: x,\n g: c,\n b: 0\n };\n } else if (hsvPercent.h > zcxRange.min && hsvPercent.h <= zcxRange.max) {\n tempRgb = {\n r: 0,\n g: c,\n b: x\n };\n } else if (hsvPercent.h > zxcRange.min && hsvPercent.h <= zxcRange.max) {\n tempRgb = {\n r: 0,\n g: x,\n b: c\n };\n } else if (hsvPercent.h > xzcRange.min && hsvPercent.h <= xzcRange.max) {\n tempRgb = {\n r: x,\n g: 0,\n b: c\n };\n } else if (hsvPercent.h > czxRange.min && hsvPercent.h <= czxRange.max) {\n tempRgb = {\n r: c,\n g: 0,\n b: x\n };\n }\n if (tempRgb) {\n const m = hsvPercent.v - c;\n result.r = Math.floor((tempRgb.r + m) * rgbFactor);\n result.g = Math.floor((tempRgb.g + m) * rgbFactor);\n result.b = Math.floor((tempRgb.b + m) * rgbFactor);\n }\n return result;\n}\nfunction hsvaToRgba(hsva) {\n return {\n a: hsva.a,\n ...hsvToRgb(hsva)\n };\n}\nclass HsvColorManager {\n constructor() {\n this.key = \"hsv\";\n this.stringPrefix = \"hsv\";\n }\n handleColor(color) {\n const colorValue = color.value,\n hsvColor = colorValue.hsv ?? color.value;\n if (hsvColor.h !== undefined && hsvColor.v !== undefined) {\n return hsvToRgb(hsvColor);\n }\n }\n handleRangeColor(color) {\n const colorValue = color.value,\n hsvColor = colorValue.hsv ?? color.value;\n if (hsvColor.h !== undefined && hsvColor.v !== undefined) {\n return hsvToRgb({\n h: (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(hsvColor.h),\n s: (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(hsvColor.s),\n v: (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(hsvColor.v)\n });\n }\n }\n parseString(input) {\n if (!input.startsWith(\"hsv\")) {\n return;\n }\n const regex = /hsva?\\(\\s*(\\d+)°\\s*,\\s*(\\d+)%\\s*,\\s*(\\d+)%\\s*(,\\s*([\\d.%]+)\\s*)?\\)/i,\n result = regex.exec(input),\n fullLength = 4,\n indexes = {\n h: 1,\n s: 2,\n v: 3,\n a: 5\n },\n defaultAlpha = 1,\n radix = 10;\n return result ? hsvaToRgba({\n a: result.length > fullLength ? (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.parseAlpha)(result[indexes.a]) : defaultAlpha,\n h: parseInt(result[indexes.h], radix),\n s: parseInt(result[indexes.s], radix),\n v: parseInt(result[indexes.v], radix)\n }) : undefined;\n }\n}\n\n//# sourceURL=webpack://@tsparticles/plugin-hsv-color/./dist/browser/HsvColorManager.js?");
|
|
27
|
+
|
|
28
|
+
/***/ })
|
|
29
|
+
|
|
30
|
+
}]);
|
package/esm/HsvColorManager.js
CHANGED
|
@@ -1,25 +1,31 @@
|
|
|
1
|
-
import { getRangeValue, getStyleFromHsl, parseAlpha, } from "@tsparticles/engine";
|
|
1
|
+
import { getRangeValue, getStyleFromHsl, parseAlpha, percentDenominator, } from "@tsparticles/engine";
|
|
2
|
+
const rgbFactor = 255, double = 2, half = 0.5;
|
|
2
3
|
export function rgbToHsv(rgb) {
|
|
3
4
|
const rgbPercent = {
|
|
4
|
-
r: rgb.r /
|
|
5
|
-
g: rgb.g /
|
|
6
|
-
b: rgb.b /
|
|
5
|
+
r: rgb.r / rgbFactor,
|
|
6
|
+
g: rgb.g / rgbFactor,
|
|
7
|
+
b: rgb.b / rgbFactor,
|
|
7
8
|
}, xMax = Math.max(rgbPercent.r, rgbPercent.g, rgbPercent.b), xMin = Math.min(rgbPercent.r, rgbPercent.g, rgbPercent.b), v = xMax, c = xMax - xMin;
|
|
8
9
|
let h = 0;
|
|
10
|
+
const phaseOffset = {
|
|
11
|
+
r: 0,
|
|
12
|
+
g: 2,
|
|
13
|
+
b: 4,
|
|
14
|
+
}, phaseValue = 60;
|
|
9
15
|
if (v === rgbPercent.r) {
|
|
10
|
-
h =
|
|
16
|
+
h = phaseValue * (phaseOffset.r + (rgbPercent.g - rgbPercent.b) / c);
|
|
11
17
|
}
|
|
12
18
|
else if (v === rgbPercent.g) {
|
|
13
|
-
h =
|
|
19
|
+
h = phaseValue * (phaseOffset.g + (rgbPercent.b - rgbPercent.r) / c);
|
|
14
20
|
}
|
|
15
21
|
else if (v === rgbPercent.b) {
|
|
16
|
-
h =
|
|
22
|
+
h = phaseValue * (phaseOffset.b + (rgbPercent.r - rgbPercent.g) / c);
|
|
17
23
|
}
|
|
18
|
-
const s = !v ?
|
|
24
|
+
const defaultSaturation = 0, s = !v ? defaultSaturation : c / v;
|
|
19
25
|
return {
|
|
20
26
|
h,
|
|
21
|
-
s: s *
|
|
22
|
-
v: v *
|
|
27
|
+
s: s * percentDenominator,
|
|
28
|
+
v: v * percentDenominator,
|
|
23
29
|
};
|
|
24
30
|
}
|
|
25
31
|
export function rgbaToHsva(rgba) {
|
|
@@ -32,11 +38,11 @@ export function getStyleFromHsv(color, opacity) {
|
|
|
32
38
|
return getStyleFromHsl(hsvToHsl(color), opacity);
|
|
33
39
|
}
|
|
34
40
|
export function hslToHsv(hsl) {
|
|
35
|
-
const l = hsl.l /
|
|
41
|
+
const l = hsl.l / percentDenominator, sl = hsl.s / percentDenominator, offset = 1, noValue = 0, v = l + sl * Math.min(l, offset - l), sv = !v ? noValue : double * (offset - l / v);
|
|
36
42
|
return {
|
|
37
43
|
h: hsl.h,
|
|
38
|
-
s: sv *
|
|
39
|
-
v: v *
|
|
44
|
+
s: sv * percentDenominator,
|
|
45
|
+
v: v * percentDenominator,
|
|
40
46
|
};
|
|
41
47
|
}
|
|
42
48
|
export function hslaToHsva(hsla) {
|
|
@@ -46,11 +52,11 @@ export function hslaToHsva(hsla) {
|
|
|
46
52
|
};
|
|
47
53
|
}
|
|
48
54
|
export function hsvToHsl(hsv) {
|
|
49
|
-
const v = hsv.v /
|
|
55
|
+
const v = hsv.v / percentDenominator, sv = hsv.s / percentDenominator, offset = 1, noValue = 0, l = v * (offset - sv * half), sl = !l || l === offset ? noValue : (v - l) / Math.min(l, offset - l);
|
|
50
56
|
return {
|
|
51
57
|
h: hsv.h,
|
|
52
|
-
l: l *
|
|
53
|
-
s: sl *
|
|
58
|
+
l: l * percentDenominator,
|
|
59
|
+
s: sl * percentDenominator,
|
|
54
60
|
};
|
|
55
61
|
}
|
|
56
62
|
export function hsvaToHsla(hsva) {
|
|
@@ -60,48 +66,49 @@ export function hsvaToHsla(hsva) {
|
|
|
60
66
|
};
|
|
61
67
|
}
|
|
62
68
|
export function hsvToRgb(hsv) {
|
|
63
|
-
const result = { b: 0, g: 0, r: 0 }, hsvPercent = {
|
|
64
|
-
h: hsv.h /
|
|
65
|
-
s: hsv.s /
|
|
66
|
-
v: hsv.v /
|
|
67
|
-
}, c = hsvPercent.v * hsvPercent.s, x = c * (
|
|
69
|
+
const result = { b: 0, g: 0, r: 0 }, phase = 60, hsvPercent = {
|
|
70
|
+
h: hsv.h / phase,
|
|
71
|
+
s: hsv.s / percentDenominator,
|
|
72
|
+
v: hsv.v / percentDenominator,
|
|
73
|
+
}, offset = 1, hPercentFactor = 2, c = hsvPercent.v * hsvPercent.s, x = c * (offset - Math.abs((hsvPercent.h % hPercentFactor) - offset));
|
|
68
74
|
let tempRgb;
|
|
69
|
-
|
|
75
|
+
const cxzRange = { min: 0, max: 1 }, xczRange = { min: 1, max: 2 }, zcxRange = { min: 2, max: 3 }, zxcRange = { min: 3, max: 4 }, xzcRange = { min: 4, max: 5 }, czxRange = { min: 5, max: 6 };
|
|
76
|
+
if (hsvPercent.h >= cxzRange.min && hsvPercent.h <= cxzRange.max) {
|
|
70
77
|
tempRgb = {
|
|
71
78
|
r: c,
|
|
72
79
|
g: x,
|
|
73
80
|
b: 0,
|
|
74
81
|
};
|
|
75
82
|
}
|
|
76
|
-
else if (hsvPercent.h >
|
|
83
|
+
else if (hsvPercent.h > xczRange.min && hsvPercent.h <= xczRange.max) {
|
|
77
84
|
tempRgb = {
|
|
78
85
|
r: x,
|
|
79
86
|
g: c,
|
|
80
87
|
b: 0,
|
|
81
88
|
};
|
|
82
89
|
}
|
|
83
|
-
else if (hsvPercent.h >
|
|
90
|
+
else if (hsvPercent.h > zcxRange.min && hsvPercent.h <= zcxRange.max) {
|
|
84
91
|
tempRgb = {
|
|
85
92
|
r: 0,
|
|
86
93
|
g: c,
|
|
87
94
|
b: x,
|
|
88
95
|
};
|
|
89
96
|
}
|
|
90
|
-
else if (hsvPercent.h >
|
|
97
|
+
else if (hsvPercent.h > zxcRange.min && hsvPercent.h <= zxcRange.max) {
|
|
91
98
|
tempRgb = {
|
|
92
99
|
r: 0,
|
|
93
100
|
g: x,
|
|
94
101
|
b: c,
|
|
95
102
|
};
|
|
96
103
|
}
|
|
97
|
-
else if (hsvPercent.h >
|
|
104
|
+
else if (hsvPercent.h > xzcRange.min && hsvPercent.h <= xzcRange.max) {
|
|
98
105
|
tempRgb = {
|
|
99
106
|
r: x,
|
|
100
107
|
g: 0,
|
|
101
108
|
b: c,
|
|
102
109
|
};
|
|
103
110
|
}
|
|
104
|
-
else if (hsvPercent.h >
|
|
111
|
+
else if (hsvPercent.h > czxRange.min && hsvPercent.h <= czxRange.max) {
|
|
105
112
|
tempRgb = {
|
|
106
113
|
r: c,
|
|
107
114
|
g: 0,
|
|
@@ -110,9 +117,9 @@ export function hsvToRgb(hsv) {
|
|
|
110
117
|
}
|
|
111
118
|
if (tempRgb) {
|
|
112
119
|
const m = hsvPercent.v - c;
|
|
113
|
-
result.r = Math.floor((tempRgb.r + m) *
|
|
114
|
-
result.g = Math.floor((tempRgb.g + m) *
|
|
115
|
-
result.b = Math.floor((tempRgb.b + m) *
|
|
120
|
+
result.r = Math.floor((tempRgb.r + m) * rgbFactor);
|
|
121
|
+
result.g = Math.floor((tempRgb.g + m) * rgbFactor);
|
|
122
|
+
result.b = Math.floor((tempRgb.b + m) * rgbFactor);
|
|
116
123
|
}
|
|
117
124
|
return result;
|
|
118
125
|
}
|
|
@@ -147,13 +154,18 @@ export class HsvColorManager {
|
|
|
147
154
|
if (!input.startsWith("hsv")) {
|
|
148
155
|
return;
|
|
149
156
|
}
|
|
150
|
-
const regex = /hsva?\(\s*(\d+)°\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(,\s*([\d.%]+)\s*)?\)/i, result = regex.exec(input)
|
|
157
|
+
const regex = /hsva?\(\s*(\d+)°\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(,\s*([\d.%]+)\s*)?\)/i, result = regex.exec(input), fullLength = 4, indexes = {
|
|
158
|
+
h: 1,
|
|
159
|
+
s: 2,
|
|
160
|
+
v: 3,
|
|
161
|
+
a: 5,
|
|
162
|
+
}, defaultAlpha = 1, radix = 10;
|
|
151
163
|
return result
|
|
152
164
|
? hsvaToRgba({
|
|
153
|
-
a: result.length >
|
|
154
|
-
h: parseInt(result[
|
|
155
|
-
s: parseInt(result[
|
|
156
|
-
v: parseInt(result[
|
|
165
|
+
a: result.length > fullLength ? parseAlpha(result[indexes.a]) : defaultAlpha,
|
|
166
|
+
h: parseInt(result[indexes.h], radix),
|
|
167
|
+
s: parseInt(result[indexes.s], radix),
|
|
168
|
+
v: parseInt(result[indexes.v], radix),
|
|
157
169
|
})
|
|
158
170
|
: undefined;
|
|
159
171
|
}
|
package/esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { HsvColorManager } from "./HsvColorManager.js";
|
|
2
1
|
import { addColorManager } from "@tsparticles/engine";
|
|
3
2
|
export async function loadHsvColorPlugin() {
|
|
3
|
+
const { HsvColorManager } = await import("./HsvColorManager.js");
|
|
4
4
|
addColorManager(new HsvColorManager());
|
|
5
5
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/plugin-hsv-color",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"description": "tsParticles HSV color plugin",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"./package.json": "./package.json"
|
|
101
101
|
},
|
|
102
102
|
"dependencies": {
|
|
103
|
-
"@tsparticles/engine": "^3.0
|
|
103
|
+
"@tsparticles/engine": "^3.2.0"
|
|
104
104
|
},
|
|
105
105
|
"publishConfig": {
|
|
106
106
|
"access": "public"
|