@tsparticles/all 4.3.2 → 4.4.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/browser/index.js +1 -1
- package/browser/index.lazy.js +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.lazy.js +1 -1
- package/esm/index.js +1 -1
- package/esm/index.lazy.js +1 -1
- package/package.json +80 -80
- package/report.html +1 -1
- package/tsparticles.all.bundle.js +486 -270
- package/tsparticles.all.bundle.min.js +1 -1
- package/tsparticles.all.js +2 -2
- package/tsparticles.all.min.js +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
(function(g){g.__tsParticlesInternals=g.__tsParticlesInternals||{};g.__tsParticlesInternals.bundles=g.__tsParticlesInternals.bundles||{};g.__tsParticlesInternals.effects=g.__tsParticlesInternals.effects||{};g.__tsParticlesInternals.engine=g.__tsParticlesInternals.engine||{};g.__tsParticlesInternals.interactions=g.__tsParticlesInternals.interactions||{};g.__tsParticlesInternals.palettes=g.__tsParticlesInternals.palettes||{};g.__tsParticlesInternals.paths=g.__tsParticlesInternals.paths||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins.emittersShapes=g.__tsParticlesInternals.plugins.emittersShapes||{};g.__tsParticlesInternals.presets=g.__tsParticlesInternals.presets||{};g.__tsParticlesInternals.shapes=g.__tsParticlesInternals.shapes||{};g.__tsParticlesInternals.updaters=g.__tsParticlesInternals.updaters||{};g.__tsParticlesInternals.utils=g.__tsParticlesInternals.utils||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas.utils=g.__tsParticlesInternals.canvas.utils||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path.utils=g.__tsParticlesInternals.path.utils||{};var __tsProxyFactory=typeof Proxy!=="undefined"?function(obj){return new Proxy(obj,{get:function(target,key){if(!(key in target)){target[key]={};}return target[key];}});}:function(obj){return obj;};g.__tsParticlesInternals.bundles=__tsProxyFactory(g.__tsParticlesInternals.bundles);g.__tsParticlesInternals.effects=__tsProxyFactory(g.__tsParticlesInternals.effects);g.__tsParticlesInternals.interactions=__tsProxyFactory(g.__tsParticlesInternals.interactions);g.__tsParticlesInternals.palettes=__tsProxyFactory(g.__tsParticlesInternals.palettes);g.__tsParticlesInternals.paths=__tsProxyFactory(g.__tsParticlesInternals.paths);g.__tsParticlesInternals.plugins=__tsProxyFactory(g.__tsParticlesInternals.plugins);g.__tsParticlesInternals.plugins.emittersShapes=__tsProxyFactory(g.__tsParticlesInternals.plugins.emittersShapes);g.__tsParticlesInternals.presets=__tsProxyFactory(g.__tsParticlesInternals.presets);g.__tsParticlesInternals.shapes=__tsProxyFactory(g.__tsParticlesInternals.shapes);g.__tsParticlesInternals.updaters=__tsProxyFactory(g.__tsParticlesInternals.updaters);g.__tsParticlesInternals.utils=__tsProxyFactory(g.__tsParticlesInternals.utils);g.__tsParticlesInternals.canvas=__tsProxyFactory(g.__tsParticlesInternals.canvas);g.__tsParticlesInternals.path=__tsProxyFactory(g.__tsParticlesInternals.path);g.tsparticlesInternalExports=g.tsparticlesInternalExports||{};})(typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:this);
|
|
2
|
-
/* tsParticles v4.
|
|
2
|
+
/* tsParticles v4.4.0 */
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
5
5
|
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
|
@@ -880,7 +880,7 @@
|
|
|
880
880
|
return this.#domArray;
|
|
881
881
|
}
|
|
882
882
|
get version() {
|
|
883
|
-
return "4.
|
|
883
|
+
return "4.4.0";
|
|
884
884
|
}
|
|
885
885
|
addEventListener(type, listener) {
|
|
886
886
|
this.#eventDispatcher.addEventListener(type, listener);
|
|
@@ -961,6 +961,10 @@
|
|
|
961
961
|
}
|
|
962
962
|
|
|
963
963
|
function initEngine() {
|
|
964
|
+
const existing = globalThis.tsParticles;
|
|
965
|
+
if (existing?.pluginManager) {
|
|
966
|
+
return existing;
|
|
967
|
+
}
|
|
964
968
|
return new Engine();
|
|
965
969
|
}
|
|
966
970
|
|
|
@@ -1058,6 +1062,15 @@
|
|
|
1058
1062
|
AnimationMode["random"] = "random";
|
|
1059
1063
|
})(exports.AnimationMode || (exports.AnimationMode = {}));
|
|
1060
1064
|
|
|
1065
|
+
exports.HdrMode = void 0;
|
|
1066
|
+
(function (HdrMode) {
|
|
1067
|
+
HdrMode["standard"] = "standard";
|
|
1068
|
+
HdrMode["natural"] = "natural";
|
|
1069
|
+
HdrMode["vivid"] = "vivid";
|
|
1070
|
+
HdrMode["cinematic"] = "cinematic";
|
|
1071
|
+
HdrMode["dynamic"] = "dynamic";
|
|
1072
|
+
})(exports.HdrMode || (exports.HdrMode = {}));
|
|
1073
|
+
|
|
1061
1074
|
exports.LimitMode = void 0;
|
|
1062
1075
|
(function (LimitMode) {
|
|
1063
1076
|
LimitMode["delete"] = "delete";
|
|
@@ -1323,6 +1336,29 @@
|
|
|
1323
1336
|
}
|
|
1324
1337
|
}
|
|
1325
1338
|
|
|
1339
|
+
const defaultPeakNits = 400, minPeakNits = 0, toStringValue = (value) => String(value);
|
|
1340
|
+
class HDROptions extends OptionLoader {
|
|
1341
|
+
enable = true;
|
|
1342
|
+
mode = exports.HdrMode.standard;
|
|
1343
|
+
peakNits = defaultPeakNits;
|
|
1344
|
+
doLoad(data) {
|
|
1345
|
+
if (data.enable !== undefined && !isBoolean(data.enable)) {
|
|
1346
|
+
throw new Error(`Invalid HDR "enable" value: expected a boolean, got "${String(data.enable)}"`);
|
|
1347
|
+
}
|
|
1348
|
+
if (data.mode !== undefined &&
|
|
1349
|
+
(typeof data.mode !== "string" || !Object.values(exports.HdrMode).includes(data.mode))) {
|
|
1350
|
+
throw new Error(`Invalid HDR "mode" value: expected one of ${Object.values(exports.HdrMode).join(", ")}, got "${toStringValue(data.mode)}"`);
|
|
1351
|
+
}
|
|
1352
|
+
if (data.peakNits !== undefined &&
|
|
1353
|
+
(!isNumber(data.peakNits) || !Number.isFinite(data.peakNits) || data.peakNits <= minPeakNits)) {
|
|
1354
|
+
throw new Error(`Invalid HDR "peakNits" value: expected a positive number, got "${String(data.peakNits)}"`);
|
|
1355
|
+
}
|
|
1356
|
+
loadProperty(this, "enable", data.enable);
|
|
1357
|
+
loadProperty(this, "mode", data.mode);
|
|
1358
|
+
loadProperty(this, "peakNits", data.peakNits);
|
|
1359
|
+
}
|
|
1360
|
+
}
|
|
1361
|
+
|
|
1326
1362
|
class ResizeEvent extends OptionLoader {
|
|
1327
1363
|
delay = 0.5;
|
|
1328
1364
|
enable = true;
|
|
@@ -1766,7 +1802,7 @@
|
|
|
1766
1802
|
duration = 0;
|
|
1767
1803
|
fpsLimit = 120;
|
|
1768
1804
|
fullScreen;
|
|
1769
|
-
hdr
|
|
1805
|
+
hdr;
|
|
1770
1806
|
key;
|
|
1771
1807
|
name;
|
|
1772
1808
|
palette;
|
|
@@ -1786,6 +1822,7 @@
|
|
|
1786
1822
|
this.#container = container;
|
|
1787
1823
|
this.background = new Background();
|
|
1788
1824
|
this.fullScreen = new FullScreen();
|
|
1825
|
+
this.hdr = new HDROptions();
|
|
1789
1826
|
this.particles = loadParticlesOptions(this.#pluginManager, this.#container);
|
|
1790
1827
|
this.resize = new ResizeEvent();
|
|
1791
1828
|
}
|
|
@@ -1808,7 +1845,15 @@
|
|
|
1808
1845
|
loadProperty(this, "detectRetina", data.detectRetina);
|
|
1809
1846
|
loadRangeProperty(this, "duration", data.duration);
|
|
1810
1847
|
loadProperty(this, "fpsLimit", data.fpsLimit);
|
|
1811
|
-
|
|
1848
|
+
const hdrData = data.hdr;
|
|
1849
|
+
if (isBoolean(hdrData)) {
|
|
1850
|
+
this.hdr.enable = hdrData;
|
|
1851
|
+
this.hdr.mode = exports.HdrMode.standard;
|
|
1852
|
+
this.hdr.peakNits = 400;
|
|
1853
|
+
}
|
|
1854
|
+
else {
|
|
1855
|
+
this.hdr.load(hdrData);
|
|
1856
|
+
}
|
|
1812
1857
|
loadProperty(this, "pauseOnBlur", data.pauseOnBlur);
|
|
1813
1858
|
loadProperty(this, "pauseOnOutsideViewport", data.pauseOnOutsideViewport);
|
|
1814
1859
|
loadProperty(this, "zLayers", data.zLayers);
|
|
@@ -1851,7 +1896,7 @@
|
|
|
1851
1896
|
}
|
|
1852
1897
|
}
|
|
1853
1898
|
|
|
1854
|
-
const styleCache = new Map(), maxStyleCacheSize = 2000, rgbFixedPrecision = 2, hslFixedPrecision = 2, hdrRgbFixedPrecision = 4, hdrHslFixedPrecision = 4, sdrReferenceWhiteNits = 203,
|
|
1899
|
+
const styleCache = new Map(), maxStyleCacheSize = 2000, rgbFixedPrecision = 2, hslFixedPrecision = 2, hdrRgbFixedPrecision = 4, hdrHslFixedPrecision = 4, sdrReferenceWhiteNits = 203, acesA = 2.51, acesB = 0.03, acesC = 2.43, acesD = 0.59, acesE = 0.14, saturationBoost = 1.15, lightnessBoost = 1.05, temperatureR = 1.05, temperatureB = 0.95, contrastFactor = 1.1, luminanceR = 0.2126, luminanceG = 0.7152, luminanceB = 0.0722, dynamicLuminanceFactor = 2, channelCount = 3, srgbThreshold = 0.04045, srgbDivisor = 12.92, srgbOffset = 0.055, srgbScale = 1.055, srgbExponent = 2.4, linearThreshold = 0.0031308, linearScale = 12.92;
|
|
1855
1900
|
function getCachedStyle(key, generator) {
|
|
1856
1901
|
let cached = styleCache.get(key);
|
|
1857
1902
|
if (!cached) {
|
|
@@ -1863,6 +1908,48 @@
|
|
|
1863
1908
|
}
|
|
1864
1909
|
return cached;
|
|
1865
1910
|
}
|
|
1911
|
+
function acesFilmic(x) {
|
|
1912
|
+
return clamp((x * (acesA * x + acesB)) / (x * (acesC * x + acesD) + acesE), none, one);
|
|
1913
|
+
}
|
|
1914
|
+
function srgbToLinear(c) {
|
|
1915
|
+
return c <= srgbThreshold ? c / srgbDivisor : Math.pow((c + srgbOffset) / srgbScale, srgbExponent);
|
|
1916
|
+
}
|
|
1917
|
+
function linearToSrgb(c) {
|
|
1918
|
+
return c <= linearThreshold ? c * linearScale : srgbScale * Math.pow(c, one / srgbExponent) - srgbOffset;
|
|
1919
|
+
}
|
|
1920
|
+
function applyHdrModeAdjustments(r, g, b, mode, maxChannel) {
|
|
1921
|
+
switch (mode) {
|
|
1922
|
+
case exports.HdrMode.vivid: {
|
|
1923
|
+
const avg = (r + g + b) / channelCount;
|
|
1924
|
+
return {
|
|
1925
|
+
b: clamp(clamp(avg + (b - avg) * saturationBoost, none, maxChannel) * lightnessBoost, none, maxChannel),
|
|
1926
|
+
g: clamp(clamp(avg + (g - avg) * saturationBoost, none, maxChannel) * lightnessBoost, none, maxChannel),
|
|
1927
|
+
r: clamp(clamp(avg + (r - avg) * saturationBoost, none, maxChannel) * lightnessBoost, none, maxChannel),
|
|
1928
|
+
};
|
|
1929
|
+
}
|
|
1930
|
+
case exports.HdrMode.cinematic: {
|
|
1931
|
+
const tempR = r * temperatureR, tempB = b * temperatureB, avg = (tempR + g + tempB) / channelCount;
|
|
1932
|
+
return {
|
|
1933
|
+
b: clamp(avg + (tempB - avg) * contrastFactor, none, maxChannel),
|
|
1934
|
+
g: clamp(avg + (g - avg) * contrastFactor, none, maxChannel),
|
|
1935
|
+
r: clamp(avg + (tempR - avg) * contrastFactor, none, maxChannel),
|
|
1936
|
+
};
|
|
1937
|
+
}
|
|
1938
|
+
case exports.HdrMode.dynamic: {
|
|
1939
|
+
const luminance = luminanceR * r + luminanceG * g + luminanceB * b, vividWeight = Math.min(one, luminance * dynamicLuminanceFactor), naturalWeight = one - vividWeight, avg = (r + g + b) / channelCount, vividR = clamp(avg + (r - avg) * saturationBoost, none, maxChannel) * lightnessBoost, vividG = clamp(avg + (g - avg) * saturationBoost, none, maxChannel) * lightnessBoost, vividB = clamp(avg + (b - avg) * saturationBoost, none, maxChannel) * lightnessBoost;
|
|
1940
|
+
return {
|
|
1941
|
+
b: clamp(b * naturalWeight + vividB * vividWeight, none, maxChannel),
|
|
1942
|
+
g: clamp(g * naturalWeight + vividG * vividWeight, none, maxChannel),
|
|
1943
|
+
r: clamp(r * naturalWeight + vividR * vividWeight, none, maxChannel),
|
|
1944
|
+
};
|
|
1945
|
+
}
|
|
1946
|
+
case exports.HdrMode.standard:
|
|
1947
|
+
return { b, g, r };
|
|
1948
|
+
case exports.HdrMode.natural:
|
|
1949
|
+
default:
|
|
1950
|
+
return { b, g, r };
|
|
1951
|
+
}
|
|
1952
|
+
}
|
|
1866
1953
|
function stringToRgba(pluginManager, input) {
|
|
1867
1954
|
if (!input) {
|
|
1868
1955
|
return;
|
|
@@ -2030,30 +2117,65 @@
|
|
|
2030
2117
|
r: getRgbInRangeValue(),
|
|
2031
2118
|
};
|
|
2032
2119
|
}
|
|
2033
|
-
function getStyleFromRgb(color, hdr, opacity) {
|
|
2034
|
-
const rgbPrecision = hdr ? hdrRgbFixedPrecision : rgbFixedPrecision, op = opacity ?? defaultOpacity$3, key =
|
|
2035
|
-
|
|
2120
|
+
function getStyleFromRgb(color, hdr, opacity, peakNits, mode) {
|
|
2121
|
+
const rgbPrecision = hdr ? hdrRgbFixedPrecision : rgbFixedPrecision, op = opacity ?? defaultOpacity$3, key = hdr
|
|
2122
|
+
? `rgb-${color.r.toFixed(rgbPrecision)}-${color.g.toFixed(rgbPrecision)}-${color.b.toFixed(rgbPrecision)}-hdr-${op.toString()}-${(peakNits ?? maxNits).toString()}-${mode ?? exports.HdrMode.standard}`
|
|
2123
|
+
: `rgb-${color.r.toFixed(rgbPrecision)}-${color.g.toFixed(rgbPrecision)}-${color.b.toFixed(rgbPrecision)}-sdr-${op.toString()}`;
|
|
2124
|
+
return getCachedStyle(key, () => hdr ? getHdrStyleFromRgb(color, opacity, peakNits, mode) : getSdrStyleFromRgb(color, opacity));
|
|
2125
|
+
}
|
|
2126
|
+
function getHdrStyleFromRgb(color, opacity, peakNits = maxNits, mode = exports.HdrMode.standard) {
|
|
2127
|
+
const headroom = peakNits / sdrReferenceWhiteNits, middleGray = 0.18, mapped = hdrToneMapColor(color, headroom, middleGray, mode);
|
|
2128
|
+
return `color(display-p3 ${mapped.r.toString()} ${mapped.g.toString()} ${mapped.b.toString()} / ${(opacity ?? defaultOpacity$3).toString()})`;
|
|
2129
|
+
}
|
|
2130
|
+
function hdrToneMapColor(color, headroom, middleGray, mode) {
|
|
2131
|
+
const rNorm = color.r / rgbMax, gNorm = color.g / rgbMax, bNorm = color.b / rgbMax;
|
|
2132
|
+
if (mode !== exports.HdrMode.natural && mode !== exports.HdrMode.vivid && mode !== exports.HdrMode.cinematic && mode !== exports.HdrMode.dynamic) {
|
|
2133
|
+
return { b: bNorm, g: gNorm, r: rNorm };
|
|
2134
|
+
}
|
|
2135
|
+
const maxChannel = Math.max(one, headroom), luminance = luminanceR * rNorm + luminanceG * gNorm + luminanceB * bNorm, mappedLuminance = hdrToneMap(luminance, headroom, middleGray), scale = luminance > none ? mappedLuminance / luminance : one;
|
|
2136
|
+
return applyHdrModeAdjustments(clamp(rNorm * scale, none, maxChannel), clamp(gNorm * scale, none, maxChannel), clamp(bNorm * scale, none, maxChannel), mode, maxChannel);
|
|
2036
2137
|
}
|
|
2037
|
-
function
|
|
2038
|
-
|
|
2039
|
-
|
|
2138
|
+
function hdrToneMap(normalized, headroom, middleGray) {
|
|
2139
|
+
if (normalized <= middleGray) {
|
|
2140
|
+
return acesFilmic(normalized);
|
|
2141
|
+
}
|
|
2142
|
+
const expanded = normalized + (normalized - middleGray) * (headroom - one);
|
|
2143
|
+
return acesFilmic(expanded);
|
|
2040
2144
|
}
|
|
2041
2145
|
function getSdrStyleFromRgb(color, opacity) {
|
|
2042
2146
|
return `rgba(${color.r.toString()}, ${color.g.toString()}, ${color.b.toString()}, ${(opacity ?? defaultOpacity$3).toString()})`;
|
|
2043
2147
|
}
|
|
2044
|
-
function getStyleFromHsl(color, hdr, opacity) {
|
|
2045
|
-
const hslPrecision = hdr ? hdrHslFixedPrecision : hslFixedPrecision, op = opacity ?? defaultOpacity$3, key =
|
|
2148
|
+
function getStyleFromHsl(color, hdr, opacity, peakNits, mode) {
|
|
2149
|
+
const hslPrecision = hdr ? hdrHslFixedPrecision : hslFixedPrecision, op = opacity ?? defaultOpacity$3, key = hdr
|
|
2150
|
+
? `hsl-${color.h.toFixed(hslPrecision)}-${color.s.toFixed(hslPrecision)}-${color.l.toFixed(hslPrecision)}-hdr-${op.toString()}-${(peakNits ?? maxNits).toString()}-${mode ?? exports.HdrMode.standard}`
|
|
2151
|
+
: `hsl-${color.h.toFixed(hslPrecision)}-${color.s.toFixed(hslPrecision)}-${color.l.toFixed(hslPrecision)}-sdr-${op.toString()}`;
|
|
2046
2152
|
return getCachedStyle(key, () => hdr
|
|
2047
|
-
? getStyleFromRgb(hslToRgbFloat(color), true, opacity)
|
|
2153
|
+
? getStyleFromRgb(hslToRgbFloat(color), true, opacity, peakNits, mode)
|
|
2048
2154
|
: `hsla(${color.h.toString()}, ${color.s.toString()}%, ${color.l.toString()}%, ${op.toString()})`);
|
|
2049
2155
|
}
|
|
2050
|
-
function colorMix(color1, color2, size1, size2) {
|
|
2156
|
+
function colorMix(color1, color2, size1, size2, hdr) {
|
|
2051
2157
|
let rgb1 = color1, rgb2 = color2;
|
|
2052
2158
|
if (!("r" in rgb1)) {
|
|
2053
|
-
rgb1 = hslToRgb(color1);
|
|
2159
|
+
rgb1 = hdr ? hslToRgbFloat(color1) : hslToRgb(color1);
|
|
2054
2160
|
}
|
|
2055
2161
|
if (!("r" in rgb2)) {
|
|
2056
|
-
rgb2 = hslToRgb(color2);
|
|
2162
|
+
rgb2 = hdr ? hslToRgbFloat(color2) : hslToRgb(color2);
|
|
2163
|
+
}
|
|
2164
|
+
if (hdr) {
|
|
2165
|
+
const lin1 = {
|
|
2166
|
+
b: srgbToLinear(rgb1.b / rgbMax),
|
|
2167
|
+
g: srgbToLinear(rgb1.g / rgbMax),
|
|
2168
|
+
r: srgbToLinear(rgb1.r / rgbMax),
|
|
2169
|
+
}, lin2 = {
|
|
2170
|
+
b: srgbToLinear(rgb2.b / rgbMax),
|
|
2171
|
+
g: srgbToLinear(rgb2.g / rgbMax),
|
|
2172
|
+
r: srgbToLinear(rgb2.r / rgbMax),
|
|
2173
|
+
}, totalWeight = size1 + size2;
|
|
2174
|
+
return {
|
|
2175
|
+
b: linearToSrgb((lin1.b * size1 + lin2.b * size2) / totalWeight) * rgbMax,
|
|
2176
|
+
g: linearToSrgb((lin1.g * size1 + lin2.g * size2) / totalWeight) * rgbMax,
|
|
2177
|
+
r: linearToSrgb((lin1.r * size1 + lin2.r * size2) / totalWeight) * rgbMax,
|
|
2178
|
+
};
|
|
2057
2179
|
}
|
|
2058
2180
|
return {
|
|
2059
2181
|
b: mix(rgb1.b, rgb2.b, size1, size2),
|
|
@@ -2061,14 +2183,14 @@
|
|
|
2061
2183
|
r: mix(rgb1.r, rgb2.r, size1, size2),
|
|
2062
2184
|
};
|
|
2063
2185
|
}
|
|
2064
|
-
function getLinkColor(p1, p2, linkColor) {
|
|
2186
|
+
function getLinkColor(p1, p2, linkColor, hdr) {
|
|
2065
2187
|
if (linkColor === randomColorValue) {
|
|
2066
2188
|
return getRandomRgbColor();
|
|
2067
2189
|
}
|
|
2068
2190
|
else if (linkColor === midColorValue) {
|
|
2069
2191
|
const sourceColor = p1.getFillColor() ?? p1.getStrokeColor(), destColor = p2?.getFillColor() ?? p2?.getStrokeColor();
|
|
2070
2192
|
if (sourceColor && destColor && p2) {
|
|
2071
|
-
return colorMix(sourceColor, destColor, p1.getRadius(), p2.getRadius());
|
|
2193
|
+
return colorMix(sourceColor, destColor, p1.getRadius(), p2.getRadius(), hdr);
|
|
2072
2194
|
}
|
|
2073
2195
|
else {
|
|
2074
2196
|
const hslColor = sourceColor ?? destColor;
|
|
@@ -2164,7 +2286,7 @@
|
|
|
2164
2286
|
colorValue.velocity = defaultVelocity;
|
|
2165
2287
|
}
|
|
2166
2288
|
}
|
|
2167
|
-
function updateColorValue(data, decrease, delta,
|
|
2289
|
+
function updateColorValue(data, decrease, delta, _hdr) {
|
|
2168
2290
|
const minLoops = 0, minDelay = 0, identity = 1, minVelocity = 0, minOffset = 0, velocityFactor = 3.6;
|
|
2169
2291
|
if (!data.enable ||
|
|
2170
2292
|
((data.maxLoops ?? minLoops) > minLoops && (data.loops ?? minLoops) > (data.maxLoops ?? minLoops))) {
|
|
@@ -2177,7 +2299,7 @@
|
|
|
2177
2299
|
if ((data.delayTime ?? minDelay) > minDelay && data.time < (data.delayTime ?? minDelay)) {
|
|
2178
2300
|
return;
|
|
2179
2301
|
}
|
|
2180
|
-
const offset = data.offset ? randomInRangeValue(data.offset) : minOffset, velocity = (
|
|
2302
|
+
const offset = data.offset ? randomInRangeValue(data.offset) : minOffset, velocity = (data.velocity ?? minVelocity) * delta.factor + offset * velocityFactor, decay = data.decay ?? identity, max = data.max, min = data.min;
|
|
2181
2303
|
if (!decrease || data.status === exports.AnimationStatus.increasing) {
|
|
2182
2304
|
data.value += velocity;
|
|
2183
2305
|
if (data.value > max) {
|
|
@@ -2209,9 +2331,9 @@
|
|
|
2209
2331
|
return;
|
|
2210
2332
|
}
|
|
2211
2333
|
const { h, s, l } = color;
|
|
2212
|
-
updateColorValue(h, false, delta
|
|
2213
|
-
updateColorValue(s, true, delta
|
|
2214
|
-
updateColorValue(l, true, delta
|
|
2334
|
+
updateColorValue(h, false, delta);
|
|
2335
|
+
updateColorValue(s, true, delta);
|
|
2336
|
+
updateColorValue(l, true, delta);
|
|
2215
2337
|
}
|
|
2216
2338
|
function alterHsl(color, type, value) {
|
|
2217
2339
|
return {
|
|
@@ -2251,7 +2373,7 @@
|
|
|
2251
2373
|
}
|
|
2252
2374
|
|
|
2253
2375
|
async function loadArrowShape(engine) {
|
|
2254
|
-
engine.checkVersion("4.
|
|
2376
|
+
engine.checkVersion("4.4.0");
|
|
2255
2377
|
await engine.pluginManager.register(e => {
|
|
2256
2378
|
e.pluginManager.addShape(["arrow"], () => Promise.resolve(new ArrowDrawer()));
|
|
2257
2379
|
});
|
|
@@ -2325,7 +2447,7 @@
|
|
|
2325
2447
|
}
|
|
2326
2448
|
|
|
2327
2449
|
async function loadBackgroundMaskPlugin(engine) {
|
|
2328
|
-
engine.checkVersion("4.
|
|
2450
|
+
engine.checkVersion("4.4.0");
|
|
2329
2451
|
await engine.pluginManager.register(e => {
|
|
2330
2452
|
e.pluginManager.addPlugin(new BackgroundMaskPlugin(e.pluginManager));
|
|
2331
2453
|
});
|
|
@@ -2349,7 +2471,7 @@
|
|
|
2349
2471
|
}
|
|
2350
2472
|
|
|
2351
2473
|
async function loadMovePlugin(engine) {
|
|
2352
|
-
engine.checkVersion("4.
|
|
2474
|
+
engine.checkVersion("4.4.0");
|
|
2353
2475
|
await engine.pluginManager.register(e => {
|
|
2354
2476
|
const moveEngine = e, movePluginManager = moveEngine.pluginManager;
|
|
2355
2477
|
movePluginManager.initializers.pathGenerators ??= new Map();
|
|
@@ -2450,7 +2572,7 @@
|
|
|
2450
2572
|
|
|
2451
2573
|
const branchingPathName = "branchesPathGenerator";
|
|
2452
2574
|
async function loadBranchesPath(engine) {
|
|
2453
|
-
engine.checkVersion("4.
|
|
2575
|
+
engine.checkVersion("4.4.0");
|
|
2454
2576
|
await engine.pluginManager.register((e) => {
|
|
2455
2577
|
ensureBaseMoverLoaded(e);
|
|
2456
2578
|
e.pluginManager.addPathGenerator?.(branchingPathName, container => {
|
|
@@ -2499,7 +2621,7 @@
|
|
|
2499
2621
|
|
|
2500
2622
|
const brownianPathName = "brownianPathGenerator";
|
|
2501
2623
|
async function loadBrownianPath(engine) {
|
|
2502
|
-
engine.checkVersion("4.
|
|
2624
|
+
engine.checkVersion("4.4.0");
|
|
2503
2625
|
await engine.pluginManager.register((e) => {
|
|
2504
2626
|
ensureBaseMoverLoaded(e);
|
|
2505
2627
|
e.pluginManager.addPathGenerator?.(brownianPathName, container => {
|
|
@@ -2521,7 +2643,7 @@
|
|
|
2521
2643
|
}
|
|
2522
2644
|
|
|
2523
2645
|
async function loadBubbleEffect(engine) {
|
|
2524
|
-
engine.checkVersion("4.
|
|
2646
|
+
engine.checkVersion("4.4.0");
|
|
2525
2647
|
await engine.pluginManager.register(e => {
|
|
2526
2648
|
e.pluginManager.addEffect("bubble", () => {
|
|
2527
2649
|
return Promise.resolve(new BubbleDrawer());
|
|
@@ -2691,7 +2813,7 @@
|
|
|
2691
2813
|
}
|
|
2692
2814
|
|
|
2693
2815
|
async function loadCanvasMaskPlugin(engine) {
|
|
2694
|
-
engine.checkVersion("4.
|
|
2816
|
+
engine.checkVersion("4.4.0");
|
|
2695
2817
|
await engine.pluginManager.register(e => {
|
|
2696
2818
|
e.pluginManager.addPlugin(new CanvasMaskPlugin());
|
|
2697
2819
|
});
|
|
@@ -2980,7 +3102,7 @@
|
|
|
2980
3102
|
}
|
|
2981
3103
|
|
|
2982
3104
|
async function loadClubsSuitShape(engine) {
|
|
2983
|
-
engine.checkVersion("4.
|
|
3105
|
+
engine.checkVersion("4.4.0");
|
|
2984
3106
|
await engine.pluginManager.register(e => {
|
|
2985
3107
|
e.pluginManager.addShape(["club", "clubs"], () => Promise.resolve(new ClubDrawer()));
|
|
2986
3108
|
});
|
|
@@ -2994,7 +3116,7 @@
|
|
|
2994
3116
|
}
|
|
2995
3117
|
|
|
2996
3118
|
async function loadDiamondsSuitShape(engine) {
|
|
2997
|
-
engine.checkVersion("4.
|
|
3119
|
+
engine.checkVersion("4.4.0");
|
|
2998
3120
|
await engine.pluginManager.register(e => {
|
|
2999
3121
|
e.pluginManager.addShape(["diamond", "diamonds"], () => Promise.resolve(new DiamondDrawer()));
|
|
3000
3122
|
});
|
|
@@ -3008,7 +3130,7 @@
|
|
|
3008
3130
|
};
|
|
3009
3131
|
|
|
3010
3132
|
async function loadHeartsSuitShape(engine) {
|
|
3011
|
-
engine.checkVersion("4.
|
|
3133
|
+
engine.checkVersion("4.4.0");
|
|
3012
3134
|
await engine.pluginManager.register(e => {
|
|
3013
3135
|
e.pluginManager.addShape(["heart", "hearts"], () => Promise.resolve(new HeartDrawer$1()));
|
|
3014
3136
|
});
|
|
@@ -3022,14 +3144,14 @@
|
|
|
3022
3144
|
}
|
|
3023
3145
|
|
|
3024
3146
|
async function loadSpadesSuitShape(engine) {
|
|
3025
|
-
engine.checkVersion("4.
|
|
3147
|
+
engine.checkVersion("4.4.0");
|
|
3026
3148
|
await engine.pluginManager.register(e => {
|
|
3027
3149
|
e.pluginManager.addShape(["spade", "spades"], () => Promise.resolve(new SpadeDrawer()));
|
|
3028
3150
|
});
|
|
3029
3151
|
}
|
|
3030
3152
|
|
|
3031
3153
|
async function loadCardSuitsShape(engine) {
|
|
3032
|
-
engine.checkVersion("4.
|
|
3154
|
+
engine.checkVersion("4.4.0");
|
|
3033
3155
|
await Promise.all([
|
|
3034
3156
|
loadClubsSuitShape(engine),
|
|
3035
3157
|
loadDiamondsSuitShape(engine),
|
|
@@ -3039,18 +3161,18 @@
|
|
|
3039
3161
|
}
|
|
3040
3162
|
|
|
3041
3163
|
const cardWidthRatio = (double * double) / triple, cardHeightRatio = double, cornerRadiusRatio = 0.2, cornerFontRatio = 0.4, cornerSuitRatio = 0.3, centerSuitRatio = 0.7, cornerPaddingRatio = 0.2, textHorizontalOffsetRatio = 0.25, minRadius$6 = 0, minAngle$5 = 0, suitEdgeBufferFactor = 0.1, fixedCacheKey = 2, cardsCache = new Map(), redSuitColor = { r: 215, g: 20, b: 20 }, blackSuitColor = { r: 18, g: 18, b: 18 };
|
|
3042
|
-
function drawRoundedCard(ctx, radius, cardData, hdr, flipped, canvasSettings) {
|
|
3164
|
+
function drawRoundedCard(ctx, radius, cardData, hdr, flipped, canvasSettings, peakNits, mode) {
|
|
3043
3165
|
if (flipped) {
|
|
3044
3166
|
drawRoundedCardBack(ctx, radius);
|
|
3045
3167
|
}
|
|
3046
3168
|
else {
|
|
3047
|
-
const cacheKey = getCacheKey(radius, hdr, cardData), cardWidth = radius * cardWidthRatio, cardHeight = radius * cardHeightRatio, halfWidth = cardWidth * half$2, halfHeight = cardHeight * half$2;
|
|
3169
|
+
const cacheKey = getCacheKey(radius, hdr, cardData, peakNits, mode), cardWidth = radius * cardWidthRatio, cardHeight = radius * cardHeightRatio, halfWidth = cardWidth * half$2, halfHeight = cardHeight * half$2;
|
|
3048
3170
|
let cachedData = cardsCache.get(cacheKey);
|
|
3049
3171
|
if (!cachedData) {
|
|
3050
3172
|
const cacheCanvas = new OffscreenCanvas(cardWidth, cardHeight), cacheCtx = cacheCanvas.getContext("2d", canvasSettings);
|
|
3051
3173
|
if (cacheCtx) {
|
|
3052
3174
|
cacheCtx.translate(halfWidth, halfHeight);
|
|
3053
|
-
drawRoundedCardFront(cacheCtx, radius, cardData, hdr);
|
|
3175
|
+
drawRoundedCardFront(cacheCtx, radius, cardData, hdr, peakNits, mode);
|
|
3054
3176
|
cachedData = cacheCanvas instanceof HTMLCanvasElement ? cacheCanvas : cacheCanvas.transferToImageBitmap();
|
|
3055
3177
|
cardsCache.set(cacheKey, cachedData);
|
|
3056
3178
|
}
|
|
@@ -3059,23 +3181,25 @@
|
|
|
3059
3181
|
ctx.drawImage(cachedData, -halfWidth, -halfHeight, cardWidth, cardHeight);
|
|
3060
3182
|
}
|
|
3061
3183
|
else {
|
|
3062
|
-
drawRoundedCardFront(ctx, radius, cardData, hdr);
|
|
3184
|
+
drawRoundedCardFront(ctx, radius, cardData, hdr, peakNits, mode);
|
|
3063
3185
|
}
|
|
3064
3186
|
}
|
|
3065
3187
|
}
|
|
3066
|
-
function getCacheKey(radius, hdr, cardData) {
|
|
3067
|
-
return `${radius.toFixed(fixedCacheKey)}-${hdr ? "hdr" : "sdr"}-${cardData.suit}-${cardData.value}`;
|
|
3188
|
+
function getCacheKey(radius, hdr, cardData, peakNits, mode) {
|
|
3189
|
+
return `${radius.toFixed(fixedCacheKey)}-${hdr ? "hdr" : "sdr"}-${peakNits !== undefined ? peakNits.toFixed(fixedCacheKey) : "default"}-${mode ?? "default"}-${cardData.suit}-${cardData.value}`;
|
|
3068
3190
|
}
|
|
3069
3191
|
function drawRoundedCardBack(ctx, radius) {
|
|
3070
3192
|
drawCardBody(ctx, radius);
|
|
3071
3193
|
}
|
|
3072
|
-
function drawRoundedCardFront(ctx, radius, cardData, hdr) {
|
|
3073
|
-
const { suit, value } = cardData, cardWidth = radius * cardWidthRatio, cardHeight = radius * cardHeightRatio, halfWidth = cardWidth * half$2, halfHeight = cardHeight * half$2, cornerPadding = radius * cornerPaddingRatio, cornerFontSize = radius * cornerFontRatio, cornerSuitSize = radius * cornerSuitRatio, centerSuitSize = radius * centerSuitRatio, textOffset = radius * textHorizontalOffsetRatio, suitEdgeBuffer = radius * suitEdgeBufferFactor, isRed = suit === SuitType.hearts || suit === SuitType.diamonds, color = isRed
|
|
3194
|
+
function drawRoundedCardFront(ctx, radius, cardData, hdr, peakNits, mode) {
|
|
3195
|
+
const { suit, value } = cardData, cardWidth = radius * cardWidthRatio, cardHeight = radius * cardHeightRatio, halfWidth = cardWidth * half$2, halfHeight = cardHeight * half$2, cornerPadding = radius * cornerPaddingRatio, cornerFontSize = radius * cornerFontRatio, cornerSuitSize = radius * cornerSuitRatio, centerSuitSize = radius * centerSuitRatio, textOffset = radius * textHorizontalOffsetRatio, suitEdgeBuffer = radius * suitEdgeBufferFactor, isRed = suit === SuitType.hearts || suit === SuitType.diamonds, color = isRed
|
|
3196
|
+
? getStyleFromRgb(redSuitColor, hdr, undefined, peakNits, mode)
|
|
3197
|
+
: getStyleFromRgb(blackSuitColor, hdr, undefined, peakNits, mode);
|
|
3074
3198
|
ctx.save();
|
|
3075
3199
|
drawCardBody(ctx, radius);
|
|
3076
|
-
ctx.fillStyle = getStyleFromRgb({ r: 255, g: 255, b: 255 }, hdr);
|
|
3200
|
+
ctx.fillStyle = getStyleFromRgb({ r: 255, g: 255, b: 255 }, hdr, undefined, peakNits, mode);
|
|
3077
3201
|
ctx.fill();
|
|
3078
|
-
ctx.strokeStyle = getStyleFromRgb({ r: 0, g: 0, b: 0 }, hdr);
|
|
3202
|
+
ctx.strokeStyle = getStyleFromRgb({ r: 0, g: 0, b: 0 }, hdr, undefined, peakNits, mode);
|
|
3079
3203
|
ctx.stroke();
|
|
3080
3204
|
ctx.fillStyle = color;
|
|
3081
3205
|
ctx.font = `bold ${cornerFontSize.toString()}px Arial, serif`;
|
|
@@ -3137,7 +3261,7 @@
|
|
|
3137
3261
|
}
|
|
3138
3262
|
const defaultOpacity = context.globalAlpha, container = this.#container;
|
|
3139
3263
|
context.globalAlpha = opacity;
|
|
3140
|
-
drawRoundedCard(context, radius, particle.cardData, container.hdr, particle.isShowingBack(), container.canvas.render.settings);
|
|
3264
|
+
drawRoundedCard(context, radius, particle.cardData, container.hdr, particle.isShowingBack(), container.canvas.render.settings, container.peakNits, container.hdrMode);
|
|
3141
3265
|
context.globalAlpha = defaultOpacity;
|
|
3142
3266
|
}
|
|
3143
3267
|
particleInit(_container, particle) {
|
|
@@ -3150,14 +3274,14 @@
|
|
|
3150
3274
|
}
|
|
3151
3275
|
|
|
3152
3276
|
async function loadFullCardsShape(engine) {
|
|
3153
|
-
engine.checkVersion("4.
|
|
3277
|
+
engine.checkVersion("4.4.0");
|
|
3154
3278
|
await engine.pluginManager.register(e => {
|
|
3155
3279
|
e.pluginManager.addShape(["card"], container => Promise.resolve(new CardDrawer(container)));
|
|
3156
3280
|
});
|
|
3157
3281
|
}
|
|
3158
3282
|
|
|
3159
3283
|
async function loadCardsShape(engine) {
|
|
3160
|
-
engine.checkVersion("4.
|
|
3284
|
+
engine.checkVersion("4.4.0");
|
|
3161
3285
|
await Promise.all([
|
|
3162
3286
|
loadFullCardsShape(engine),
|
|
3163
3287
|
loadCardSuitsShape(engine),
|
|
@@ -3227,7 +3351,7 @@
|
|
|
3227
3351
|
}
|
|
3228
3352
|
|
|
3229
3353
|
async function loadCogShape(engine) {
|
|
3230
|
-
engine.checkVersion("4.
|
|
3354
|
+
engine.checkVersion("4.4.0");
|
|
3231
3355
|
await engine.pluginManager.register(e => {
|
|
3232
3356
|
e.pluginManager.addShape(["cog"], () => Promise.resolve(new CogDrawer()));
|
|
3233
3357
|
});
|
|
@@ -6867,7 +6991,7 @@
|
|
|
6867
6991
|
|
|
6868
6992
|
const curlNoisePathName = "curlNoise";
|
|
6869
6993
|
async function loadCurlNoisePath(engine) {
|
|
6870
|
-
engine.checkVersion("4.
|
|
6994
|
+
engine.checkVersion("4.4.0");
|
|
6871
6995
|
await engine.pluginManager.register((e) => {
|
|
6872
6996
|
ensureBaseMoverLoaded(e);
|
|
6873
6997
|
e.pluginManager.addPathGenerator?.(curlNoisePathName, container => {
|
|
@@ -6970,7 +7094,7 @@
|
|
|
6970
7094
|
|
|
6971
7095
|
const curvesPathName = "curvesPathGenerator";
|
|
6972
7096
|
async function loadCurvesPath(engine) {
|
|
6973
|
-
engine.checkVersion("4.
|
|
7097
|
+
engine.checkVersion("4.4.0");
|
|
6974
7098
|
await engine.pluginManager.register((e) => {
|
|
6975
7099
|
ensureBaseMoverLoaded(e);
|
|
6976
7100
|
e.pluginManager.addPathGenerator?.(curvesPathName, container => {
|
|
@@ -6996,7 +7120,7 @@
|
|
|
6996
7120
|
});
|
|
6997
7121
|
|
|
6998
7122
|
async function loadEasingBackPlugin(engine) {
|
|
6999
|
-
engine.checkVersion("4.
|
|
7123
|
+
engine.checkVersion("4.4.0");
|
|
7000
7124
|
await engine.pluginManager.register(e => {
|
|
7001
7125
|
for (const [easing, easingFn] of easingsFunctions$d) {
|
|
7002
7126
|
e.pluginManager.addEasing(easing, easingFn);
|
|
@@ -7027,7 +7151,7 @@
|
|
|
7027
7151
|
easingsFunctions$c.set("ease-in-out-bounce", value => value < 0.5 ? (1 - bounceOut(1 - value * 2)) / 2 : (1 + bounceOut(value * 2 - 1)) / 2);
|
|
7028
7152
|
|
|
7029
7153
|
async function loadEasingBouncePlugin(engine) {
|
|
7030
|
-
engine.checkVersion("4.
|
|
7154
|
+
engine.checkVersion("4.4.0");
|
|
7031
7155
|
await engine.pluginManager.register(e => {
|
|
7032
7156
|
for (const [easing, easingFn] of easingsFunctions$c) {
|
|
7033
7157
|
e.pluginManager.addEasing(easing, easingFn);
|
|
@@ -7041,7 +7165,7 @@
|
|
|
7041
7165
|
easingsFunctions$b.set("ease-in-out-circ", value => value < 0.5 ? (1 - Math.sqrt(1 - (2 * value) ** 2)) / 2 : (Math.sqrt(1 - (-2 * value + 2) ** 2) + 1) / 2);
|
|
7042
7166
|
|
|
7043
7167
|
async function loadEasingCircPlugin(engine) {
|
|
7044
|
-
engine.checkVersion("4.
|
|
7168
|
+
engine.checkVersion("4.4.0");
|
|
7045
7169
|
await engine.pluginManager.register(e => {
|
|
7046
7170
|
for (const [easing, easingFn] of easingsFunctions$b) {
|
|
7047
7171
|
e.pluginManager.addEasing(easing, easingFn);
|
|
@@ -7055,7 +7179,7 @@
|
|
|
7055
7179
|
easingsFunctions$a.set("ease-in-out-cubic", value => (value < 0.5 ? 4 * value ** 3 : 1 - (-2 * value + 2) ** 3 / 2));
|
|
7056
7180
|
|
|
7057
7181
|
async function loadEasingCubicPlugin(engine) {
|
|
7058
|
-
engine.checkVersion("4.
|
|
7182
|
+
engine.checkVersion("4.4.0");
|
|
7059
7183
|
await engine.pluginManager.register(e => {
|
|
7060
7184
|
for (const [easing, easingFn] of easingsFunctions$a) {
|
|
7061
7185
|
e.pluginManager.addEasing(easing, easingFn);
|
|
@@ -7088,7 +7212,7 @@
|
|
|
7088
7212
|
});
|
|
7089
7213
|
|
|
7090
7214
|
async function loadEasingElasticPlugin(engine) {
|
|
7091
|
-
engine.checkVersion("4.
|
|
7215
|
+
engine.checkVersion("4.4.0");
|
|
7092
7216
|
await engine.pluginManager.register(e => {
|
|
7093
7217
|
for (const [easing, easingFn] of easingsFunctions$9) {
|
|
7094
7218
|
e.pluginManager.addEasing(easing, easingFn);
|
|
@@ -7112,7 +7236,7 @@
|
|
|
7112
7236
|
});
|
|
7113
7237
|
|
|
7114
7238
|
async function loadEasingExpoPlugin(engine) {
|
|
7115
|
-
engine.checkVersion("4.
|
|
7239
|
+
engine.checkVersion("4.4.0");
|
|
7116
7240
|
await engine.pluginManager.register(e => {
|
|
7117
7241
|
for (const [easing, easingFn] of easingsFunctions$8) {
|
|
7118
7242
|
e.pluginManager.addEasing(easing, easingFn);
|
|
@@ -7126,7 +7250,7 @@
|
|
|
7126
7250
|
easingsFunctions$7.set("ease-in-out-gaussian", value => gaussian(value));
|
|
7127
7251
|
|
|
7128
7252
|
async function loadEasingGaussianPlugin(engine) {
|
|
7129
|
-
engine.checkVersion("4.
|
|
7253
|
+
engine.checkVersion("4.4.0");
|
|
7130
7254
|
await engine.pluginManager.register(e => {
|
|
7131
7255
|
for (const [easing, easingFn] of easingsFunctions$7) {
|
|
7132
7256
|
e.pluginManager.addEasing(easing, easingFn);
|
|
@@ -7140,7 +7264,7 @@
|
|
|
7140
7264
|
easingsFunctions$6.set("ease-in-out-linear", value => value);
|
|
7141
7265
|
|
|
7142
7266
|
async function loadEasingLinearPlugin(engine) {
|
|
7143
|
-
engine.checkVersion("4.
|
|
7267
|
+
engine.checkVersion("4.4.0");
|
|
7144
7268
|
await engine.pluginManager.register(e => {
|
|
7145
7269
|
for (const [easing, easingFn] of easingsFunctions$6) {
|
|
7146
7270
|
e.pluginManager.addEasing(easing, easingFn);
|
|
@@ -7154,7 +7278,7 @@
|
|
|
7154
7278
|
easingsFunctions$5.set("ease-in-out-quart", value => (value < 0.5 ? 8 * value ** 4 : 1 - (-2 * value + 2) ** 4 / 2));
|
|
7155
7279
|
|
|
7156
7280
|
async function loadEasingQuartPlugin(engine) {
|
|
7157
|
-
engine.checkVersion("4.
|
|
7281
|
+
engine.checkVersion("4.4.0");
|
|
7158
7282
|
await engine.pluginManager.register(e => {
|
|
7159
7283
|
for (const [easing, easingFn] of easingsFunctions$5) {
|
|
7160
7284
|
e.pluginManager.addEasing(easing, easingFn);
|
|
@@ -7168,7 +7292,7 @@
|
|
|
7168
7292
|
easingsFunctions$4.set("ease-in-out-quint", value => (value < 0.5 ? 16 * value ** 5 : 1 - (-2 * value + 2) ** 5 / 2));
|
|
7169
7293
|
|
|
7170
7294
|
async function loadEasingQuintPlugin(engine) {
|
|
7171
|
-
engine.checkVersion("4.
|
|
7295
|
+
engine.checkVersion("4.4.0");
|
|
7172
7296
|
await engine.pluginManager.register(e => {
|
|
7173
7297
|
for (const [easing, easingFn] of easingsFunctions$4) {
|
|
7174
7298
|
e.pluginManager.addEasing(easing, easingFn);
|
|
@@ -7182,7 +7306,7 @@
|
|
|
7182
7306
|
easingsFunctions$3.set("ease-in-out-sigmoid", value => sigmoid(value));
|
|
7183
7307
|
|
|
7184
7308
|
async function loadEasingSigmoidPlugin(engine) {
|
|
7185
|
-
engine.checkVersion("4.
|
|
7309
|
+
engine.checkVersion("4.4.0");
|
|
7186
7310
|
await engine.pluginManager.register(e => {
|
|
7187
7311
|
for (const [easing, easingFn] of easingsFunctions$3) {
|
|
7188
7312
|
e.pluginManager.addEasing(easing, easingFn);
|
|
@@ -7196,7 +7320,7 @@
|
|
|
7196
7320
|
easingsFunctions$2.set("ease-in-out-sine", value => -(Math.cos(Math.PI * value) - 1) / 2);
|
|
7197
7321
|
|
|
7198
7322
|
async function loadEasingSinePlugin(engine) {
|
|
7199
|
-
engine.checkVersion("4.
|
|
7323
|
+
engine.checkVersion("4.4.0");
|
|
7200
7324
|
await engine.pluginManager.register(e => {
|
|
7201
7325
|
for (const [easing, easingFn] of easingsFunctions$2) {
|
|
7202
7326
|
e.pluginManager.addEasing(easing, easingFn);
|
|
@@ -7210,7 +7334,7 @@
|
|
|
7210
7334
|
easingsFunctions$1.set("ease-in-out-smoothstep", value => smoothstep$1(value));
|
|
7211
7335
|
|
|
7212
7336
|
async function loadEasingSmoothstepPlugin(engine) {
|
|
7213
|
-
engine.checkVersion("4.
|
|
7337
|
+
engine.checkVersion("4.4.0");
|
|
7214
7338
|
await engine.pluginManager.register(e => {
|
|
7215
7339
|
for (const [easing, easingFn] of easingsFunctions$1) {
|
|
7216
7340
|
e.pluginManager.addEasing(easing, easingFn);
|
|
@@ -7449,7 +7573,7 @@
|
|
|
7449
7573
|
}
|
|
7450
7574
|
|
|
7451
7575
|
async function loadInteractivityPlugin(engine) {
|
|
7452
|
-
engine.checkVersion("4.
|
|
7576
|
+
engine.checkVersion("4.4.0");
|
|
7453
7577
|
await engine.pluginManager.register(e => {
|
|
7454
7578
|
const interactivityEngine = e, interactivityPluginManager = interactivityEngine.pluginManager;
|
|
7455
7579
|
interactivityPluginManager.addPlugin(new InteractivityPlugin(interactivityPluginManager));
|
|
@@ -7792,7 +7916,7 @@
|
|
|
7792
7916
|
})(EmitterClickMode || (EmitterClickMode = {}));
|
|
7793
7917
|
|
|
7794
7918
|
async function loadEmittersInteraction(engine) {
|
|
7795
|
-
engine.checkVersion("4.
|
|
7919
|
+
engine.checkVersion("4.4.0");
|
|
7796
7920
|
await engine.pluginManager.register(async (e) => {
|
|
7797
7921
|
const instancesManager = await getEmittersInstancesManager(e);
|
|
7798
7922
|
ensureInteractivityPluginLoaded(e);
|
|
@@ -7835,7 +7959,7 @@
|
|
|
7835
7959
|
}
|
|
7836
7960
|
|
|
7837
7961
|
async function loadEmittersPluginSimple(engine) {
|
|
7838
|
-
engine.checkVersion("4.
|
|
7962
|
+
engine.checkVersion("4.4.0");
|
|
7839
7963
|
await engine.pluginManager.register(async (e) => {
|
|
7840
7964
|
const instancesManager = await getEmittersInstancesManager(e);
|
|
7841
7965
|
await addEmittersShapesManager(e);
|
|
@@ -8175,7 +8299,7 @@
|
|
|
8175
8299
|
}
|
|
8176
8300
|
|
|
8177
8301
|
async function loadEmittersShapeCanvas(engine) {
|
|
8178
|
-
engine.checkVersion("4.
|
|
8302
|
+
engine.checkVersion("4.4.0");
|
|
8179
8303
|
await engine.pluginManager.register((e) => {
|
|
8180
8304
|
ensureEmittersPluginLoaded(e);
|
|
8181
8305
|
e.pluginManager.addEmitterShapeGenerator?.("canvas", new EmittersCanvasShapeGenerator());
|
|
@@ -8312,7 +8436,7 @@
|
|
|
8312
8436
|
}
|
|
8313
8437
|
|
|
8314
8438
|
async function loadEmittersShapePath(engine) {
|
|
8315
|
-
engine.checkVersion("4.
|
|
8439
|
+
engine.checkVersion("4.4.0");
|
|
8316
8440
|
await engine.pluginManager.register((e) => {
|
|
8317
8441
|
ensureEmittersPluginLoaded(e);
|
|
8318
8442
|
e.pluginManager.addEmitterShapeGenerator?.("path", new EmittersPathShapeGenerator());
|
|
@@ -8439,7 +8563,7 @@
|
|
|
8439
8563
|
}
|
|
8440
8564
|
|
|
8441
8565
|
async function loadEmittersShapePolygon(engine) {
|
|
8442
|
-
engine.checkVersion("4.
|
|
8566
|
+
engine.checkVersion("4.4.0");
|
|
8443
8567
|
await engine.pluginManager.register((e) => {
|
|
8444
8568
|
ensureEmittersPluginLoaded(e);
|
|
8445
8569
|
e.pluginManager.addEmitterShapeGenerator?.("polygon", new EmittersPolygonShapeGenerator());
|
|
@@ -8460,7 +8584,7 @@
|
|
|
8460
8584
|
}
|
|
8461
8585
|
|
|
8462
8586
|
async function loadExportImagePlugin(engine) {
|
|
8463
|
-
engine.checkVersion("4.
|
|
8587
|
+
engine.checkVersion("4.4.0");
|
|
8464
8588
|
await engine.pluginManager.register(e => {
|
|
8465
8589
|
e.pluginManager.addPlugin(new ExportImagePlugin());
|
|
8466
8590
|
});
|
|
@@ -8480,7 +8604,7 @@
|
|
|
8480
8604
|
}
|
|
8481
8605
|
|
|
8482
8606
|
async function loadExportJSONPlugin(engine) {
|
|
8483
|
-
engine.checkVersion("4.
|
|
8607
|
+
engine.checkVersion("4.4.0");
|
|
8484
8608
|
await engine.pluginManager.register(e => {
|
|
8485
8609
|
e.pluginManager.addPlugin(new ExportJSONPlugin());
|
|
8486
8610
|
});
|
|
@@ -8500,7 +8624,7 @@
|
|
|
8500
8624
|
}
|
|
8501
8625
|
|
|
8502
8626
|
async function loadExportVideoPlugin(engine) {
|
|
8503
|
-
engine.checkVersion("4.
|
|
8627
|
+
engine.checkVersion("4.4.0");
|
|
8504
8628
|
await engine.pluginManager.register(e => {
|
|
8505
8629
|
e.pluginManager.addPlugin(new ExportVideoPlugin());
|
|
8506
8630
|
});
|
|
@@ -8652,7 +8776,7 @@
|
|
|
8652
8776
|
}
|
|
8653
8777
|
|
|
8654
8778
|
async function loadExternalCannonInteraction(engine) {
|
|
8655
|
-
engine.checkVersion("4.
|
|
8779
|
+
engine.checkVersion("4.4.0");
|
|
8656
8780
|
await engine.pluginManager.register((e) => {
|
|
8657
8781
|
ensureInteractivityPluginLoaded(e);
|
|
8658
8782
|
e.pluginManager.addInteractor?.("externalCannon", container => {
|
|
@@ -8781,7 +8905,7 @@
|
|
|
8781
8905
|
}
|
|
8782
8906
|
|
|
8783
8907
|
async function loadExternalParticleInteraction(engine) {
|
|
8784
|
-
engine.checkVersion("4.
|
|
8908
|
+
engine.checkVersion("4.4.0");
|
|
8785
8909
|
await engine.pluginManager.register((e) => {
|
|
8786
8910
|
ensureInteractivityPluginLoaded(e);
|
|
8787
8911
|
e.pluginManager.addInteractor?.("externalParticle", container => {
|
|
@@ -8829,7 +8953,7 @@
|
|
|
8829
8953
|
}
|
|
8830
8954
|
|
|
8831
8955
|
async function loadExternalPopInteraction(engine) {
|
|
8832
|
-
engine.checkVersion("4.
|
|
8956
|
+
engine.checkVersion("4.4.0");
|
|
8833
8957
|
await engine.pluginManager.register((e) => {
|
|
8834
8958
|
ensureInteractivityPluginLoaded(e);
|
|
8835
8959
|
e.pluginManager.addInteractor?.("externalPop", container => {
|
|
@@ -8870,7 +8994,7 @@
|
|
|
8870
8994
|
}
|
|
8871
8995
|
|
|
8872
8996
|
async function loadFilterEffect(engine) {
|
|
8873
|
-
engine.checkVersion("4.
|
|
8997
|
+
engine.checkVersion("4.4.0");
|
|
8874
8998
|
await engine.pluginManager.register(e => {
|
|
8875
8999
|
e.pluginManager.addEffect("filter", () => {
|
|
8876
9000
|
return Promise.resolve(new FilterDrawer());
|
|
@@ -9152,7 +9276,7 @@
|
|
|
9152
9276
|
|
|
9153
9277
|
const fractalNoisePathName = "fractalNoise";
|
|
9154
9278
|
async function loadFractalNoisePath(engine) {
|
|
9155
|
-
engine.checkVersion("4.
|
|
9279
|
+
engine.checkVersion("4.4.0");
|
|
9156
9280
|
await engine.pluginManager.register((e) => {
|
|
9157
9281
|
ensureBaseMoverLoaded(e);
|
|
9158
9282
|
e.pluginManager.addPathGenerator?.(fractalNoisePathName, container => {
|
|
@@ -9368,7 +9492,7 @@
|
|
|
9368
9492
|
}
|
|
9369
9493
|
|
|
9370
9494
|
async function loadAbsorbersInteraction(engine) {
|
|
9371
|
-
engine.checkVersion("4.
|
|
9495
|
+
engine.checkVersion("4.4.0");
|
|
9372
9496
|
await engine.pluginManager.register(async (e) => {
|
|
9373
9497
|
const pluginManager = e.pluginManager, instancesManager = await getAbsorbersInstancesManager(e);
|
|
9374
9498
|
ensureInteractivityPluginLoaded(e);
|
|
@@ -9416,7 +9540,7 @@
|
|
|
9416
9540
|
}
|
|
9417
9541
|
|
|
9418
9542
|
async function loadAbsorbersPluginSimple(engine) {
|
|
9419
|
-
engine.checkVersion("4.
|
|
9543
|
+
engine.checkVersion("4.4.0");
|
|
9420
9544
|
await engine.pluginManager.register(async (e) => {
|
|
9421
9545
|
const pluginManager = e.pluginManager, instancesManager = await getAbsorbersInstancesManager(e);
|
|
9422
9546
|
pluginManager.addPlugin(new AbsorbersPlugin(instancesManager));
|
|
@@ -9742,7 +9866,7 @@
|
|
|
9742
9866
|
}
|
|
9743
9867
|
|
|
9744
9868
|
async function loadDestroyUpdater(engine) {
|
|
9745
|
-
engine.checkVersion("4.
|
|
9869
|
+
engine.checkVersion("4.4.0");
|
|
9746
9870
|
await engine.pluginManager.register(e => {
|
|
9747
9871
|
e.pluginManager.addParticleUpdater("destroy", container => {
|
|
9748
9872
|
return Promise.resolve(new DestroyUpdater(e.pluginManager, container));
|
|
@@ -9788,7 +9912,7 @@
|
|
|
9788
9912
|
}
|
|
9789
9913
|
|
|
9790
9914
|
async function loadEmittersShapeCircle(engine) {
|
|
9791
|
-
engine.checkVersion("4.
|
|
9915
|
+
engine.checkVersion("4.4.0");
|
|
9792
9916
|
await engine.pluginManager.register((e) => {
|
|
9793
9917
|
ensureEmittersPluginLoaded(e);
|
|
9794
9918
|
e.pluginManager.addEmitterShapeGenerator?.("circle", new EmittersCircleShapeGenerator());
|
|
@@ -9869,7 +9993,7 @@
|
|
|
9869
9993
|
}
|
|
9870
9994
|
|
|
9871
9995
|
async function loadEmittersShapeSquare(engine) {
|
|
9872
|
-
engine.checkVersion("4.
|
|
9996
|
+
engine.checkVersion("4.4.0");
|
|
9873
9997
|
await engine.pluginManager.register((e) => {
|
|
9874
9998
|
ensureEmittersPluginLoaded(e);
|
|
9875
9999
|
e.pluginManager.addEmitterShapeGenerator?.("square", new EmittersSquareShapeGenerator());
|
|
@@ -10051,7 +10175,7 @@
|
|
|
10051
10175
|
}
|
|
10052
10176
|
|
|
10053
10177
|
async function loadExternalDragInteraction(engine) {
|
|
10054
|
-
engine.checkVersion("4.
|
|
10178
|
+
engine.checkVersion("4.4.0");
|
|
10055
10179
|
await engine.pluginManager.register((e) => {
|
|
10056
10180
|
ensureInteractivityPluginLoaded(e);
|
|
10057
10181
|
e.pluginManager.addInteractor?.("externalDrag", container => {
|
|
@@ -10224,7 +10348,7 @@
|
|
|
10224
10348
|
}
|
|
10225
10349
|
|
|
10226
10350
|
async function loadExternalTrailInteraction(engine) {
|
|
10227
|
-
engine.checkVersion("4.
|
|
10351
|
+
engine.checkVersion("4.4.0");
|
|
10228
10352
|
await engine.pluginManager.register((e) => {
|
|
10229
10353
|
ensureInteractivityPluginLoaded(e);
|
|
10230
10354
|
e.pluginManager.addInteractor?.("externalTrail", container => {
|
|
@@ -10360,7 +10484,7 @@
|
|
|
10360
10484
|
}
|
|
10361
10485
|
|
|
10362
10486
|
async function loadRollUpdater(engine) {
|
|
10363
|
-
engine.checkVersion("4.
|
|
10487
|
+
engine.checkVersion("4.4.0");
|
|
10364
10488
|
await engine.pluginManager.register(e => {
|
|
10365
10489
|
e.pluginManager.addParticleUpdater("roll", () => {
|
|
10366
10490
|
return Promise.resolve(new RollUpdater(e.pluginManager));
|
|
@@ -10406,7 +10530,7 @@
|
|
|
10406
10530
|
}
|
|
10407
10531
|
|
|
10408
10532
|
async function loadBlendPlugin(engine) {
|
|
10409
|
-
engine.checkVersion("4.
|
|
10533
|
+
engine.checkVersion("4.4.0");
|
|
10410
10534
|
await engine.pluginManager.register(e => {
|
|
10411
10535
|
e.pluginManager.addPlugin(new BlendPlugin());
|
|
10412
10536
|
});
|
|
@@ -10443,7 +10567,7 @@
|
|
|
10443
10567
|
}
|
|
10444
10568
|
|
|
10445
10569
|
async function loadCircleShape(engine) {
|
|
10446
|
-
engine.checkVersion("4.
|
|
10570
|
+
engine.checkVersion("4.4.0");
|
|
10447
10571
|
await engine.pluginManager.register(e => {
|
|
10448
10572
|
e.pluginManager.addShape(["circle"], () => {
|
|
10449
10573
|
return Promise.resolve(new CircleDrawer());
|
|
@@ -10491,7 +10615,7 @@
|
|
|
10491
10615
|
}
|
|
10492
10616
|
|
|
10493
10617
|
async function loadHexColorPlugin(engine) {
|
|
10494
|
-
engine.checkVersion("4.
|
|
10618
|
+
engine.checkVersion("4.4.0");
|
|
10495
10619
|
await engine.pluginManager.register(e => {
|
|
10496
10620
|
e.pluginManager.addColorManager("hex", new HexColorManager());
|
|
10497
10621
|
});
|
|
@@ -10544,7 +10668,7 @@
|
|
|
10544
10668
|
}
|
|
10545
10669
|
|
|
10546
10670
|
async function loadHslColorPlugin(engine) {
|
|
10547
|
-
engine.checkVersion("4.
|
|
10671
|
+
engine.checkVersion("4.4.0");
|
|
10548
10672
|
await engine.pluginManager.register(e => {
|
|
10549
10673
|
e.pluginManager.addColorManager("hsl", new HslColorManager());
|
|
10550
10674
|
});
|
|
@@ -10748,7 +10872,7 @@
|
|
|
10748
10872
|
}
|
|
10749
10873
|
|
|
10750
10874
|
async function loadOpacityUpdater(engine) {
|
|
10751
|
-
engine.checkVersion("4.
|
|
10875
|
+
engine.checkVersion("4.4.0");
|
|
10752
10876
|
await engine.pluginManager.register(e => {
|
|
10753
10877
|
e.pluginManager.addParticleUpdater("opacity", container => {
|
|
10754
10878
|
return Promise.resolve(new OpacityUpdater(container));
|
|
@@ -11093,7 +11217,7 @@
|
|
|
11093
11217
|
}
|
|
11094
11218
|
|
|
11095
11219
|
async function loadOutModesUpdater(engine) {
|
|
11096
|
-
engine.checkVersion("4.
|
|
11220
|
+
engine.checkVersion("4.4.0");
|
|
11097
11221
|
await engine.pluginManager.register(e => {
|
|
11098
11222
|
e.pluginManager.addParticleUpdater("outModes", container => {
|
|
11099
11223
|
return Promise.resolve(new OutOfCanvasUpdater(container));
|
|
@@ -11164,7 +11288,7 @@
|
|
|
11164
11288
|
}
|
|
11165
11289
|
|
|
11166
11290
|
async function loadPaintUpdater(engine) {
|
|
11167
|
-
engine.checkVersion("4.
|
|
11291
|
+
engine.checkVersion("4.4.0");
|
|
11168
11292
|
await engine.pluginManager.register(e => {
|
|
11169
11293
|
e.pluginManager.addParticleUpdater("paint", container => {
|
|
11170
11294
|
return Promise.resolve(new PaintUpdater(e.pluginManager, container));
|
|
@@ -11219,7 +11343,7 @@
|
|
|
11219
11343
|
}
|
|
11220
11344
|
|
|
11221
11345
|
async function loadRgbColorPlugin(engine) {
|
|
11222
|
-
engine.checkVersion("4.
|
|
11346
|
+
engine.checkVersion("4.4.0");
|
|
11223
11347
|
await engine.pluginManager.register(e => {
|
|
11224
11348
|
e.pluginManager.addColorManager("rgb", new RgbColorManager());
|
|
11225
11349
|
});
|
|
@@ -11304,7 +11428,7 @@
|
|
|
11304
11428
|
}
|
|
11305
11429
|
|
|
11306
11430
|
async function loadSizeUpdater(engine) {
|
|
11307
|
-
engine.checkVersion("4.
|
|
11431
|
+
engine.checkVersion("4.4.0");
|
|
11308
11432
|
await engine.pluginManager.register(e => {
|
|
11309
11433
|
e.pluginManager.addParticleUpdater("size", container => {
|
|
11310
11434
|
return Promise.resolve(new SizeUpdater(container));
|
|
@@ -11313,7 +11437,7 @@
|
|
|
11313
11437
|
}
|
|
11314
11438
|
|
|
11315
11439
|
async function loadBasic(engine) {
|
|
11316
|
-
engine.checkVersion("4.
|
|
11440
|
+
engine.checkVersion("4.4.0");
|
|
11317
11441
|
await engine.pluginManager.register(async (e) => {
|
|
11318
11442
|
await Promise.all([
|
|
11319
11443
|
loadBlendPlugin(e),
|
|
@@ -11336,7 +11460,7 @@
|
|
|
11336
11460
|
easingsFunctions.set("ease-in-out-quad", value => (value < 0.5 ? 2 * value ** 2 : 1 - (-2 * value + 2) ** 2 / 2));
|
|
11337
11461
|
|
|
11338
11462
|
async function loadEasingQuadPlugin(engine) {
|
|
11339
|
-
engine.checkVersion("4.
|
|
11463
|
+
engine.checkVersion("4.4.0");
|
|
11340
11464
|
await engine.pluginManager.register(e => {
|
|
11341
11465
|
for (const [easing, easingFn] of easingsFunctions) {
|
|
11342
11466
|
e.pluginManager.addEasing(easing, easingFn);
|
|
@@ -11430,7 +11554,7 @@
|
|
|
11430
11554
|
}
|
|
11431
11555
|
|
|
11432
11556
|
async function loadEmojiShape(engine) {
|
|
11433
|
-
engine.checkVersion("4.
|
|
11557
|
+
engine.checkVersion("4.4.0");
|
|
11434
11558
|
await engine.pluginManager.register(e => {
|
|
11435
11559
|
e.pluginManager.addShape(validTypes$1, () => Promise.resolve(new EmojiDrawer()));
|
|
11436
11560
|
});
|
|
@@ -11663,7 +11787,7 @@
|
|
|
11663
11787
|
};
|
|
11664
11788
|
|
|
11665
11789
|
async function loadExternalAttractInteraction(engine) {
|
|
11666
|
-
engine.checkVersion("4.
|
|
11790
|
+
engine.checkVersion("4.4.0");
|
|
11667
11791
|
await engine.pluginManager.register((e) => {
|
|
11668
11792
|
ensureInteractivityPluginLoaded(e);
|
|
11669
11793
|
e.pluginManager.addInteractor?.("externalAttract", container => {
|
|
@@ -11852,7 +11976,7 @@
|
|
|
11852
11976
|
}
|
|
11853
11977
|
|
|
11854
11978
|
async function loadExternalBounceInteraction(engine) {
|
|
11855
|
-
engine.checkVersion("4.
|
|
11979
|
+
engine.checkVersion("4.4.0");
|
|
11856
11980
|
await engine.pluginManager.register((e) => {
|
|
11857
11981
|
ensureInteractivityPluginLoaded(e);
|
|
11858
11982
|
e.pluginManager.addInteractor?.("externalBounce", container => {
|
|
@@ -12139,7 +12263,7 @@
|
|
|
12139
12263
|
mod.strokeColor = undefined;
|
|
12140
12264
|
const pColor = particle.getFillColor();
|
|
12141
12265
|
if (pColor) {
|
|
12142
|
-
const mixedColor = rgbToHsl(colorMix(pColor, mod.finalColor, ratioOffset - ratio, ratio));
|
|
12266
|
+
const mixedColor = rgbToHsl(colorMix(pColor, mod.finalColor, ratioOffset - ratio, ratio, this.container.hdr));
|
|
12143
12267
|
mod.fillColor = mixedColor;
|
|
12144
12268
|
mod.strokeColor = mixedColor;
|
|
12145
12269
|
}
|
|
@@ -12252,7 +12376,7 @@
|
|
|
12252
12376
|
}
|
|
12253
12377
|
|
|
12254
12378
|
async function loadExternalBubbleInteraction(engine) {
|
|
12255
|
-
engine.checkVersion("4.
|
|
12379
|
+
engine.checkVersion("4.4.0");
|
|
12256
12380
|
await engine.pluginManager.register((e) => {
|
|
12257
12381
|
ensureInteractivityPluginLoaded(e);
|
|
12258
12382
|
e.pluginManager.addInteractor?.("externalBubble", container => {
|
|
@@ -12291,10 +12415,10 @@
|
|
|
12291
12415
|
if (!color1 || !color2) {
|
|
12292
12416
|
return;
|
|
12293
12417
|
}
|
|
12294
|
-
const sourcePos = p1.getPosition(), destPos = p2.getPosition(), midRgb = colorMix(color1, color2, p1.getRadius(), p2.getRadius()), grad = context.createLinearGradient(sourcePos.x, sourcePos.y, destPos.x, destPos.y);
|
|
12295
|
-
grad.addColorStop(gradientMin, getStyleFromHsl(color1, container.hdr, opacity));
|
|
12296
|
-
grad.addColorStop(clamp(gradStop, gradientMin, gradientMax), getStyleFromRgb(midRgb, container.hdr, opacity));
|
|
12297
|
-
grad.addColorStop(gradientMax, getStyleFromHsl(color2, container.hdr, opacity));
|
|
12418
|
+
const sourcePos = p1.getPosition(), destPos = p2.getPosition(), midRgb = colorMix(color1, color2, p1.getRadius(), p2.getRadius(), container.hdr), grad = context.createLinearGradient(sourcePos.x, sourcePos.y, destPos.x, destPos.y);
|
|
12419
|
+
grad.addColorStop(gradientMin, getStyleFromHsl(color1, container.hdr, opacity, container.peakNits, container.hdrMode));
|
|
12420
|
+
grad.addColorStop(clamp(gradStop, gradientMin, gradientMax), getStyleFromRgb(midRgb, container.hdr, opacity, container.peakNits, container.hdrMode));
|
|
12421
|
+
grad.addColorStop(gradientMax, getStyleFromHsl(color2, container.hdr, opacity, container.peakNits, container.hdrMode));
|
|
12298
12422
|
return grad;
|
|
12299
12423
|
}
|
|
12300
12424
|
function drawConnectLine(context, width, lineStyle, begin, end) {
|
|
@@ -12380,7 +12504,7 @@
|
|
|
12380
12504
|
}
|
|
12381
12505
|
|
|
12382
12506
|
async function loadExternalConnectInteraction(engine) {
|
|
12383
|
-
engine.checkVersion("4.
|
|
12507
|
+
engine.checkVersion("4.4.0");
|
|
12384
12508
|
await engine.pluginManager.register((e) => {
|
|
12385
12509
|
ensureInteractivityPluginLoaded(e);
|
|
12386
12510
|
e.pluginManager.addInteractor?.("externalConnect", container => {
|
|
@@ -12484,7 +12608,7 @@
|
|
|
12484
12608
|
}
|
|
12485
12609
|
|
|
12486
12610
|
async function loadExternalDestroyInteraction(engine) {
|
|
12487
|
-
engine.checkVersion("4.
|
|
12611
|
+
engine.checkVersion("4.4.0");
|
|
12488
12612
|
await engine.pluginManager.register((e) => {
|
|
12489
12613
|
ensureInteractivityPluginLoaded(e);
|
|
12490
12614
|
e.pluginManager.addInteractor?.("externalDestroy", async (container) => {
|
|
@@ -12524,16 +12648,16 @@
|
|
|
12524
12648
|
}
|
|
12525
12649
|
|
|
12526
12650
|
const defaultWidth$2 = 0;
|
|
12527
|
-
function drawGrabLine(context, width, begin, end, colorLine, opacity, hdr = false) {
|
|
12651
|
+
function drawGrabLine(context, width, begin, end, colorLine, opacity, hdr = false, peakNits, mode) {
|
|
12528
12652
|
drawLine$1(context, begin, end);
|
|
12529
|
-
context.strokeStyle = getStyleFromRgb(colorLine, hdr, opacity);
|
|
12653
|
+
context.strokeStyle = getStyleFromRgb(colorLine, hdr, opacity, peakNits, mode);
|
|
12530
12654
|
context.lineWidth = width;
|
|
12531
12655
|
context.stroke();
|
|
12532
12656
|
}
|
|
12533
12657
|
function drawGrab(container, particle, lineColor, opacity, mousePos) {
|
|
12534
12658
|
container.canvas.render.draw(ctx => {
|
|
12535
12659
|
const beginPos = particle.getPosition();
|
|
12536
|
-
drawGrabLine(ctx, particle.retina.linksWidth ?? defaultWidth$2, beginPos, mousePos, lineColor, opacity, container.hdr);
|
|
12660
|
+
drawGrabLine(ctx, particle.retina.linksWidth ?? defaultWidth$2, beginPos, mousePos, lineColor, opacity, container.hdr, container.peakNits, container.hdrMode);
|
|
12537
12661
|
});
|
|
12538
12662
|
}
|
|
12539
12663
|
|
|
@@ -12589,7 +12713,7 @@
|
|
|
12589
12713
|
const linksOptions = interactivity.modes.grab.links;
|
|
12590
12714
|
container.particles.grabLineColor = getLinkRandomColor(this.#pluginManager, optColor, linksOptions.blink, linksOptions.consent);
|
|
12591
12715
|
}
|
|
12592
|
-
const colorLine = getLinkColor(particle, undefined, container.particles.grabLineColor);
|
|
12716
|
+
const colorLine = getLinkColor(particle, undefined, container.particles.grabLineColor, container.hdr);
|
|
12593
12717
|
if (!colorLine) {
|
|
12594
12718
|
continue;
|
|
12595
12719
|
}
|
|
@@ -12608,7 +12732,7 @@
|
|
|
12608
12732
|
}
|
|
12609
12733
|
|
|
12610
12734
|
async function loadExternalGrabInteraction(engine) {
|
|
12611
|
-
engine.checkVersion("4.
|
|
12735
|
+
engine.checkVersion("4.4.0");
|
|
12612
12736
|
await engine.pluginManager.register((e) => {
|
|
12613
12737
|
ensureInteractivityPluginLoaded(e);
|
|
12614
12738
|
e.pluginManager.addInteractor?.("externalGrab", container => {
|
|
@@ -12678,7 +12802,7 @@
|
|
|
12678
12802
|
}
|
|
12679
12803
|
|
|
12680
12804
|
async function loadExternalParallaxInteraction(engine) {
|
|
12681
|
-
engine.checkVersion("4.
|
|
12805
|
+
engine.checkVersion("4.4.0");
|
|
12682
12806
|
await engine.pluginManager.register((e) => {
|
|
12683
12807
|
ensureInteractivityPluginLoaded(e);
|
|
12684
12808
|
e.pluginManager.addInteractor?.("externalParallax", container => {
|
|
@@ -12721,7 +12845,7 @@
|
|
|
12721
12845
|
}
|
|
12722
12846
|
|
|
12723
12847
|
async function loadExternalPauseInteraction(engine) {
|
|
12724
|
-
engine.checkVersion("4.
|
|
12848
|
+
engine.checkVersion("4.4.0");
|
|
12725
12849
|
await engine.pluginManager.register((e) => {
|
|
12726
12850
|
ensureInteractivityPluginLoaded(e);
|
|
12727
12851
|
e.pluginManager.addInteractor?.("externalPause", container => {
|
|
@@ -12793,7 +12917,7 @@
|
|
|
12793
12917
|
}
|
|
12794
12918
|
|
|
12795
12919
|
async function loadExternalPushInteraction(engine) {
|
|
12796
|
-
engine.checkVersion("4.
|
|
12920
|
+
engine.checkVersion("4.4.0");
|
|
12797
12921
|
await engine.pluginManager.register((e) => {
|
|
12798
12922
|
ensureInteractivityPluginLoaded(e);
|
|
12799
12923
|
e.pluginManager.addInteractor?.("externalPush", container => {
|
|
@@ -12847,7 +12971,7 @@
|
|
|
12847
12971
|
}
|
|
12848
12972
|
|
|
12849
12973
|
async function loadExternalRemoveInteraction(engine) {
|
|
12850
|
-
engine.checkVersion("4.
|
|
12974
|
+
engine.checkVersion("4.4.0");
|
|
12851
12975
|
await engine.pluginManager.register((e) => {
|
|
12852
12976
|
ensureInteractivityPluginLoaded(e);
|
|
12853
12977
|
e.pluginManager.addInteractor?.("externalRemove", container => {
|
|
@@ -13153,7 +13277,7 @@
|
|
|
13153
13277
|
};
|
|
13154
13278
|
|
|
13155
13279
|
async function loadExternalRepulseInteraction(engine) {
|
|
13156
|
-
engine.checkVersion("4.
|
|
13280
|
+
engine.checkVersion("4.4.0");
|
|
13157
13281
|
await engine.pluginManager.register((e) => {
|
|
13158
13282
|
ensureInteractivityPluginLoaded(e);
|
|
13159
13283
|
const pluginManager = e.pluginManager;
|
|
@@ -13247,7 +13371,7 @@
|
|
|
13247
13371
|
}
|
|
13248
13372
|
|
|
13249
13373
|
async function loadExternalSlowInteraction(engine) {
|
|
13250
|
-
engine.checkVersion("4.
|
|
13374
|
+
engine.checkVersion("4.4.0");
|
|
13251
13375
|
await engine.pluginManager.register((e) => {
|
|
13252
13376
|
ensureInteractivityPluginLoaded(e);
|
|
13253
13377
|
e.pluginManager.addInteractor?.("externalSlow", container => {
|
|
@@ -13259,12 +13383,12 @@
|
|
|
13259
13383
|
const shapeTypes = ["image", "images"];
|
|
13260
13384
|
const stringStart = 0, defaultOpacity = 1;
|
|
13261
13385
|
const currentColorRegex = /(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d.]+%?\))|currentcolor/gi;
|
|
13262
|
-
function replaceColorSvg(imageShape, color, opacity, hdr = false) {
|
|
13386
|
+
function replaceColorSvg(imageShape, color, opacity, hdr = false, peakNits, mode) {
|
|
13263
13387
|
const { svgData } = imageShape;
|
|
13264
13388
|
if (!svgData) {
|
|
13265
13389
|
return "";
|
|
13266
13390
|
}
|
|
13267
|
-
const colorStyle = getStyleFromHsl(color, hdr, opacity);
|
|
13391
|
+
const colorStyle = getStyleFromHsl(color, hdr, opacity, peakNits, mode);
|
|
13268
13392
|
if (svgData.includes("fill")) {
|
|
13269
13393
|
return svgData.replaceAll(currentColorRegex, () => colorStyle);
|
|
13270
13394
|
}
|
|
@@ -13306,8 +13430,8 @@
|
|
|
13306
13430
|
}
|
|
13307
13431
|
image.loading = false;
|
|
13308
13432
|
}
|
|
13309
|
-
function replaceImageColor(image, imageData, color, particle, hdr = false) {
|
|
13310
|
-
const svgColoredData = replaceColorSvg(image, color, particle.opacity?.value ?? defaultOpacity, hdr), imageRes = {
|
|
13433
|
+
function replaceImageColor(image, imageData, color, particle, hdr = false, peakNits, mode) {
|
|
13434
|
+
const svgColoredData = replaceColorSvg(image, color, particle.opacity?.value ?? defaultOpacity, hdr, peakNits, mode), imageRes = {
|
|
13311
13435
|
color,
|
|
13312
13436
|
data: {
|
|
13313
13437
|
...image,
|
|
@@ -13419,7 +13543,7 @@
|
|
|
13419
13543
|
void (async () => {
|
|
13420
13544
|
let imageRes;
|
|
13421
13545
|
if (image.svgData && color) {
|
|
13422
|
-
imageRes = await replaceImageColor(image, imageData, color, particle, container.hdr);
|
|
13546
|
+
imageRes = await replaceImageColor(image, imageData, color, particle, container.hdr, container.peakNits, container.hdrMode);
|
|
13423
13547
|
}
|
|
13424
13548
|
else {
|
|
13425
13549
|
imageRes = {
|
|
@@ -13556,7 +13680,7 @@
|
|
|
13556
13680
|
};
|
|
13557
13681
|
}
|
|
13558
13682
|
async function loadImageShape(engine) {
|
|
13559
|
-
engine.checkVersion("4.
|
|
13683
|
+
engine.checkVersion("4.4.0");
|
|
13560
13684
|
await engine.pluginManager.register(e => {
|
|
13561
13685
|
addLoadImageToEngine(e);
|
|
13562
13686
|
e.pluginManager.addPlugin(new ImagePreloaderPlugin(e));
|
|
@@ -13701,7 +13825,7 @@
|
|
|
13701
13825
|
}
|
|
13702
13826
|
|
|
13703
13827
|
async function loadLifeUpdater(engine) {
|
|
13704
|
-
engine.checkVersion("4.
|
|
13828
|
+
engine.checkVersion("4.4.0");
|
|
13705
13829
|
await engine.pluginManager.register(e => {
|
|
13706
13830
|
e.pluginManager.addParticleUpdater("life", container => {
|
|
13707
13831
|
return Promise.resolve(new LifeUpdater(container));
|
|
@@ -13727,7 +13851,7 @@
|
|
|
13727
13851
|
}
|
|
13728
13852
|
|
|
13729
13853
|
async function loadLineShape(engine) {
|
|
13730
|
-
engine.checkVersion("4.
|
|
13854
|
+
engine.checkVersion("4.4.0");
|
|
13731
13855
|
await engine.pluginManager.register(e => {
|
|
13732
13856
|
e.pluginManager.addShape(["line"], () => Promise.resolve(new LineDrawer()));
|
|
13733
13857
|
});
|
|
@@ -13811,7 +13935,7 @@
|
|
|
13811
13935
|
}
|
|
13812
13936
|
|
|
13813
13937
|
async function loadParticlesAttractInteraction(engine) {
|
|
13814
|
-
engine.checkVersion("4.
|
|
13938
|
+
engine.checkVersion("4.4.0");
|
|
13815
13939
|
await engine.pluginManager.register((e) => {
|
|
13816
13940
|
ensureInteractivityPluginLoaded(e);
|
|
13817
13941
|
e.pluginManager.addInteractor?.("particlesAttract", container => {
|
|
@@ -14021,7 +14145,7 @@
|
|
|
14021
14145
|
}
|
|
14022
14146
|
|
|
14023
14147
|
async function loadParticlesCollisionsInteraction(engine) {
|
|
14024
|
-
engine.checkVersion("4.
|
|
14148
|
+
engine.checkVersion("4.4.0");
|
|
14025
14149
|
await engine.pluginManager.register((e) => {
|
|
14026
14150
|
ensureInteractivityPluginLoaded(e);
|
|
14027
14151
|
e.pluginManager.addPlugin(new OverlapPlugin());
|
|
@@ -14234,7 +14358,7 @@
|
|
|
14234
14358
|
const linkColor = linksOptions.id !== undefined
|
|
14235
14359
|
? container.particles.linksColors.get(linksOptions.id)
|
|
14236
14360
|
: container.particles.linksColor;
|
|
14237
|
-
return getLinkColor(p1, p2, linkColor);
|
|
14361
|
+
return getLinkColor(p1, p2, linkColor, container.hdr);
|
|
14238
14362
|
}
|
|
14239
14363
|
#setColor(p1) {
|
|
14240
14364
|
if (!p1.options.links) {
|
|
@@ -14275,7 +14399,7 @@
|
|
|
14275
14399
|
}
|
|
14276
14400
|
|
|
14277
14401
|
async function loadParticlesLinksInteraction(engine) {
|
|
14278
|
-
engine.checkVersion("4.
|
|
14402
|
+
engine.checkVersion("4.4.0");
|
|
14279
14403
|
await engine.pluginManager.register((e) => {
|
|
14280
14404
|
const pluginManager = e.pluginManager;
|
|
14281
14405
|
ensureInteractivityPluginLoaded(e);
|
|
@@ -14365,19 +14489,19 @@
|
|
|
14365
14489
|
}
|
|
14366
14490
|
|
|
14367
14491
|
async function loadGenericPolygonShape(engine) {
|
|
14368
|
-
engine.checkVersion("4.
|
|
14492
|
+
engine.checkVersion("4.4.0");
|
|
14369
14493
|
await engine.pluginManager.register(e => {
|
|
14370
14494
|
e.pluginManager.addShape(["polygon"], () => Promise.resolve(new PolygonDrawer()));
|
|
14371
14495
|
});
|
|
14372
14496
|
}
|
|
14373
14497
|
async function loadTriangleShape(engine) {
|
|
14374
|
-
engine.checkVersion("4.
|
|
14498
|
+
engine.checkVersion("4.4.0");
|
|
14375
14499
|
await engine.pluginManager.register(e => {
|
|
14376
14500
|
e.pluginManager.addShape(["triangle"], () => Promise.resolve(new TriangleDrawer()));
|
|
14377
14501
|
});
|
|
14378
14502
|
}
|
|
14379
14503
|
async function loadPolygonShape(engine) {
|
|
14380
|
-
engine.checkVersion("4.
|
|
14504
|
+
engine.checkVersion("4.4.0");
|
|
14381
14505
|
await Promise.all([
|
|
14382
14506
|
loadGenericPolygonShape(engine),
|
|
14383
14507
|
loadTriangleShape(engine),
|
|
@@ -14482,7 +14606,7 @@
|
|
|
14482
14606
|
}
|
|
14483
14607
|
|
|
14484
14608
|
async function loadRotateUpdater(engine) {
|
|
14485
|
-
engine.checkVersion("4.
|
|
14609
|
+
engine.checkVersion("4.4.0");
|
|
14486
14610
|
await engine.pluginManager.register(e => {
|
|
14487
14611
|
e.pluginManager.addParticleUpdater("rotate", container => {
|
|
14488
14612
|
return Promise.resolve(new RotateUpdater(container));
|
|
@@ -14506,7 +14630,7 @@
|
|
|
14506
14630
|
}
|
|
14507
14631
|
|
|
14508
14632
|
async function loadSquareShape(engine) {
|
|
14509
|
-
engine.checkVersion("4.
|
|
14633
|
+
engine.checkVersion("4.4.0");
|
|
14510
14634
|
await engine.pluginManager.register(e => {
|
|
14511
14635
|
e.pluginManager.addShape(["edge", "square"], () => Promise.resolve(new SquareDrawer()));
|
|
14512
14636
|
});
|
|
@@ -14540,14 +14664,14 @@
|
|
|
14540
14664
|
}
|
|
14541
14665
|
|
|
14542
14666
|
async function loadStarShape(engine) {
|
|
14543
|
-
engine.checkVersion("4.
|
|
14667
|
+
engine.checkVersion("4.4.0");
|
|
14544
14668
|
await engine.pluginManager.register(e => {
|
|
14545
14669
|
e.pluginManager.addShape(["star"], () => Promise.resolve(new StarDrawer()));
|
|
14546
14670
|
});
|
|
14547
14671
|
}
|
|
14548
14672
|
|
|
14549
14673
|
async function loadSlim(engine) {
|
|
14550
|
-
engine.checkVersion("4.
|
|
14674
|
+
engine.checkVersion("4.4.0");
|
|
14551
14675
|
await engine.pluginManager.register(async (e) => {
|
|
14552
14676
|
const loadInteractivityForSlim = async (e) => {
|
|
14553
14677
|
await loadInteractivityPlugin(e);
|
|
@@ -14664,7 +14788,7 @@
|
|
|
14664
14788
|
}
|
|
14665
14789
|
|
|
14666
14790
|
async function loadTextShape(engine) {
|
|
14667
|
-
engine.checkVersion("4.
|
|
14791
|
+
engine.checkVersion("4.4.0");
|
|
14668
14792
|
await engine.pluginManager.register(e => {
|
|
14669
14793
|
e.pluginManager.addShape(validTypes, () => Promise.resolve(new TextDrawer()));
|
|
14670
14794
|
});
|
|
@@ -14773,7 +14897,7 @@
|
|
|
14773
14897
|
}
|
|
14774
14898
|
|
|
14775
14899
|
async function loadTiltUpdater(engine) {
|
|
14776
|
-
engine.checkVersion("4.
|
|
14900
|
+
engine.checkVersion("4.4.0");
|
|
14777
14901
|
await engine.pluginManager.register(e => {
|
|
14778
14902
|
e.pluginManager.addParticleUpdater("tilt", container => {
|
|
14779
14903
|
return Promise.resolve(new TiltUpdater(container));
|
|
@@ -14849,12 +14973,12 @@
|
|
|
14849
14973
|
if (!twinkleFillRgb) {
|
|
14850
14974
|
return undefined;
|
|
14851
14975
|
}
|
|
14852
|
-
return getStyleFromHsl(twinkleFillRgb, container.hdr, twinklingOpacity);
|
|
14976
|
+
return getStyleFromHsl(twinkleFillRgb, container.hdr, twinklingOpacity, container.peakNits, container.hdrMode);
|
|
14853
14977
|
}, getTwinkleStrokeStyle = () => {
|
|
14854
14978
|
if (!twinkleStrokeRgb) {
|
|
14855
14979
|
return undefined;
|
|
14856
14980
|
}
|
|
14857
|
-
return getStyleFromHsl(twinkleStrokeRgb, container.hdr, twinklingOpacity);
|
|
14981
|
+
return getStyleFromHsl(twinkleStrokeRgb, container.hdr, twinklingOpacity, container.peakNits, container.hdrMode);
|
|
14858
14982
|
}, twinkleFillStyle = getTwinkleFillStyle(), twinkleStrokeStyle = getTwinkleStrokeStyle(), res = {}, needsTwinkle = twinkling && (!!twinkleFillStyle || !!twinkleStrokeStyle);
|
|
14859
14983
|
res.fill = needsTwinkle ? twinkleFillStyle : undefined;
|
|
14860
14984
|
res.stroke = needsTwinkle ? twinkleStrokeStyle : undefined;
|
|
@@ -14877,7 +15001,7 @@
|
|
|
14877
15001
|
}
|
|
14878
15002
|
|
|
14879
15003
|
async function loadTwinkleUpdater(engine) {
|
|
14880
|
-
engine.checkVersion("4.
|
|
15004
|
+
engine.checkVersion("4.4.0");
|
|
14881
15005
|
await engine.pluginManager.register(e => {
|
|
14882
15006
|
e.pluginManager.addParticleUpdater("twinkle", container => {
|
|
14883
15007
|
return Promise.resolve(new TwinkleUpdater(e.pluginManager, container));
|
|
@@ -14979,7 +15103,7 @@
|
|
|
14979
15103
|
}
|
|
14980
15104
|
|
|
14981
15105
|
async function loadWobbleUpdater(engine) {
|
|
14982
|
-
engine.checkVersion("4.
|
|
15106
|
+
engine.checkVersion("4.4.0");
|
|
14983
15107
|
await engine.pluginManager.register(e => {
|
|
14984
15108
|
e.pluginManager.addParticleUpdater("wobble", container => {
|
|
14985
15109
|
return Promise.resolve(new WobbleUpdater(container));
|
|
@@ -14988,7 +15112,7 @@
|
|
|
14988
15112
|
}
|
|
14989
15113
|
|
|
14990
15114
|
async function loadFull(engine) {
|
|
14991
|
-
engine.checkVersion("4.
|
|
15115
|
+
engine.checkVersion("4.4.0");
|
|
14992
15116
|
await engine.pluginManager.register(async (e) => {
|
|
14993
15117
|
const loadEmittersPluginBundle = async (e) => {
|
|
14994
15118
|
await loadEmittersPlugin(e);
|
|
@@ -15540,7 +15664,7 @@
|
|
|
15540
15664
|
}
|
|
15541
15665
|
|
|
15542
15666
|
async function loadGifShape(engine) {
|
|
15543
|
-
engine.checkVersion("4.
|
|
15667
|
+
engine.checkVersion("4.4.0");
|
|
15544
15668
|
await engine.pluginManager.register(e => {
|
|
15545
15669
|
e.pluginManager.addShape(["gif", "gifs"], container => Promise.resolve(new GifDrawer(container)));
|
|
15546
15670
|
});
|
|
@@ -15663,7 +15787,7 @@
|
|
|
15663
15787
|
}
|
|
15664
15788
|
updateAnimation(particle, gradient.angle, false, exports.DestroyType.none, delta);
|
|
15665
15789
|
for (const color of gradient.colors) {
|
|
15666
|
-
updateColor(color.value, delta
|
|
15790
|
+
updateColor(color.value, delta);
|
|
15667
15791
|
if (color.opacity) {
|
|
15668
15792
|
updateAnimation(particle, color.opacity, true, exports.DestroyType.none, delta);
|
|
15669
15793
|
}
|
|
@@ -15691,7 +15815,7 @@
|
|
|
15691
15815
|
s: value.s.value,
|
|
15692
15816
|
l: value.l.value,
|
|
15693
15817
|
};
|
|
15694
|
-
fillGradient.addColorStop(stop, getStyleFromHsl(hsl, container.hdr, cOpacity?.value ?? opacity));
|
|
15818
|
+
fillGradient.addColorStop(stop, getStyleFromHsl(hsl, container.hdr, cOpacity?.value ?? opacity, container.peakNits, container.hdrMode));
|
|
15695
15819
|
}
|
|
15696
15820
|
return { fill: fillGradient };
|
|
15697
15821
|
}
|
|
@@ -15800,7 +15924,7 @@
|
|
|
15800
15924
|
}
|
|
15801
15925
|
|
|
15802
15926
|
async function loadGradientUpdater(engine) {
|
|
15803
|
-
engine.checkVersion("4.
|
|
15927
|
+
engine.checkVersion("4.4.0");
|
|
15804
15928
|
await engine.pluginManager.register(e => {
|
|
15805
15929
|
e.pluginManager.addParticleUpdater("gradient", container => {
|
|
15806
15930
|
return Promise.resolve(new GradientUpdater(e.pluginManager, container));
|
|
@@ -15920,7 +16044,7 @@
|
|
|
15920
16044
|
|
|
15921
16045
|
const gridPathName = "gridPathGenerator";
|
|
15922
16046
|
async function loadGridPath(engine) {
|
|
15923
|
-
engine.checkVersion("4.
|
|
16047
|
+
engine.checkVersion("4.4.0");
|
|
15924
16048
|
await engine.pluginManager.register((e) => {
|
|
15925
16049
|
ensureBaseMoverLoaded(e);
|
|
15926
16050
|
e.pluginManager.addPathGenerator?.(gridPathName, container => {
|
|
@@ -15949,7 +16073,7 @@
|
|
|
15949
16073
|
}
|
|
15950
16074
|
|
|
15951
16075
|
async function loadHeartShape(engine) {
|
|
15952
|
-
engine.checkVersion("4.
|
|
16076
|
+
engine.checkVersion("4.4.0");
|
|
15953
16077
|
await engine.pluginManager.register(e => {
|
|
15954
16078
|
e.pluginManager.addShape(["heart"], () => Promise.resolve(new HeartDrawer()));
|
|
15955
16079
|
});
|
|
@@ -16065,7 +16189,7 @@
|
|
|
16065
16189
|
}
|
|
16066
16190
|
|
|
16067
16191
|
async function loadHsvColorPlugin(engine) {
|
|
16068
|
-
engine.checkVersion("4.
|
|
16192
|
+
engine.checkVersion("4.4.0");
|
|
16069
16193
|
await engine.pluginManager.register(e => {
|
|
16070
16194
|
e.pluginManager.addColorManager("hsv", new HsvColorManager());
|
|
16071
16195
|
});
|
|
@@ -16150,7 +16274,7 @@
|
|
|
16150
16274
|
}
|
|
16151
16275
|
|
|
16152
16276
|
async function loadHwbColorPlugin(engine) {
|
|
16153
|
-
engine.checkVersion("4.
|
|
16277
|
+
engine.checkVersion("4.4.0");
|
|
16154
16278
|
await engine.pluginManager.register(e => {
|
|
16155
16279
|
e.pluginManager.addColorManager("hwb", new HwbColorManager());
|
|
16156
16280
|
});
|
|
@@ -16298,7 +16422,7 @@
|
|
|
16298
16422
|
}
|
|
16299
16423
|
|
|
16300
16424
|
async function loadInfectionPlugin(engine) {
|
|
16301
|
-
engine.checkVersion("4.
|
|
16425
|
+
engine.checkVersion("4.4.0");
|
|
16302
16426
|
await engine.pluginManager.register((e) => {
|
|
16303
16427
|
ensureInteractivityPluginLoaded(e);
|
|
16304
16428
|
e.pluginManager.addPlugin(new InfectionPlugin());
|
|
@@ -16324,7 +16448,7 @@
|
|
|
16324
16448
|
}
|
|
16325
16449
|
|
|
16326
16450
|
async function loadInfinityShape(engine) {
|
|
16327
|
-
engine.checkVersion("4.
|
|
16451
|
+
engine.checkVersion("4.4.0");
|
|
16328
16452
|
await engine.pluginManager.register(e => {
|
|
16329
16453
|
e.pluginManager.addShape(["infinity"], () => Promise.resolve(new InfinityDrawer()));
|
|
16330
16454
|
});
|
|
@@ -16425,7 +16549,7 @@
|
|
|
16425
16549
|
}
|
|
16426
16550
|
|
|
16427
16551
|
async function loadLabColorPlugin(engine) {
|
|
16428
|
-
engine.checkVersion("4.
|
|
16552
|
+
engine.checkVersion("4.4.0");
|
|
16429
16553
|
await engine.pluginManager.register(e => {
|
|
16430
16554
|
e.pluginManager.addColorManager("lab", new LabColorManager());
|
|
16431
16555
|
});
|
|
@@ -16526,7 +16650,7 @@
|
|
|
16526
16650
|
}
|
|
16527
16651
|
|
|
16528
16652
|
async function loadLchColorPlugin(engine) {
|
|
16529
|
-
engine.checkVersion("4.
|
|
16653
|
+
engine.checkVersion("4.4.0");
|
|
16530
16654
|
await engine.pluginManager.register(e => {
|
|
16531
16655
|
e.pluginManager.addColorManager("lch", new LchColorManager());
|
|
16532
16656
|
});
|
|
@@ -16580,7 +16704,7 @@
|
|
|
16580
16704
|
|
|
16581
16705
|
const levyPathName = "levyPathGenerator";
|
|
16582
16706
|
async function loadLevyPath(engine) {
|
|
16583
|
-
engine.checkVersion("4.
|
|
16707
|
+
engine.checkVersion("4.4.0");
|
|
16584
16708
|
await engine.pluginManager.register((e) => {
|
|
16585
16709
|
ensureBaseMoverLoaded(e);
|
|
16586
16710
|
e.pluginManager.addPathGenerator?.(levyPathName, container => {
|
|
@@ -16605,8 +16729,8 @@
|
|
|
16605
16729
|
if (!gradientRgb?.start || !gradientRgb.stop) {
|
|
16606
16730
|
return;
|
|
16607
16731
|
}
|
|
16608
|
-
gradientAmbientLight.addColorStop(gradientPos.min, getStyleFromRgb(gradientRgb.start, container.hdr));
|
|
16609
|
-
gradientAmbientLight.addColorStop(gradientPos.max, getStyleFromRgb(gradientRgb.stop, container.hdr));
|
|
16732
|
+
gradientAmbientLight.addColorStop(gradientPos.min, getStyleFromRgb(gradientRgb.start, container.hdr, undefined, container.peakNits, container.hdrMode));
|
|
16733
|
+
gradientAmbientLight.addColorStop(gradientPos.max, getStyleFromRgb(gradientRgb.stop, container.hdr, undefined, container.peakNits, container.hdrMode));
|
|
16610
16734
|
context.fillStyle = gradientAmbientLight;
|
|
16611
16735
|
context.fill();
|
|
16612
16736
|
}
|
|
@@ -16637,7 +16761,7 @@
|
|
|
16637
16761
|
start: dot,
|
|
16638
16762
|
});
|
|
16639
16763
|
}
|
|
16640
|
-
const shadowColor = getStyleFromRgb(shadowRgb, container.hdr), lastOffset = 1, firstPos = 0, last = points.length - lastOffset;
|
|
16764
|
+
const shadowColor = getStyleFromRgb(shadowRgb, container.hdr, undefined, container.peakNits, container.hdrMode), lastOffset = 1, firstPos = 0, last = points.length - lastOffset;
|
|
16641
16765
|
for (let i = last, n = 0; i >= firstPos; n = i--) {
|
|
16642
16766
|
context.beginPath();
|
|
16643
16767
|
const iPoint = points[i], nPoint = points[n];
|
|
@@ -16796,7 +16920,7 @@
|
|
|
16796
16920
|
}
|
|
16797
16921
|
|
|
16798
16922
|
async function loadLightInteraction(engine) {
|
|
16799
|
-
engine.checkVersion("4.
|
|
16923
|
+
engine.checkVersion("4.4.0");
|
|
16800
16924
|
await engine.pluginManager.register((e) => {
|
|
16801
16925
|
ensureInteractivityPluginLoaded(e);
|
|
16802
16926
|
e.pluginManager.addInteractor?.("externalLight", container => {
|
|
@@ -16854,7 +16978,7 @@
|
|
|
16854
16978
|
}
|
|
16855
16979
|
|
|
16856
16980
|
async function loadManualParticlesPlugin(engine) {
|
|
16857
|
-
engine.checkVersion("4.
|
|
16981
|
+
engine.checkVersion("4.4.0");
|
|
16858
16982
|
await engine.pluginManager.register(e => {
|
|
16859
16983
|
e.pluginManager.addPlugin(new ManualParticlesPlugin());
|
|
16860
16984
|
});
|
|
@@ -17075,7 +17199,7 @@
|
|
|
17075
17199
|
}
|
|
17076
17200
|
|
|
17077
17201
|
async function loadMatrixShape(engine) {
|
|
17078
|
-
engine.checkVersion("4.
|
|
17202
|
+
engine.checkVersion("4.4.0");
|
|
17079
17203
|
await engine.pluginManager.register(e => {
|
|
17080
17204
|
e.pluginManager.addShape(["matrix"], () => Promise.resolve(new MatrixDrawer()));
|
|
17081
17205
|
});
|
|
@@ -17127,7 +17251,7 @@
|
|
|
17127
17251
|
}
|
|
17128
17252
|
|
|
17129
17253
|
async function loadMotionPlugin(engine) {
|
|
17130
|
-
engine.checkVersion("4.
|
|
17254
|
+
engine.checkVersion("4.4.0");
|
|
17131
17255
|
await engine.pluginManager.register(e => {
|
|
17132
17256
|
e.pluginManager.addPlugin(new MotionPlugin());
|
|
17133
17257
|
});
|
|
@@ -17310,7 +17434,7 @@
|
|
|
17310
17434
|
}
|
|
17311
17435
|
|
|
17312
17436
|
async function loadNamedColorPlugin(engine) {
|
|
17313
|
-
engine.checkVersion("4.
|
|
17437
|
+
engine.checkVersion("4.4.0");
|
|
17314
17438
|
await engine.pluginManager.register(e => {
|
|
17315
17439
|
e.pluginManager.addColorManager("named", new NamedColorManager());
|
|
17316
17440
|
});
|
|
@@ -17406,7 +17530,7 @@
|
|
|
17406
17530
|
}
|
|
17407
17531
|
|
|
17408
17532
|
async function loadOklabColorPlugin(engine) {
|
|
17409
|
-
engine.checkVersion("4.
|
|
17533
|
+
engine.checkVersion("4.4.0");
|
|
17410
17534
|
await engine.pluginManager.register(e => {
|
|
17411
17535
|
e.pluginManager.addColorManager("oklab", new OklabColorManager());
|
|
17412
17536
|
});
|
|
@@ -17502,7 +17626,7 @@
|
|
|
17502
17626
|
}
|
|
17503
17627
|
|
|
17504
17628
|
async function loadOklchColorPlugin(engine) {
|
|
17505
|
-
engine.checkVersion("4.
|
|
17629
|
+
engine.checkVersion("4.4.0");
|
|
17506
17630
|
await engine.pluginManager.register(e => {
|
|
17507
17631
|
e.pluginManager.addColorManager("oklch", new OklchColorManager());
|
|
17508
17632
|
});
|
|
@@ -17555,7 +17679,7 @@
|
|
|
17555
17679
|
}
|
|
17556
17680
|
const pos = particle.getPosition();
|
|
17557
17681
|
if (fillColorValue) {
|
|
17558
|
-
context.strokeStyle = getStyleFromHsl(fillColorValue, container.hdr, opacity);
|
|
17682
|
+
context.strokeStyle = getStyleFromHsl(fillColorValue, container.hdr, opacity, container.peakNits, container.hdrMode);
|
|
17559
17683
|
}
|
|
17560
17684
|
context.lineWidth = width;
|
|
17561
17685
|
const rotationRadian = degToRad(rotation);
|
|
@@ -17637,7 +17761,7 @@
|
|
|
17637
17761
|
}
|
|
17638
17762
|
|
|
17639
17763
|
async function loadOrbitUpdater(engine) {
|
|
17640
|
-
engine.checkVersion("4.
|
|
17764
|
+
engine.checkVersion("4.4.0");
|
|
17641
17765
|
await engine.pluginManager.register(e => {
|
|
17642
17766
|
e.pluginManager.addParticleUpdater("orbit", container => {
|
|
17643
17767
|
return Promise.resolve(new OrbitUpdater(e.pluginManager, container));
|
|
@@ -17677,7 +17801,7 @@
|
|
|
17677
17801
|
}
|
|
17678
17802
|
|
|
17679
17803
|
async function loadParticlesEffect(engine) {
|
|
17680
|
-
engine.checkVersion("4.
|
|
17804
|
+
engine.checkVersion("4.4.0");
|
|
17681
17805
|
await engine.pluginManager.register(e => {
|
|
17682
17806
|
e.pluginManager.addEffect("particles", container => {
|
|
17683
17807
|
return Promise.resolve(new ParticlesDrawer(container));
|
|
@@ -17769,7 +17893,7 @@
|
|
|
17769
17893
|
}
|
|
17770
17894
|
|
|
17771
17895
|
async function loadParticlesRepulseInteraction(engine) {
|
|
17772
|
-
engine.checkVersion("4.
|
|
17896
|
+
engine.checkVersion("4.4.0");
|
|
17773
17897
|
await engine.pluginManager.register((e) => {
|
|
17774
17898
|
ensureInteractivityPluginLoaded(e);
|
|
17775
17899
|
e.pluginManager.addInteractor?.("particlesRepulse", container => {
|
|
@@ -17796,7 +17920,7 @@
|
|
|
17796
17920
|
}
|
|
17797
17921
|
|
|
17798
17922
|
async function loadPathShape(engine) {
|
|
17799
|
-
engine.checkVersion("4.
|
|
17923
|
+
engine.checkVersion("4.4.0");
|
|
17800
17924
|
await engine.pluginManager.register(e => {
|
|
17801
17925
|
e.pluginManager.addShape(["path"], () => Promise.resolve(new PathDrawer()));
|
|
17802
17926
|
});
|
|
@@ -18200,7 +18324,7 @@
|
|
|
18200
18324
|
|
|
18201
18325
|
const perlinNoisePathName = "perlinNoise";
|
|
18202
18326
|
async function loadPerlinNoisePath(engine) {
|
|
18203
|
-
engine.checkVersion("4.
|
|
18327
|
+
engine.checkVersion("4.4.0");
|
|
18204
18328
|
await engine.pluginManager.register((e) => {
|
|
18205
18329
|
ensureBaseMoverLoaded(e);
|
|
18206
18330
|
e.pluginManager.addPathGenerator?.(perlinNoisePathName, container => {
|
|
@@ -18248,7 +18372,7 @@
|
|
|
18248
18372
|
}
|
|
18249
18373
|
|
|
18250
18374
|
async function loadPoissonDiscPlugin(engine) {
|
|
18251
|
-
engine.checkVersion("4.
|
|
18375
|
+
engine.checkVersion("4.4.0");
|
|
18252
18376
|
await engine.pluginManager.register(e => {
|
|
18253
18377
|
e.pluginManager.addPlugin(new PoissonDiscPlugin());
|
|
18254
18378
|
});
|
|
@@ -18435,7 +18559,7 @@
|
|
|
18435
18559
|
}
|
|
18436
18560
|
|
|
18437
18561
|
async function loadPolygonMaskPlugin(engine) {
|
|
18438
|
-
engine.checkVersion("4.
|
|
18562
|
+
engine.checkVersion("4.4.0");
|
|
18439
18563
|
await engine.pluginManager.register(e => {
|
|
18440
18564
|
e.pluginManager.addPlugin(new PolygonMaskPlugin(e.pluginManager));
|
|
18441
18565
|
});
|
|
@@ -18501,7 +18625,7 @@
|
|
|
18501
18625
|
|
|
18502
18626
|
const polygonPathName = "polygonPathGenerator";
|
|
18503
18627
|
async function loadPolygonPath(engine) {
|
|
18504
|
-
engine.checkVersion("4.
|
|
18628
|
+
engine.checkVersion("4.4.0");
|
|
18505
18629
|
await engine.pluginManager.register((e) => {
|
|
18506
18630
|
ensureBaseMoverLoaded(e);
|
|
18507
18631
|
e.pluginManager.addPathGenerator?.(polygonPathName, container => {
|
|
@@ -18531,7 +18655,7 @@
|
|
|
18531
18655
|
|
|
18532
18656
|
const randomPathName = "randomPathGenerator";
|
|
18533
18657
|
async function loadRandomPath(engine) {
|
|
18534
|
-
engine.checkVersion("4.
|
|
18658
|
+
engine.checkVersion("4.4.0");
|
|
18535
18659
|
await engine.pluginManager.register((e) => {
|
|
18536
18660
|
ensureBaseMoverLoaded(e);
|
|
18537
18661
|
e.pluginManager.addPathGenerator?.(randomPathName, () => {
|
|
@@ -18611,7 +18735,7 @@
|
|
|
18611
18735
|
}
|
|
18612
18736
|
|
|
18613
18737
|
async function loadResponsivePlugin(engine) {
|
|
18614
|
-
engine.checkVersion("4.
|
|
18738
|
+
engine.checkVersion("4.4.0");
|
|
18615
18739
|
await engine.pluginManager.register(e => {
|
|
18616
18740
|
e.pluginManager.addPlugin(new ResponsivePlugin());
|
|
18617
18741
|
});
|
|
@@ -18819,12 +18943,7 @@
|
|
|
18819
18943
|
context.fill();
|
|
18820
18944
|
}
|
|
18821
18945
|
}
|
|
18822
|
-
function
|
|
18823
|
-
const { context, particle, radius } = data, points = particle.ribbonPoints, offsets = particle.ribbonOffsets, bounds = particle.ribbonBounds, hasFill = data.fill, hasStroke = data.stroke;
|
|
18824
|
-
if (!points || !offsets || !bounds || points.length < minPointCount || (!hasFill && !hasStroke)) {
|
|
18825
|
-
return;
|
|
18826
|
-
}
|
|
18827
|
-
const drawOffsets = offsets.mult(radius), center = particle.position, frontFill = typeof context.fillStyle === "string" ? context.fillStyle : "", frontStroke = typeof context.strokeStyle === "string" ? context.strokeStyle : "", shapeData = particle.shapeData;
|
|
18946
|
+
function resolveBackFill(hasStroke, frontFill, frontStroke, shapeData, particle, hdr, peakNits, mode) {
|
|
18828
18947
|
let backFill = hasStroke ? frontStroke : frontFill;
|
|
18829
18948
|
if (shapeData?.backColor) {
|
|
18830
18949
|
backFill = shapeData.backColor;
|
|
@@ -18833,16 +18952,68 @@
|
|
|
18833
18952
|
const frontHsl = getHslFromAnimation(particle.fillColor);
|
|
18834
18953
|
if (frontHsl) {
|
|
18835
18954
|
const altered = alterHsl(frontHsl, exports.AlterType.darken, getRangeValue(shapeData.darken.value));
|
|
18836
|
-
backFill = getStyleFromHsl(altered, hdr);
|
|
18955
|
+
backFill = getStyleFromHsl(altered, hdr, undefined, peakNits, mode);
|
|
18837
18956
|
}
|
|
18838
18957
|
}
|
|
18839
18958
|
else if (shapeData?.enlighten?.enable) {
|
|
18840
18959
|
const frontHsl = getHslFromAnimation(particle.fillColor);
|
|
18841
18960
|
if (frontHsl) {
|
|
18842
18961
|
const altered = alterHsl(frontHsl, exports.AlterType.enlighten, getRangeValue(shapeData.enlighten.value));
|
|
18843
|
-
backFill = getStyleFromHsl(altered, hdr);
|
|
18962
|
+
backFill = getStyleFromHsl(altered, hdr, undefined, peakNits, mode);
|
|
18844
18963
|
}
|
|
18845
18964
|
}
|
|
18965
|
+
return backFill;
|
|
18966
|
+
}
|
|
18967
|
+
function drawEdgeSegments(context, currentBase, nextBase, currentSide, nextSide, isFirst, isLast, hasFill, hasStroke) {
|
|
18968
|
+
if (isFirst) {
|
|
18969
|
+
drawPolygonSegment(context, {
|
|
18970
|
+
a: currentBase,
|
|
18971
|
+
b: nextBase,
|
|
18972
|
+
c: getMidpoint(nextBase, nextSide),
|
|
18973
|
+
fill: hasFill,
|
|
18974
|
+
stroke: hasStroke,
|
|
18975
|
+
});
|
|
18976
|
+
drawPolygonSegment(context, {
|
|
18977
|
+
a: nextSide,
|
|
18978
|
+
b: currentSide,
|
|
18979
|
+
c: getMidpoint(nextBase, nextSide),
|
|
18980
|
+
fill: hasFill,
|
|
18981
|
+
stroke: hasStroke,
|
|
18982
|
+
});
|
|
18983
|
+
}
|
|
18984
|
+
else if (isLast) {
|
|
18985
|
+
drawPolygonSegment(context, {
|
|
18986
|
+
a: currentBase,
|
|
18987
|
+
b: nextBase,
|
|
18988
|
+
c: getMidpoint(currentBase, currentSide),
|
|
18989
|
+
fill: hasFill,
|
|
18990
|
+
stroke: hasStroke,
|
|
18991
|
+
});
|
|
18992
|
+
drawPolygonSegment(context, {
|
|
18993
|
+
a: nextSide,
|
|
18994
|
+
b: currentSide,
|
|
18995
|
+
c: getMidpoint(currentBase, currentSide),
|
|
18996
|
+
fill: hasFill,
|
|
18997
|
+
stroke: hasStroke,
|
|
18998
|
+
});
|
|
18999
|
+
}
|
|
19000
|
+
else {
|
|
19001
|
+
drawPolygonSegment(context, {
|
|
19002
|
+
a: currentBase,
|
|
19003
|
+
b: nextBase,
|
|
19004
|
+
c: nextSide,
|
|
19005
|
+
d: currentSide,
|
|
19006
|
+
fill: hasFill,
|
|
19007
|
+
stroke: hasStroke,
|
|
19008
|
+
});
|
|
19009
|
+
}
|
|
19010
|
+
}
|
|
19011
|
+
function drawRibbon(data, hdr, peakNits, mode) {
|
|
19012
|
+
const { context, particle, radius } = data, points = particle.ribbonPoints, offsets = particle.ribbonOffsets, bounds = particle.ribbonBounds, hasFill = data.fill, hasStroke = data.stroke;
|
|
19013
|
+
if (!points || !offsets || !bounds || points.length < minPointCount || (!hasFill && !hasStroke)) {
|
|
19014
|
+
return;
|
|
19015
|
+
}
|
|
19016
|
+
const drawOffsets = offsets.mult(radius), center = particle.position, frontFill = typeof context.fillStyle === "string" ? context.fillStyle : "", frontStroke = typeof context.strokeStyle === "string" ? context.strokeStyle : "", shapeData = particle.shapeData, backFill = resolveBackFill(hasStroke, frontFill, frontStroke, shapeData, particle, hdr, peakNits, mode);
|
|
18846
19017
|
context.lineWidth = lineWidth;
|
|
18847
19018
|
context.lineJoin = "round";
|
|
18848
19019
|
context.lineCap = "round";
|
|
@@ -18860,46 +19031,13 @@
|
|
|
18860
19031
|
context.strokeStyle = segmentStyle;
|
|
18861
19032
|
}
|
|
18862
19033
|
if (i === noPoint) {
|
|
18863
|
-
|
|
18864
|
-
a: currentBase,
|
|
18865
|
-
b: nextBase,
|
|
18866
|
-
c: getMidpoint(nextBase, nextSide),
|
|
18867
|
-
fill: hasFill,
|
|
18868
|
-
stroke: hasStroke,
|
|
18869
|
-
});
|
|
18870
|
-
drawPolygonSegment(context, {
|
|
18871
|
-
a: nextSide,
|
|
18872
|
-
b: currentSide,
|
|
18873
|
-
c: getMidpoint(nextBase, nextSide),
|
|
18874
|
-
fill: hasFill,
|
|
18875
|
-
stroke: hasStroke,
|
|
18876
|
-
});
|
|
19034
|
+
drawEdgeSegments(context, currentBase, nextBase, currentSide, nextSide, true, false, hasFill, hasStroke);
|
|
18877
19035
|
}
|
|
18878
19036
|
else if (i === points.length - secondPoint) {
|
|
18879
|
-
|
|
18880
|
-
a: currentBase,
|
|
18881
|
-
b: nextBase,
|
|
18882
|
-
c: getMidpoint(currentBase, currentSide),
|
|
18883
|
-
fill: hasFill,
|
|
18884
|
-
stroke: hasStroke,
|
|
18885
|
-
});
|
|
18886
|
-
drawPolygonSegment(context, {
|
|
18887
|
-
a: nextSide,
|
|
18888
|
-
b: currentSide,
|
|
18889
|
-
c: getMidpoint(currentBase, currentSide),
|
|
18890
|
-
fill: hasFill,
|
|
18891
|
-
stroke: hasStroke,
|
|
18892
|
-
});
|
|
19037
|
+
drawEdgeSegments(context, currentBase, nextBase, currentSide, nextSide, false, true, hasFill, hasStroke);
|
|
18893
19038
|
}
|
|
18894
19039
|
else {
|
|
18895
|
-
|
|
18896
|
-
a: currentBase,
|
|
18897
|
-
b: nextBase,
|
|
18898
|
-
c: nextSide,
|
|
18899
|
-
d: currentSide,
|
|
18900
|
-
fill: hasFill,
|
|
18901
|
-
stroke: hasStroke,
|
|
18902
|
-
});
|
|
19040
|
+
drawEdgeSegments(context, currentBase, nextBase, currentSide, nextSide, false, false, hasFill, hasStroke);
|
|
18903
19041
|
}
|
|
18904
19042
|
}
|
|
18905
19043
|
context.fillStyle = frontFill;
|
|
@@ -18947,7 +19085,7 @@
|
|
|
18947
19085
|
createRibbonState(data.particle);
|
|
18948
19086
|
}
|
|
18949
19087
|
updateRibbon(data);
|
|
18950
|
-
drawRibbon(data, this.#container.hdr);
|
|
19088
|
+
drawRibbon(data, this.#container.hdr, this.#container.peakNits, this.#container.hdrMode);
|
|
18951
19089
|
}
|
|
18952
19090
|
getSidesCount(particle) {
|
|
18953
19091
|
const pointsLen = particle.ribbonPoints?.length;
|
|
@@ -19009,7 +19147,7 @@
|
|
|
19009
19147
|
}
|
|
19010
19148
|
|
|
19011
19149
|
async function loadRibbonShape(engine) {
|
|
19012
|
-
engine.checkVersion("4.
|
|
19150
|
+
engine.checkVersion("4.4.0");
|
|
19013
19151
|
await engine.pluginManager.register(e => {
|
|
19014
19152
|
e.pluginManager.addShape(["ribbon"], (container) => Promise.resolve(new RibbonDrawer(container)));
|
|
19015
19153
|
});
|
|
@@ -19058,7 +19196,7 @@
|
|
|
19058
19196
|
}
|
|
19059
19197
|
|
|
19060
19198
|
async function loadRoundedPolygonShape(engine) {
|
|
19061
|
-
engine.checkVersion("4.
|
|
19199
|
+
engine.checkVersion("4.4.0");
|
|
19062
19200
|
await engine.pluginManager.register(e => {
|
|
19063
19201
|
e.pluginManager.addShape(["rounded-polygon"], () => Promise.resolve(new RoundedPolygonDrawer()));
|
|
19064
19202
|
});
|
|
@@ -19105,7 +19243,7 @@
|
|
|
19105
19243
|
}
|
|
19106
19244
|
|
|
19107
19245
|
async function loadRoundedRectShape(engine) {
|
|
19108
|
-
engine.checkVersion("4.
|
|
19246
|
+
engine.checkVersion("4.4.0");
|
|
19109
19247
|
await engine.pluginManager.register(e => {
|
|
19110
19248
|
e.pluginManager.addShape(["rounded-rect"], () => Promise.resolve(new RoundedRectDrawer()));
|
|
19111
19249
|
});
|
|
@@ -19263,7 +19401,7 @@
|
|
|
19263
19401
|
|
|
19264
19402
|
const svgPathName = "svgPathGenerator";
|
|
19265
19403
|
async function loadSVGPath(engine) {
|
|
19266
|
-
engine.checkVersion("4.
|
|
19404
|
+
engine.checkVersion("4.4.0");
|
|
19267
19405
|
await engine.pluginManager.register((e) => {
|
|
19268
19406
|
ensureBaseMoverLoaded(e);
|
|
19269
19407
|
e.pluginManager.addPathGenerator?.(svgPathName, container => {
|
|
@@ -19291,7 +19429,7 @@
|
|
|
19291
19429
|
}
|
|
19292
19430
|
context.save();
|
|
19293
19431
|
context.shadowBlur = shadowParticle.shadowBlur ?? defaultShadowBlur;
|
|
19294
|
-
context.shadowColor = getStyleFromRgb(shadowColor, container.hdr);
|
|
19432
|
+
context.shadowColor = getStyleFromRgb(shadowColor, container.hdr, undefined, container.peakNits, container.hdrMode);
|
|
19295
19433
|
context.shadowOffsetX = shadowOffset?.x ?? defaultShadowOffsetValue;
|
|
19296
19434
|
context.shadowOffsetY = shadowOffset?.y ?? defaultShadowOffsetValue;
|
|
19297
19435
|
}
|
|
@@ -19304,7 +19442,7 @@
|
|
|
19304
19442
|
}
|
|
19305
19443
|
|
|
19306
19444
|
async function loadShadowEffect(engine) {
|
|
19307
|
-
engine.checkVersion("4.
|
|
19445
|
+
engine.checkVersion("4.4.0");
|
|
19308
19446
|
await engine.pluginManager.register(e => {
|
|
19309
19447
|
e.pluginManager.addEffect("shadow", container => {
|
|
19310
19448
|
return Promise.resolve(new ShadowDrawer(e.pluginManager, container));
|
|
@@ -19326,7 +19464,7 @@
|
|
|
19326
19464
|
|
|
19327
19465
|
const simplexNoisePathName = "simplexNoise";
|
|
19328
19466
|
async function loadSimplexNoisePath(engine) {
|
|
19329
|
-
engine.checkVersion("4.
|
|
19467
|
+
engine.checkVersion("4.4.0");
|
|
19330
19468
|
await engine.pluginManager.register((e) => {
|
|
19331
19469
|
ensureBaseMoverLoaded(e);
|
|
19332
19470
|
e.pluginManager.addPathGenerator?.(simplexNoisePathName, container => {
|
|
@@ -19643,7 +19781,7 @@
|
|
|
19643
19781
|
}
|
|
19644
19782
|
|
|
19645
19783
|
async function loadSoundsPlugin(engine) {
|
|
19646
|
-
engine.checkVersion("4.
|
|
19784
|
+
engine.checkVersion("4.4.0");
|
|
19647
19785
|
await engine.pluginManager.register(e => {
|
|
19648
19786
|
e.pluginManager.addPlugin(new SoundsPlugin(e));
|
|
19649
19787
|
});
|
|
@@ -19712,7 +19850,7 @@
|
|
|
19712
19850
|
|
|
19713
19851
|
const spiralPathName = "spiralPathGenerator";
|
|
19714
19852
|
async function loadSpiralPath(engine) {
|
|
19715
|
-
engine.checkVersion("4.
|
|
19853
|
+
engine.checkVersion("4.4.0");
|
|
19716
19854
|
await engine.pluginManager.register((e) => {
|
|
19717
19855
|
ensureBaseMoverLoaded(e);
|
|
19718
19856
|
e.pluginManager.addPathGenerator?.(spiralPathName, container => {
|
|
@@ -19752,7 +19890,7 @@
|
|
|
19752
19890
|
}
|
|
19753
19891
|
|
|
19754
19892
|
async function loadSpiralShape(engine) {
|
|
19755
|
-
engine.checkVersion("4.
|
|
19893
|
+
engine.checkVersion("4.4.0");
|
|
19756
19894
|
await engine.pluginManager.register(e => {
|
|
19757
19895
|
e.pluginManager.addShape(["spiral"], () => Promise.resolve(new SpiralDrawer()));
|
|
19758
19896
|
});
|
|
@@ -19796,7 +19934,7 @@
|
|
|
19796
19934
|
}
|
|
19797
19935
|
|
|
19798
19936
|
async function loadSquircleShape(engine) {
|
|
19799
|
-
engine.checkVersion("4.
|
|
19937
|
+
engine.checkVersion("4.4.0");
|
|
19800
19938
|
await engine.pluginManager.register(e => {
|
|
19801
19939
|
e.pluginManager.addShape(["squircle"], () => Promise.resolve(new SquircleDrawer()));
|
|
19802
19940
|
});
|
|
@@ -19900,7 +20038,7 @@
|
|
|
19900
20038
|
}
|
|
19901
20039
|
|
|
19902
20040
|
async function loadThemesPlugin(engine) {
|
|
19903
|
-
engine.checkVersion("4.
|
|
20041
|
+
engine.checkVersion("4.4.0");
|
|
19904
20042
|
await engine.pluginManager.register(e => {
|
|
19905
20043
|
e.pluginManager.addPlugin(new ThemesPlugin());
|
|
19906
20044
|
});
|
|
@@ -20016,7 +20154,7 @@
|
|
|
20016
20154
|
}
|
|
20017
20155
|
|
|
20018
20156
|
async function loadTrailEffect(engine) {
|
|
20019
|
-
engine.checkVersion("4.
|
|
20157
|
+
engine.checkVersion("4.4.0");
|
|
20020
20158
|
await engine.pluginManager.register(e => {
|
|
20021
20159
|
e.pluginManager.addEffect("trail", container => {
|
|
20022
20160
|
return Promise.resolve(new TrailDrawer(container));
|
|
@@ -20080,7 +20218,7 @@
|
|
|
20080
20218
|
}
|
|
20081
20219
|
|
|
20082
20220
|
async function loadTrailPlugin(engine) {
|
|
20083
|
-
engine.checkVersion("4.
|
|
20221
|
+
engine.checkVersion("4.4.0");
|
|
20084
20222
|
await engine.pluginManager.register(e => {
|
|
20085
20223
|
e.pluginManager.addPlugin(new TrailPlugin(e.pluginManager));
|
|
20086
20224
|
});
|
|
@@ -20129,7 +20267,7 @@
|
|
|
20129
20267
|
|
|
20130
20268
|
const zigZagPathName = "zigZagPathGenerator";
|
|
20131
20269
|
async function loadZigZagPath(engine) {
|
|
20132
|
-
engine.checkVersion("4.
|
|
20270
|
+
engine.checkVersion("4.4.0");
|
|
20133
20271
|
await engine.pluginManager.register((e) => {
|
|
20134
20272
|
ensureBaseMoverLoaded(e);
|
|
20135
20273
|
e.pluginManager.addPathGenerator?.(zigZagPathName, container => {
|
|
@@ -20186,14 +20324,14 @@
|
|
|
20186
20324
|
}
|
|
20187
20325
|
|
|
20188
20326
|
async function loadZoomPlugin(engine) {
|
|
20189
|
-
engine.checkVersion("4.
|
|
20327
|
+
engine.checkVersion("4.4.0");
|
|
20190
20328
|
await engine.pluginManager.register(e => {
|
|
20191
20329
|
e.pluginManager.addPlugin(new ZoomPlugin());
|
|
20192
20330
|
});
|
|
20193
20331
|
}
|
|
20194
20332
|
|
|
20195
20333
|
async function loadAll(engine) {
|
|
20196
|
-
engine.checkVersion("4.
|
|
20334
|
+
engine.checkVersion("4.4.0");
|
|
20197
20335
|
await engine.pluginManager.register(async (e) => {
|
|
20198
20336
|
const loadInteractionsForAll = async (e) => {
|
|
20199
20337
|
await loadFull(e);
|
|
@@ -20405,7 +20543,11 @@
|
|
|
20405
20543
|
if (!fColor && !sColor) {
|
|
20406
20544
|
return;
|
|
20407
20545
|
}
|
|
20408
|
-
const container = this.#container, zIndexOptions = particle.options.zIndex, zIndexFactor = zIndexFactorOffset - particle.zIndexFactor, { fillOpacity, opacity, strokeOpacity } = particle.getOpacity(), transform = this.#reusableTransform, colorStyles = this.#reusableColorStyles, fill = fColor
|
|
20546
|
+
const container = this.#container, zIndexOptions = particle.options.zIndex, zIndexFactor = zIndexFactorOffset - particle.zIndexFactor, { fillOpacity, opacity, strokeOpacity } = particle.getOpacity(), transform = this.#reusableTransform, colorStyles = this.#reusableColorStyles, fill = fColor
|
|
20547
|
+
? getStyleFromHsl(fColor, container.hdr, fillOpacity * opacity, container.peakNits, container.hdrMode)
|
|
20548
|
+
: undefined, stroke = sColor
|
|
20549
|
+
? getStyleFromHsl(sColor, container.hdr, strokeOpacity * opacity, container.peakNits, container.hdrMode)
|
|
20550
|
+
: fill;
|
|
20409
20551
|
transform.a = transform.b = transform.c = transform.d = undefined;
|
|
20410
20552
|
colorStyles.fill = fill;
|
|
20411
20553
|
colorStyles.stroke = stroke;
|
|
@@ -20739,7 +20881,9 @@
|
|
|
20739
20881
|
if (typeof background.element === "string") {
|
|
20740
20882
|
if (typeof document !== "undefined") {
|
|
20741
20883
|
const node = document.querySelector(background.element);
|
|
20742
|
-
if (
|
|
20884
|
+
if ((typeof HTMLCanvasElement !== "undefined" && node instanceof HTMLCanvasElement) ||
|
|
20885
|
+
(typeof HTMLVideoElement !== "undefined" && node instanceof HTMLVideoElement) ||
|
|
20886
|
+
(typeof HTMLImageElement !== "undefined" && node instanceof HTMLImageElement)) {
|
|
20743
20887
|
this.#backgroundElement = node;
|
|
20744
20888
|
}
|
|
20745
20889
|
else if (node) {
|
|
@@ -20750,10 +20894,10 @@
|
|
|
20750
20894
|
}
|
|
20751
20895
|
}
|
|
20752
20896
|
}
|
|
20753
|
-
else if (background.element instanceof HTMLCanvasElement ||
|
|
20754
|
-
background.element instanceof OffscreenCanvas ||
|
|
20755
|
-
background.element instanceof HTMLVideoElement ||
|
|
20756
|
-
background.element instanceof HTMLImageElement) {
|
|
20897
|
+
else if ((typeof HTMLCanvasElement !== "undefined" && background.element instanceof HTMLCanvasElement) ||
|
|
20898
|
+
(typeof OffscreenCanvas !== "undefined" && background.element instanceof OffscreenCanvas) ||
|
|
20899
|
+
(typeof HTMLVideoElement !== "undefined" && background.element instanceof HTMLVideoElement) ||
|
|
20900
|
+
(typeof HTMLImageElement !== "undefined" && background.element instanceof HTMLImageElement)) {
|
|
20757
20901
|
this.#backgroundElement = background.element;
|
|
20758
20902
|
}
|
|
20759
20903
|
}
|
|
@@ -20821,6 +20965,7 @@
|
|
|
20821
20965
|
zoom = defaultZoom;
|
|
20822
20966
|
#container;
|
|
20823
20967
|
#generated;
|
|
20968
|
+
#hdrMediaListeners;
|
|
20824
20969
|
#mutationObserver;
|
|
20825
20970
|
#originalStyle;
|
|
20826
20971
|
#pluginManager;
|
|
@@ -20885,7 +21030,6 @@
|
|
|
20885
21030
|
});
|
|
20886
21031
|
this.resize();
|
|
20887
21032
|
this.#initStyle();
|
|
20888
|
-
this.initBackground();
|
|
20889
21033
|
this.#safeMutationObserver(obs => {
|
|
20890
21034
|
const element = this.domElement;
|
|
20891
21035
|
if (!element || !(element instanceof Node)) {
|
|
@@ -20895,6 +21039,8 @@
|
|
|
20895
21039
|
});
|
|
20896
21040
|
this.initPlugins();
|
|
20897
21041
|
this.#initContext();
|
|
21042
|
+
this.initBackground();
|
|
21043
|
+
this.#initHdrListeners();
|
|
20898
21044
|
this.render.init();
|
|
20899
21045
|
}
|
|
20900
21046
|
initBackground() {
|
|
@@ -20904,7 +21050,8 @@
|
|
|
20904
21050
|
}
|
|
20905
21051
|
const elementStyle = element.style, color = rangeColorToRgb(this.#pluginManager, background.color);
|
|
20906
21052
|
if (color) {
|
|
20907
|
-
|
|
21053
|
+
const hdrOptions = container.actualOptions.hdr;
|
|
21054
|
+
elementStyle.backgroundColor = getStyleFromRgb(color, container.hdr, background.opacity, hdrOptions.peakNits, hdrOptions.mode);
|
|
20908
21055
|
}
|
|
20909
21056
|
else {
|
|
20910
21057
|
elementStyle.backgroundColor = "";
|
|
@@ -21001,6 +21148,7 @@
|
|
|
21001
21148
|
obs.disconnect();
|
|
21002
21149
|
});
|
|
21003
21150
|
this.#mutationObserver = undefined;
|
|
21151
|
+
this.#removeHdrListeners();
|
|
21004
21152
|
this.render.stop();
|
|
21005
21153
|
}
|
|
21006
21154
|
async windowResize() {
|
|
@@ -21020,9 +21168,16 @@
|
|
|
21020
21168
|
}
|
|
21021
21169
|
}
|
|
21022
21170
|
#initContext() {
|
|
21023
|
-
const container = this.#container, canSupportHdr = container.actualOptions.hdr &&
|
|
21171
|
+
const container = this.#container, canSupportHdr = container.actualOptions.hdr.enable &&
|
|
21024
21172
|
safeMatchMedia("(color-gamut: p3)")?.matches &&
|
|
21025
21173
|
safeMatchMedia("(dynamic-range: high)")?.matches;
|
|
21174
|
+
container.hdr = canSupportHdr ?? false;
|
|
21175
|
+
container.hdrMode = container.actualOptions.hdr.mode;
|
|
21176
|
+
container.peakNits = container.actualOptions.hdr.peakNits;
|
|
21177
|
+
const renderCanvas = this.renderCanvas;
|
|
21178
|
+
if (!renderCanvas) {
|
|
21179
|
+
return;
|
|
21180
|
+
}
|
|
21026
21181
|
this.render.setContextSettings({
|
|
21027
21182
|
alpha: true,
|
|
21028
21183
|
desynchronized: true,
|
|
@@ -21031,11 +21186,47 @@
|
|
|
21031
21186
|
? { colorSpace: "display-p3", colorType: "float16" }
|
|
21032
21187
|
: { colorSpace: "srgb" }),
|
|
21033
21188
|
});
|
|
21034
|
-
|
|
21035
|
-
|
|
21036
|
-
|
|
21189
|
+
let context;
|
|
21190
|
+
try {
|
|
21191
|
+
context = renderCanvas.getContext("2d", this.render.settings);
|
|
21192
|
+
}
|
|
21193
|
+
catch {
|
|
21194
|
+
context = null;
|
|
21195
|
+
}
|
|
21196
|
+
if (canSupportHdr && !context) {
|
|
21197
|
+
container.hdr = false;
|
|
21198
|
+
const sdrSettings = {
|
|
21199
|
+
alpha: true,
|
|
21200
|
+
desynchronized: true,
|
|
21201
|
+
willReadFrequently: false,
|
|
21202
|
+
colorSpace: "srgb",
|
|
21203
|
+
};
|
|
21204
|
+
this.render.setContextSettings(sdrSettings);
|
|
21205
|
+
try {
|
|
21206
|
+
context = renderCanvas.getContext("2d", sdrSettings);
|
|
21207
|
+
}
|
|
21208
|
+
catch {
|
|
21209
|
+
context = null;
|
|
21210
|
+
}
|
|
21211
|
+
}
|
|
21212
|
+
this.render.setContext(context);
|
|
21213
|
+
}
|
|
21214
|
+
#initHdrListeners() {
|
|
21215
|
+
this.#removeHdrListeners();
|
|
21216
|
+
const p3Query = safeMatchMedia("(color-gamut: p3)"), hdrQuery = safeMatchMedia("(dynamic-range: high)"), handleChange = () => {
|
|
21217
|
+
this.#recreateRenderCanvas();
|
|
21218
|
+
this.#initContext();
|
|
21219
|
+
this.initBackground();
|
|
21220
|
+
}, listeners = [];
|
|
21221
|
+
if (p3Query) {
|
|
21222
|
+
p3Query.addEventListener("change", handleChange);
|
|
21223
|
+
listeners.push({ handler: handleChange, mql: p3Query });
|
|
21224
|
+
}
|
|
21225
|
+
if (hdrQuery) {
|
|
21226
|
+
hdrQuery.addEventListener("change", handleChange);
|
|
21227
|
+
listeners.push({ handler: handleChange, mql: hdrQuery });
|
|
21037
21228
|
}
|
|
21038
|
-
this
|
|
21229
|
+
this.#hdrMediaListeners = listeners;
|
|
21039
21230
|
}
|
|
21040
21231
|
#initStyle() {
|
|
21041
21232
|
const element = this.domElement, options = this.#container.actualOptions;
|
|
@@ -21059,6 +21250,25 @@
|
|
|
21059
21250
|
element.style.setProperty(key, value, "important");
|
|
21060
21251
|
}
|
|
21061
21252
|
}
|
|
21253
|
+
#recreateRenderCanvas() {
|
|
21254
|
+
const renderCanvas = this.renderCanvas;
|
|
21255
|
+
if (!renderCanvas) {
|
|
21256
|
+
return;
|
|
21257
|
+
}
|
|
21258
|
+
if (this.domElement) {
|
|
21259
|
+
return;
|
|
21260
|
+
}
|
|
21261
|
+
this.renderCanvas = new OffscreenCanvas(renderCanvas.width, renderCanvas.height);
|
|
21262
|
+
}
|
|
21263
|
+
#removeHdrListeners() {
|
|
21264
|
+
if (!this.#hdrMediaListeners) {
|
|
21265
|
+
return;
|
|
21266
|
+
}
|
|
21267
|
+
for (const { handler, mql } of this.#hdrMediaListeners) {
|
|
21268
|
+
mql.removeEventListener("change", handler);
|
|
21269
|
+
}
|
|
21270
|
+
this.#hdrMediaListeners = undefined;
|
|
21271
|
+
}
|
|
21062
21272
|
#repairStyle() {
|
|
21063
21273
|
const element = this.domElement;
|
|
21064
21274
|
if (!element) {
|
|
@@ -21443,9 +21653,9 @@
|
|
|
21443
21653
|
}
|
|
21444
21654
|
getOpacity() {
|
|
21445
21655
|
const zIndexOptions = this.options.zIndex, zIndexFactor = zIndexFactorOffset - this.zIndexFactor, zOpacityFactor = zIndexFactor ** zIndexOptions.opacityRate, baseOpacity = getRangeValue(this.opacity?.value ?? defaultOpacity$3), modifierOpacity = this.#applyModifiers(undefined, m => m.opacity), opacity = modifierOpacity ?? baseOpacity, fillOpacity = this.fillOpacity ?? defaultOpacity$3, strokeOpacity = this.strokeOpacity ?? defaultOpacity$3;
|
|
21446
|
-
this.#cachedOpacityData.fillOpacity =
|
|
21656
|
+
this.#cachedOpacityData.fillOpacity = fillOpacity;
|
|
21447
21657
|
this.#cachedOpacityData.opacity = opacity * zOpacityFactor;
|
|
21448
|
-
this.#cachedOpacityData.strokeOpacity =
|
|
21658
|
+
this.#cachedOpacityData.strokeOpacity = strokeOpacity;
|
|
21449
21659
|
return this.#cachedOpacityData;
|
|
21450
21660
|
}
|
|
21451
21661
|
getPosition() {
|
|
@@ -22300,6 +22510,7 @@
|
|
|
22300
22510
|
effectDrawers;
|
|
22301
22511
|
fpsLimit;
|
|
22302
22512
|
hdr;
|
|
22513
|
+
hdrMode;
|
|
22303
22514
|
id;
|
|
22304
22515
|
pageHidden;
|
|
22305
22516
|
particleCreatedPlugins;
|
|
@@ -22307,6 +22518,7 @@
|
|
|
22307
22518
|
particlePositionPlugins;
|
|
22308
22519
|
particleUpdaters;
|
|
22309
22520
|
particles;
|
|
22521
|
+
peakNits;
|
|
22310
22522
|
plugins;
|
|
22311
22523
|
retina;
|
|
22312
22524
|
shapeDrawers;
|
|
@@ -22337,6 +22549,8 @@
|
|
|
22337
22549
|
this.id = Symbol(id);
|
|
22338
22550
|
this.fpsLimit = 120;
|
|
22339
22551
|
this.hdr = false;
|
|
22552
|
+
this.hdrMode = exports.HdrMode.standard;
|
|
22553
|
+
this.peakNits = 400;
|
|
22340
22554
|
this.#smooth = false;
|
|
22341
22555
|
this.#delay = 0;
|
|
22342
22556
|
this.#duration = 0;
|
|
@@ -22476,8 +22690,9 @@
|
|
|
22476
22690
|
this.updateActualOptions();
|
|
22477
22691
|
this.canvas.initBackground();
|
|
22478
22692
|
this.canvas.resize();
|
|
22479
|
-
const { delay, duration, fpsLimit,
|
|
22480
|
-
this.
|
|
22693
|
+
const { delay, duration, fpsLimit, smooth, zLayers } = this.actualOptions, hdrOptions = this.actualOptions.hdr;
|
|
22694
|
+
this.hdrMode = hdrOptions.mode;
|
|
22695
|
+
this.peakNits = hdrOptions.peakNits;
|
|
22481
22696
|
this.zLayers = zLayers;
|
|
22482
22697
|
this.#duration = getRangeValue(duration) * millisecondsToSeconds$1;
|
|
22483
22698
|
this.#delay = getRangeValue(delay) * millisecondsToSeconds$1;
|
|
@@ -22738,7 +22953,7 @@
|
|
|
22738
22953
|
...coverRgb,
|
|
22739
22954
|
a: cover.opacity,
|
|
22740
22955
|
};
|
|
22741
|
-
this.#coverColorStyle = getStyleFromRgb(coverColor, this.#container.hdr, coverColor.a);
|
|
22956
|
+
this.#coverColorStyle = getStyleFromRgb(coverColor, this.#container.hdr, coverColor.a, this.#container.peakNits, this.#container.hdrMode);
|
|
22742
22957
|
}
|
|
22743
22958
|
}
|
|
22744
22959
|
else if (cover?.image) {
|
|
@@ -24320,10 +24535,10 @@
|
|
|
24320
24535
|
}
|
|
24321
24536
|
}
|
|
24322
24537
|
#getCachedStyle(rgb) {
|
|
24323
|
-
const key = `${rgb.r},${rgb.g},${rgb.b}`;
|
|
24538
|
+
const key = `${rgb.r},${rgb.g},${rgb.b}-${this.#container.hdr}-${this.#container.peakNits}-${this.#container.hdrMode}`;
|
|
24324
24539
|
let style = this.#colorCache.get(key);
|
|
24325
24540
|
if (!style) {
|
|
24326
|
-
style = getStyleFromRgb(rgb, this.#container.hdr);
|
|
24541
|
+
style = getStyleFromRgb(rgb, this.#container.hdr, undefined, this.#container.peakNits, this.#container.hdrMode);
|
|
24327
24542
|
this.#colorCache.set(key, style);
|
|
24328
24543
|
}
|
|
24329
24544
|
return style;
|
|
@@ -26112,7 +26327,7 @@
|
|
|
26112
26327
|
min: 0,
|
|
26113
26328
|
max: 1,
|
|
26114
26329
|
};
|
|
26115
|
-
function drawPolygonMask(pluginManager, context, rawData, stroke, hdr = false) {
|
|
26330
|
+
function drawPolygonMask(pluginManager, context, rawData, stroke, hdr = false, peakNits, mode) {
|
|
26116
26331
|
const color = rangeColorToRgb(pluginManager, stroke.color);
|
|
26117
26332
|
if (!color) {
|
|
26118
26333
|
return;
|
|
@@ -26127,11 +26342,11 @@
|
|
|
26127
26342
|
context.lineTo(item.x, item.y);
|
|
26128
26343
|
}
|
|
26129
26344
|
context.closePath();
|
|
26130
|
-
context.strokeStyle = getStyleFromRgb(color, hdr);
|
|
26345
|
+
context.strokeStyle = getStyleFromRgb(color, hdr, undefined, peakNits, mode);
|
|
26131
26346
|
context.lineWidth = stroke.width;
|
|
26132
26347
|
context.stroke();
|
|
26133
26348
|
}
|
|
26134
|
-
function drawPolygonMaskPath(pluginManager, context, path, stroke, position, hdr = false) {
|
|
26349
|
+
function drawPolygonMaskPath(pluginManager, context, path, stroke, position, hdr = false, peakNits, mode) {
|
|
26135
26350
|
const defaultTransform = {
|
|
26136
26351
|
a: 1,
|
|
26137
26352
|
b: 0,
|
|
@@ -26143,7 +26358,7 @@
|
|
|
26143
26358
|
if (!color) {
|
|
26144
26359
|
return;
|
|
26145
26360
|
}
|
|
26146
|
-
context.strokeStyle = getStyleFromRgb(color, hdr, stroke.opacity);
|
|
26361
|
+
context.strokeStyle = getStyleFromRgb(color, hdr, stroke.opacity, peakNits, mode);
|
|
26147
26362
|
context.lineWidth = stroke.width;
|
|
26148
26363
|
context.stroke(path);
|
|
26149
26364
|
context.resetTransform();
|
|
@@ -26274,10 +26489,10 @@
|
|
|
26274
26489
|
for (const path of this.paths) {
|
|
26275
26490
|
const path2d = path.path2d;
|
|
26276
26491
|
if (path2d && this.offset) {
|
|
26277
|
-
drawPolygonMaskPath(this.#pluginManager, context, path2d, polygonDraw.stroke, this.offset, this.#container.hdr);
|
|
26492
|
+
drawPolygonMaskPath(this.#pluginManager, context, path2d, polygonDraw.stroke, this.offset, this.#container.hdr, this.#container.peakNits, this.#container.hdrMode);
|
|
26278
26493
|
}
|
|
26279
26494
|
else if (rawData) {
|
|
26280
|
-
drawPolygonMask(this.#pluginManager, context, rawData, polygonDraw.stroke, this.#container.hdr);
|
|
26495
|
+
drawPolygonMask(this.#pluginManager, context, rawData, polygonDraw.stroke, this.#container.hdr, this.#container.peakNits, this.#container.hdrMode);
|
|
26281
26496
|
}
|
|
26282
26497
|
}
|
|
26283
26498
|
}
|
|
@@ -27195,7 +27410,7 @@
|
|
|
27195
27410
|
let handled = false;
|
|
27196
27411
|
const canvas = container.canvas;
|
|
27197
27412
|
if (trailFill.color) {
|
|
27198
|
-
canvas.render.paintBase(getStyleFromRgb(trailFill.color, container.hdr, trailFill.opacity));
|
|
27413
|
+
canvas.render.paintBase(getStyleFromRgb(trailFill.color, container.hdr, trailFill.opacity, container.peakNits, container.hdrMode));
|
|
27199
27414
|
handled = true;
|
|
27200
27415
|
}
|
|
27201
27416
|
else if (trailFill.image) {
|
|
@@ -27942,7 +28157,7 @@
|
|
|
27942
28157
|
context.beginPath();
|
|
27943
28158
|
context.arc(originPoint.x, originPoint.y, this.size, minAngle, maxAngle, false);
|
|
27944
28159
|
context.closePath();
|
|
27945
|
-
context.fillStyle = getStyleFromRgb(this.color, this.#container.hdr, this.opacity);
|
|
28160
|
+
context.fillStyle = getStyleFromRgb(this.color, this.#container.hdr, this.opacity, this.#container.peakNits, this.#container.hdrMode);
|
|
27946
28161
|
context.fill();
|
|
27947
28162
|
}
|
|
27948
28163
|
resize() {
|
|
@@ -28240,6 +28455,7 @@
|
|
|
28240
28455
|
exports.ColorAnimation = ColorAnimation;
|
|
28241
28456
|
exports.Fill = Fill;
|
|
28242
28457
|
exports.FullScreen = FullScreen;
|
|
28458
|
+
exports.HDROptions = HDROptions;
|
|
28243
28459
|
exports.HslAnimation = HslAnimation;
|
|
28244
28460
|
exports.Move = Move;
|
|
28245
28461
|
exports.MoveAngle = MoveAngle;
|