@tsparticles/updater-color 3.9.0 → 4.0.0-alpha.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/517.min.js +2 -0
- package/517.min.js.LICENSE.txt +1 -0
- package/browser/ColorUpdater.js +1 -1
- package/browser/index.js +8 -6
- package/cjs/ColorUpdater.js +6 -10
- package/cjs/index.js +8 -9
- package/dist_browser_ColorUpdater_js.js +30 -0
- package/esm/ColorUpdater.js +1 -1
- package/esm/index.js +8 -6
- package/package.json +4 -3
- package/report.html +5 -4
- package/tsparticles.updater.color.js +209 -30
- package/tsparticles.updater.color.min.js +1 -1
- package/tsparticles.updater.color.min.js.LICENSE.txt +1 -1
- package/types/ColorUpdater.d.ts +1 -1
- package/types/index.d.ts +1 -1
- package/umd/ColorUpdater.js +1 -1
- package/umd/index.js +43 -7
package/517.min.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see 517.min.js.LICENSE.txt */
|
|
2
|
+
(this.webpackChunk_tsparticles_updater_color=this.webpackChunk_tsparticles_updater_color||[]).push([[517],{517(o,e,t){t.d(e,{ColorUpdater:()=>i});var n=t(303);class i{constructor(o,e){this._container=e,this._engine=o}init(o){const e=(0,n.rangeColorToHsl)(this._engine,o.options.color,o.id,o.options.reduceDuplicates);e&&(o.color=(0,n.getHslAnimationFromHsl)(e,o.options.color.animation,this._container.retina.reduceFactor))}isEnabled(o){const{h:e,s:t,l:n}=o.options.color.animation,{color:i}=o;return!o.destroyed&&!o.spawning&&(void 0!==i?.h.value&&e.enable||void 0!==i?.s.value&&t.enable||void 0!==i?.l.value&&n.enable)}update(o,e){(0,n.updateColor)(o.color,e)}}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! tsParticles Color Updater v4.0.0-alpha.0 by Matteo Bruni */
|
package/browser/ColorUpdater.js
CHANGED
package/browser/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
engine.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
export function loadColorUpdater(engine) {
|
|
2
|
+
engine.checkVersion("4.0.0-alpha.0");
|
|
3
|
+
engine.register(e => {
|
|
4
|
+
e.addParticleUpdater("color", async (container) => {
|
|
5
|
+
const { ColorUpdater } = await import("./ColorUpdater.js");
|
|
6
|
+
return new ColorUpdater(e, container);
|
|
7
|
+
});
|
|
8
|
+
});
|
|
7
9
|
}
|
package/cjs/ColorUpdater.js
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const engine_1 = require("@tsparticles/engine");
|
|
5
|
-
class ColorUpdater {
|
|
6
|
-
constructor(container, engine) {
|
|
1
|
+
import { getHslAnimationFromHsl, rangeColorToHsl, updateColor, } from "@tsparticles/engine";
|
|
2
|
+
export class ColorUpdater {
|
|
3
|
+
constructor(engine, container) {
|
|
7
4
|
this._container = container;
|
|
8
5
|
this._engine = engine;
|
|
9
6
|
}
|
|
10
7
|
init(particle) {
|
|
11
|
-
const hslColor =
|
|
8
|
+
const hslColor = rangeColorToHsl(this._engine, particle.options.color, particle.id, particle.options.reduceDuplicates);
|
|
12
9
|
if (hslColor) {
|
|
13
|
-
particle.color =
|
|
10
|
+
particle.color = getHslAnimationFromHsl(hslColor, particle.options.color.animation, this._container.retina.reduceFactor);
|
|
14
11
|
}
|
|
15
12
|
}
|
|
16
13
|
isEnabled(particle) {
|
|
@@ -22,7 +19,6 @@ class ColorUpdater {
|
|
|
22
19
|
(color?.l.value !== undefined && lAnimation.enable)));
|
|
23
20
|
}
|
|
24
21
|
update(particle, delta) {
|
|
25
|
-
|
|
22
|
+
updateColor(particle.color, delta);
|
|
26
23
|
}
|
|
27
24
|
}
|
|
28
|
-
exports.ColorUpdater = ColorUpdater;
|
package/cjs/index.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}, refresh);
|
|
1
|
+
export function loadColorUpdater(engine) {
|
|
2
|
+
engine.checkVersion("4.0.0-alpha.0");
|
|
3
|
+
engine.register(e => {
|
|
4
|
+
e.addParticleUpdater("color", async (container) => {
|
|
5
|
+
const { ColorUpdater } = await import("./ColorUpdater.js");
|
|
6
|
+
return new ColorUpdater(e, container);
|
|
7
|
+
});
|
|
8
|
+
});
|
|
10
9
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Author : Matteo Bruni
|
|
3
|
+
* MIT license: https://opensource.org/licenses/MIT
|
|
4
|
+
* Demo / Generator : https://particles.js.org/
|
|
5
|
+
* GitHub : https://www.github.com/matteobruni/tsparticles
|
|
6
|
+
* How to use? : Check the GitHub README
|
|
7
|
+
* v4.0.0-alpha.0
|
|
8
|
+
*/
|
|
9
|
+
"use strict";
|
|
10
|
+
/*
|
|
11
|
+
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
12
|
+
* This devtool is neither made for production nor for readable output files.
|
|
13
|
+
* It uses "eval()" calls to create a separate source file in the browser devtools.
|
|
14
|
+
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
|
|
15
|
+
* or disable the default devtool with "devtool: false".
|
|
16
|
+
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
|
|
17
|
+
*/
|
|
18
|
+
(this["webpackChunk_tsparticles_updater_color"] = this["webpackChunk_tsparticles_updater_color"] || []).push([["dist_browser_ColorUpdater_js"],{
|
|
19
|
+
|
|
20
|
+
/***/ "./dist/browser/ColorUpdater.js"
|
|
21
|
+
/*!**************************************!*\
|
|
22
|
+
!*** ./dist/browser/ColorUpdater.js ***!
|
|
23
|
+
\**************************************/
|
|
24
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
25
|
+
|
|
26
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ColorUpdater: () => (/* binding */ ColorUpdater)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nclass ColorUpdater {\n constructor(engine, container) {\n this._container = container;\n this._engine = engine;\n }\n init(particle) {\n const hslColor = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.rangeColorToHsl)(this._engine, particle.options.color, particle.id, particle.options.reduceDuplicates);\n if (hslColor) {\n particle.color = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getHslAnimationFromHsl)(hslColor, particle.options.color.animation, this._container.retina.reduceFactor);\n }\n }\n isEnabled(particle) {\n const {\n h: hAnimation,\n s: sAnimation,\n l: lAnimation\n } = particle.options.color.animation,\n {\n color\n } = particle;\n return !particle.destroyed && !particle.spawning && (color?.h.value !== undefined && hAnimation.enable || color?.s.value !== undefined && sAnimation.enable || color?.l.value !== undefined && lAnimation.enable);\n }\n update(particle, delta) {\n (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.updateColor)(particle.color, delta);\n }\n}\n\n//# sourceURL=webpack://@tsparticles/updater-color/./dist/browser/ColorUpdater.js?\n}");
|
|
27
|
+
|
|
28
|
+
/***/ }
|
|
29
|
+
|
|
30
|
+
}]);
|
package/esm/ColorUpdater.js
CHANGED
package/esm/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
engine.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
export function loadColorUpdater(engine) {
|
|
2
|
+
engine.checkVersion("4.0.0-alpha.0");
|
|
3
|
+
engine.register(e => {
|
|
4
|
+
e.addParticleUpdater("color", async (container) => {
|
|
5
|
+
const { ColorUpdater } = await import("./ColorUpdater.js");
|
|
6
|
+
return new ColorUpdater(e, container);
|
|
7
|
+
});
|
|
8
|
+
});
|
|
7
9
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/updater-color",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-alpha.0",
|
|
4
4
|
"description": "tsParticles particles color updater",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -87,9 +87,10 @@
|
|
|
87
87
|
"./package.json": "./package.json"
|
|
88
88
|
},
|
|
89
89
|
"dependencies": {
|
|
90
|
-
"@tsparticles/engine": "
|
|
90
|
+
"@tsparticles/engine": "4.0.0-alpha.0"
|
|
91
91
|
},
|
|
92
92
|
"publishConfig": {
|
|
93
93
|
"access": "public"
|
|
94
|
-
}
|
|
94
|
+
},
|
|
95
|
+
"type": "module"
|
|
95
96
|
}
|