@tsparticles/plugin-named-color 3.9.1 → 4.0.0-alpha.1

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.
@@ -4,7 +4,7 @@
4
4
  * Demo / Generator : https://particles.js.org/
5
5
  * GitHub : https://www.github.com/matteobruni/tsparticles
6
6
  * How to use? : Check the GitHub README
7
- * v3.9.1
7
+ * v4.0.0-alpha.1
8
8
  */
9
9
  /*
10
10
  * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
@@ -28,35 +28,25 @@ return /******/ (() => { // webpackBootstrap
28
28
  /******/ "use strict";
29
29
  /******/ var __webpack_modules__ = ({
30
30
 
31
- /***/ "./dist/browser/NamedColorManager.js":
32
- /*!*******************************************!*\
33
- !*** ./dist/browser/NamedColorManager.js ***!
34
- \*******************************************/
35
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
36
-
37
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ NamedColorManager: () => (/* binding */ NamedColorManager)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n\nconst namedColors = new Map([[\"aliceblue\", {\n r: 240,\n g: 248,\n b: 255\n}], [\"antiquewhite\", {\n r: 250,\n g: 235,\n b: 215\n}], [\"aqua\", {\n r: 0,\n g: 255,\n b: 255\n}], [\"aquamarine\", {\n r: 127,\n g: 255,\n b: 212\n}], [\"azure\", {\n r: 240,\n g: 255,\n b: 255\n}], [\"beige\", {\n r: 245,\n g: 245,\n b: 220\n}], [\"bisque\", {\n r: 255,\n g: 228,\n b: 196\n}], [\"black\", {\n r: 0,\n g: 0,\n b: 0\n}], [\"blanchedalmond\", {\n r: 255,\n g: 235,\n b: 205\n}], [\"blue\", {\n r: 0,\n g: 0,\n b: 255\n}], [\"blueviolet\", {\n r: 138,\n g: 43,\n b: 226\n}], [\"brown\", {\n r: 165,\n g: 42,\n b: 42\n}], [\"burlywood\", {\n r: 222,\n g: 184,\n b: 135\n}], [\"cadetblue\", {\n r: 95,\n g: 158,\n b: 160\n}], [\"chartreuse\", {\n r: 127,\n g: 255,\n b: 0\n}], [\"chocolate\", {\n r: 210,\n g: 105,\n b: 30\n}], [\"coral\", {\n r: 255,\n g: 127,\n b: 80\n}], [\"cornflowerblue\", {\n r: 100,\n g: 149,\n b: 237\n}], [\"cornsilk\", {\n r: 255,\n g: 248,\n b: 220\n}], [\"crimson\", {\n r: 220,\n g: 20,\n b: 60\n}], [\"cyan\", {\n r: 0,\n g: 255,\n b: 255\n}], [\"darkblue\", {\n r: 0,\n g: 0,\n b: 139\n}], [\"darkcyan\", {\n r: 0,\n g: 139,\n b: 139\n}], [\"darkgoldenrod\", {\n r: 184,\n g: 134,\n b: 11\n}], [\"darkgray\", {\n r: 169,\n g: 169,\n b: 169\n}], [\"darkgreen\", {\n r: 0,\n g: 100,\n b: 0\n}], [\"darkgrey\", {\n r: 169,\n g: 169,\n b: 169\n}], [\"darkkhaki\", {\n r: 189,\n g: 183,\n b: 107\n}], [\"darkmagenta\", {\n r: 139,\n g: 0,\n b: 139\n}], [\"darkolivegreen\", {\n r: 85,\n g: 107,\n b: 47\n}], [\"darkorange\", {\n r: 255,\n g: 140,\n b: 0\n}], [\"darkorchid\", {\n r: 153,\n g: 50,\n b: 204\n}], [\"darkred\", {\n r: 139,\n g: 0,\n b: 0\n}], [\"darksalmon\", {\n r: 233,\n g: 150,\n b: 122\n}], [\"darkseagreen\", {\n r: 143,\n g: 188,\n b: 143\n}], [\"darkslateblue\", {\n r: 72,\n g: 61,\n b: 139\n}], [\"darkslategray\", {\n r: 47,\n g: 79,\n b: 79\n}], [\"darkslategrey\", {\n r: 47,\n g: 79,\n b: 79\n}], [\"darkturquoise\", {\n r: 0,\n g: 206,\n b: 209\n}], [\"darkviolet\", {\n r: 148,\n g: 0,\n b: 211\n}], [\"deeppink\", {\n r: 255,\n g: 20,\n b: 147\n}], [\"deepskyblue\", {\n r: 0,\n g: 191,\n b: 255\n}], [\"dimgray\", {\n r: 105,\n g: 105,\n b: 105\n}], [\"dimgrey\", {\n r: 105,\n g: 105,\n b: 105\n}], [\"dodgerblue\", {\n r: 30,\n g: 144,\n b: 255\n}], [\"firebrick\", {\n r: 178,\n g: 34,\n b: 34\n}], [\"floralwhite\", {\n r: 255,\n g: 250,\n b: 240\n}], [\"forestgreen\", {\n r: 34,\n g: 139,\n b: 34\n}], [\"fuchsia\", {\n r: 255,\n g: 0,\n b: 255\n}], [\"gainsboro\", {\n r: 220,\n g: 220,\n b: 220\n}], [\"ghostwhite\", {\n r: 248,\n g: 248,\n b: 255\n}], [\"gold\", {\n r: 255,\n g: 215,\n b: 0\n}], [\"goldenrod\", {\n r: 218,\n g: 165,\n b: 32\n}], [\"gray\", {\n r: 128,\n g: 128,\n b: 128\n}], [\"green\", {\n r: 0,\n g: 128,\n b: 0\n}], [\"greenyellow\", {\n r: 173,\n g: 255,\n b: 47\n}], [\"grey\", {\n r: 128,\n g: 128,\n b: 128\n}], [\"honeydew\", {\n r: 240,\n g: 255,\n b: 240\n}], [\"hotpink\", {\n r: 255,\n g: 105,\n b: 180\n}], [\"indianred\", {\n r: 205,\n g: 92,\n b: 92\n}], [\"indigo\", {\n r: 75,\n g: 0,\n b: 130\n}], [\"ivory\", {\n r: 255,\n g: 255,\n b: 240\n}], [\"khaki\", {\n r: 240,\n g: 230,\n b: 140\n}], [\"lavender\", {\n r: 230,\n g: 230,\n b: 250\n}], [\"lavenderblush\", {\n r: 255,\n g: 240,\n b: 245\n}], [\"lawngreen\", {\n r: 124,\n g: 252,\n b: 0\n}], [\"lemonchiffon\", {\n r: 255,\n g: 250,\n b: 205\n}], [\"lightblue\", {\n r: 173,\n g: 216,\n b: 230\n}], [\"lightcoral\", {\n r: 240,\n g: 128,\n b: 128\n}], [\"lightcyan\", {\n r: 224,\n g: 255,\n b: 255\n}], [\"lightgoldenrodyellow\", {\n r: 250,\n g: 250,\n b: 210\n}], [\"lightgray\", {\n r: 211,\n g: 211,\n b: 211\n}], [\"lightgreen\", {\n r: 144,\n g: 238,\n b: 144\n}], [\"lightgrey\", {\n r: 211,\n g: 211,\n b: 211\n}], [\"lightpink\", {\n r: 255,\n g: 182,\n b: 193\n}], [\"lightsalmon\", {\n r: 255,\n g: 160,\n b: 122\n}], [\"lightseagreen\", {\n r: 32,\n g: 178,\n b: 170\n}], [\"lightskyblue\", {\n r: 135,\n g: 206,\n b: 250\n}], [\"lightslategray\", {\n r: 119,\n g: 136,\n b: 153\n}], [\"lightslategrey\", {\n r: 119,\n g: 136,\n b: 153\n}], [\"lightsteelblue\", {\n r: 176,\n g: 196,\n b: 222\n}], [\"lightyellow\", {\n r: 255,\n g: 255,\n b: 224\n}], [\"lime\", {\n r: 0,\n g: 255,\n b: 0\n}], [\"limegreen\", {\n r: 50,\n g: 205,\n b: 50\n}], [\"linen\", {\n r: 250,\n g: 240,\n b: 230\n}], [\"magenta\", {\n r: 255,\n g: 0,\n b: 255\n}], [\"maroon\", {\n r: 128,\n g: 0,\n b: 0\n}], [\"mediumaquamarine\", {\n r: 102,\n g: 205,\n b: 170\n}], [\"mediumblue\", {\n r: 0,\n g: 0,\n b: 205\n}], [\"mediumorchid\", {\n r: 186,\n g: 85,\n b: 211\n}], [\"mediumpurple\", {\n r: 147,\n g: 112,\n b: 219\n}], [\"mediumseagreen\", {\n r: 60,\n g: 179,\n b: 113\n}], [\"mediumslateblue\", {\n r: 123,\n g: 104,\n b: 238\n}], [\"mediumspringgreen\", {\n r: 0,\n g: 250,\n b: 154\n}], [\"mediumturquoise\", {\n r: 72,\n g: 209,\n b: 204\n}], [\"mediumvioletred\", {\n r: 199,\n g: 21,\n b: 133\n}], [\"midnightblue\", {\n r: 25,\n g: 25,\n b: 112\n}], [\"mintcream\", {\n r: 245,\n g: 255,\n b: 250\n}], [\"mistyrose\", {\n r: 255,\n g: 228,\n b: 225\n}], [\"moccasin\", {\n r: 255,\n g: 228,\n b: 181\n}], [\"navajowhite\", {\n r: 255,\n g: 222,\n b: 173\n}], [\"navy\", {\n r: 0,\n g: 0,\n b: 128\n}], [\"oldlace\", {\n r: 253,\n g: 245,\n b: 230\n}], [\"olive\", {\n r: 128,\n g: 128,\n b: 0\n}], [\"olivedrab\", {\n r: 107,\n g: 142,\n b: 35\n}], [\"orange\", {\n r: 255,\n g: 165,\n b: 0\n}], [\"orangered\", {\n r: 255,\n g: 69,\n b: 0\n}], [\"orchid\", {\n r: 218,\n g: 112,\n b: 214\n}], [\"palegoldenrod\", {\n r: 238,\n g: 232,\n b: 170\n}], [\"palegreen\", {\n r: 152,\n g: 251,\n b: 152\n}], [\"paleturquoise\", {\n r: 175,\n g: 238,\n b: 238\n}], [\"palevioletred\", {\n r: 219,\n g: 112,\n b: 147\n}], [\"papayawhip\", {\n r: 255,\n g: 239,\n b: 213\n}], [\"peachpuff\", {\n r: 255,\n g: 218,\n b: 185\n}], [\"peru\", {\n r: 205,\n g: 133,\n b: 63\n}], [\"pink\", {\n r: 255,\n g: 192,\n b: 203\n}], [\"plum\", {\n r: 221,\n g: 160,\n b: 221\n}], [\"powderblue\", {\n r: 176,\n g: 224,\n b: 230\n}], [\"purple\", {\n r: 128,\n g: 0,\n b: 128\n}], [\"rebeccapurple\", {\n r: 102,\n g: 51,\n b: 153\n}], [\"red\", {\n r: 255,\n g: 0,\n b: 0\n}], [\"rosybrown\", {\n r: 188,\n g: 143,\n b: 143\n}], [\"royalblue\", {\n r: 65,\n g: 105,\n b: 225\n}], [\"saddlebrown\", {\n r: 139,\n g: 69,\n b: 19\n}], [\"salmon\", {\n r: 250,\n g: 128,\n b: 114\n}], [\"sandybrown\", {\n r: 244,\n g: 164,\n b: 96\n}], [\"seagreen\", {\n r: 46,\n g: 139,\n b: 87\n}], [\"seashell\", {\n r: 255,\n g: 245,\n b: 238\n}], [\"sienna\", {\n r: 160,\n g: 82,\n b: 45\n}], [\"silver\", {\n r: 192,\n g: 192,\n b: 192\n}], [\"skyblue\", {\n r: 135,\n g: 206,\n b: 235\n}], [\"slateblue\", {\n r: 106,\n g: 90,\n b: 205\n}], [\"slategray\", {\n r: 112,\n g: 128,\n b: 144\n}], [\"slategrey\", {\n r: 112,\n g: 128,\n b: 144\n}], [\"snow\", {\n r: 255,\n g: 250,\n b: 250\n}], [\"springgreen\", {\n r: 0,\n g: 255,\n b: 127\n}], [\"steelblue\", {\n r: 70,\n g: 130,\n b: 180\n}], [\"tan\", {\n r: 210,\n g: 180,\n b: 140\n}], [\"teal\", {\n r: 0,\n g: 128,\n b: 128\n}], [\"thistle\", {\n r: 216,\n g: 191,\n b: 216\n}], [\"tomato\", {\n r: 255,\n g: 99,\n b: 71\n}], [\"turquoise\", {\n r: 64,\n g: 224,\n b: 208\n}], [\"violet\", {\n r: 238,\n g: 130,\n b: 238\n}], [\"wheat\", {\n r: 245,\n g: 222,\n b: 179\n}], [\"white\", {\n r: 255,\n g: 255,\n b: 255\n}], [\"whitesmoke\", {\n r: 245,\n g: 245,\n b: 245\n}], [\"yellow\", {\n r: 255,\n g: 255,\n b: 0\n}], [\"yellowgreen\", {\n r: 154,\n g: 205,\n b: 50\n}]]);\nclass NamedColorManager {\n constructor() {\n this.key = \"named\";\n this.stringPrefix = \"\";\n }\n handleColor(color) {\n return this._parseString(color.value);\n }\n handleRangeColor(color) {\n return this._parseString(color.value);\n }\n parseString(input) {\n return this._parseString(input);\n }\n _parseString(input) {\n if (!input || typeof input !== \"string\") {\n return undefined;\n }\n const rgbColor = namedColors.get(input.toLowerCase());\n if (!rgbColor) {\n (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getLogger)().error(\"Color not found\", input);\n return undefined;\n }\n return {\n ...rgbColor,\n a: 255\n };\n }\n}\n\n//# sourceURL=webpack://@tsparticles/plugin-named-color/./dist/browser/NamedColorManager.js?\n}");
38
-
39
- /***/ }),
40
-
41
- /***/ "./dist/browser/index.js":
31
+ /***/ "./dist/browser/index.js"
42
32
  /*!*******************************!*\
43
33
  !*** ./dist/browser/index.js ***!
44
34
  \*******************************/
45
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
35
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
46
36
 
47
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadNamedColorPlugin: () => (/* binding */ loadNamedColorPlugin)\n/* harmony export */ });\n/* harmony import */ var _NamedColorManager_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./NamedColorManager.js */ \"./dist/browser/NamedColorManager.js\");\n\nasync function loadNamedColorPlugin(engine, refresh = true) {\n engine.checkVersion(\"3.9.1\");\n await engine.addColorManager(new _NamedColorManager_js__WEBPACK_IMPORTED_MODULE_0__.NamedColorManager(), refresh);\n}\n\n//# sourceURL=webpack://@tsparticles/plugin-named-color/./dist/browser/index.js?\n}");
37
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadNamedColorPlugin: () => (/* binding */ loadNamedColorPlugin)\n/* harmony export */ });\nfunction loadNamedColorPlugin(engine) {\n engine.checkVersion(\"4.0.0-alpha.1\");\n engine.register(async e => {\n const {\n NamedColorManager\n } = await __webpack_require__.e(/*! import() */ \"dist_browser_NamedColorManager_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./NamedColorManager.js */ \"./dist/browser/NamedColorManager.js\"));\n e.addColorManager(new NamedColorManager());\n });\n}\n\n//# sourceURL=webpack://@tsparticles/plugin-named-color/./dist/browser/index.js?\n}");
48
38
 
49
- /***/ }),
39
+ /***/ },
50
40
 
51
- /***/ "@tsparticles/engine":
41
+ /***/ "@tsparticles/engine"
52
42
  /*!*********************************************************************************************************************************!*\
53
43
  !*** external {"commonjs":"@tsparticles/engine","commonjs2":"@tsparticles/engine","amd":"@tsparticles/engine","root":"window"} ***!
54
44
  \*********************************************************************************************************************************/
55
- /***/ ((module) => {
45
+ (module) {
56
46
 
57
47
  module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
58
48
 
59
- /***/ })
49
+ /***/ }
60
50
 
61
51
  /******/ });
62
52
  /************************************************************************/
@@ -70,6 +60,12 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
70
60
  /******/ if (cachedModule !== undefined) {
71
61
  /******/ return cachedModule.exports;
72
62
  /******/ }
63
+ /******/ // Check if module exists (development only)
64
+ /******/ if (__webpack_modules__[moduleId] === undefined) {
65
+ /******/ var e = new Error("Cannot find module '" + moduleId + "'");
66
+ /******/ e.code = 'MODULE_NOT_FOUND';
67
+ /******/ throw e;
68
+ /******/ }
73
69
  /******/ // Create a new module (and put it into the cache)
74
70
  /******/ var module = __webpack_module_cache__[moduleId] = {
75
71
  /******/ // no module.id needed
@@ -84,19 +80,10 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
84
80
  /******/ return module.exports;
85
81
  /******/ }
86
82
  /******/
87
- /************************************************************************/
88
- /******/ /* webpack/runtime/compat get default export */
89
- /******/ (() => {
90
- /******/ // getDefaultExport function for compatibility with non-harmony modules
91
- /******/ __webpack_require__.n = (module) => {
92
- /******/ var getter = module && module.__esModule ?
93
- /******/ () => (module['default']) :
94
- /******/ () => (module);
95
- /******/ __webpack_require__.d(getter, { a: getter });
96
- /******/ return getter;
97
- /******/ };
98
- /******/ })();
83
+ /******/ // expose the modules object (__webpack_modules__)
84
+ /******/ __webpack_require__.m = __webpack_modules__;
99
85
  /******/
86
+ /************************************************************************/
100
87
  /******/ /* webpack/runtime/define property getters */
101
88
  /******/ (() => {
102
89
  /******/ // define getter functions for harmony exports
@@ -109,11 +96,90 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
109
96
  /******/ };
110
97
  /******/ })();
111
98
  /******/
99
+ /******/ /* webpack/runtime/ensure chunk */
100
+ /******/ (() => {
101
+ /******/ __webpack_require__.f = {};
102
+ /******/ // This file contains only the entry chunk.
103
+ /******/ // The chunk loading function for additional chunks
104
+ /******/ __webpack_require__.e = (chunkId) => {
105
+ /******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {
106
+ /******/ __webpack_require__.f[key](chunkId, promises);
107
+ /******/ return promises;
108
+ /******/ }, []));
109
+ /******/ };
110
+ /******/ })();
111
+ /******/
112
+ /******/ /* webpack/runtime/get javascript chunk filename */
113
+ /******/ (() => {
114
+ /******/ // This function allow to reference async chunks
115
+ /******/ __webpack_require__.u = (chunkId) => {
116
+ /******/ // return url for filenames based on template
117
+ /******/ return "" + chunkId + ".js";
118
+ /******/ };
119
+ /******/ })();
120
+ /******/
121
+ /******/ /* webpack/runtime/global */
122
+ /******/ (() => {
123
+ /******/ __webpack_require__.g = (function() {
124
+ /******/ if (typeof globalThis === 'object') return globalThis;
125
+ /******/ try {
126
+ /******/ return this || new Function('return this')();
127
+ /******/ } catch (e) {
128
+ /******/ if (typeof window === 'object') return window;
129
+ /******/ }
130
+ /******/ })();
131
+ /******/ })();
132
+ /******/
112
133
  /******/ /* webpack/runtime/hasOwnProperty shorthand */
113
134
  /******/ (() => {
114
135
  /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
115
136
  /******/ })();
116
137
  /******/
138
+ /******/ /* webpack/runtime/load script */
139
+ /******/ (() => {
140
+ /******/ var inProgress = {};
141
+ /******/ var dataWebpackPrefix = "@tsparticles/plugin-named-color:";
142
+ /******/ // loadScript function to load a script via script tag
143
+ /******/ __webpack_require__.l = (url, done, key, chunkId) => {
144
+ /******/ if(inProgress[url]) { inProgress[url].push(done); return; }
145
+ /******/ var script, needAttach;
146
+ /******/ if(key !== undefined) {
147
+ /******/ var scripts = document.getElementsByTagName("script");
148
+ /******/ for(var i = 0; i < scripts.length; i++) {
149
+ /******/ var s = scripts[i];
150
+ /******/ if(s.getAttribute("src") == url || s.getAttribute("data-webpack") == dataWebpackPrefix + key) { script = s; break; }
151
+ /******/ }
152
+ /******/ }
153
+ /******/ if(!script) {
154
+ /******/ needAttach = true;
155
+ /******/ script = document.createElement('script');
156
+ /******/
157
+ /******/ script.charset = 'utf-8';
158
+ /******/ if (__webpack_require__.nc) {
159
+ /******/ script.setAttribute("nonce", __webpack_require__.nc);
160
+ /******/ }
161
+ /******/ script.setAttribute("data-webpack", dataWebpackPrefix + key);
162
+ /******/
163
+ /******/ script.src = url;
164
+ /******/ }
165
+ /******/ inProgress[url] = [done];
166
+ /******/ var onScriptComplete = (prev, event) => {
167
+ /******/ // avoid mem leaks in IE.
168
+ /******/ script.onerror = script.onload = null;
169
+ /******/ clearTimeout(timeout);
170
+ /******/ var doneFns = inProgress[url];
171
+ /******/ delete inProgress[url];
172
+ /******/ script.parentNode && script.parentNode.removeChild(script);
173
+ /******/ doneFns && doneFns.forEach((fn) => (fn(event)));
174
+ /******/ if(prev) return prev(event);
175
+ /******/ }
176
+ /******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
177
+ /******/ script.onerror = onScriptComplete.bind(null, script.onerror);
178
+ /******/ script.onload = onScriptComplete.bind(null, script.onload);
179
+ /******/ needAttach && document.head.appendChild(script);
180
+ /******/ };
181
+ /******/ })();
182
+ /******/
117
183
  /******/ /* webpack/runtime/make namespace object */
118
184
  /******/ (() => {
119
185
  /******/ // define __esModule on exports
@@ -125,6 +191,119 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
125
191
  /******/ };
126
192
  /******/ })();
127
193
  /******/
194
+ /******/ /* webpack/runtime/publicPath */
195
+ /******/ (() => {
196
+ /******/ var scriptUrl;
197
+ /******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + "";
198
+ /******/ var document = __webpack_require__.g.document;
199
+ /******/ if (!scriptUrl && document) {
200
+ /******/ if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')
201
+ /******/ scriptUrl = document.currentScript.src;
202
+ /******/ if (!scriptUrl) {
203
+ /******/ var scripts = document.getElementsByTagName("script");
204
+ /******/ if(scripts.length) {
205
+ /******/ var i = scripts.length - 1;
206
+ /******/ while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;
207
+ /******/ }
208
+ /******/ }
209
+ /******/ }
210
+ /******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration
211
+ /******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.
212
+ /******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
213
+ /******/ scriptUrl = scriptUrl.replace(/^blob:/, "").replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
214
+ /******/ __webpack_require__.p = scriptUrl;
215
+ /******/ })();
216
+ /******/
217
+ /******/ /* webpack/runtime/jsonp chunk loading */
218
+ /******/ (() => {
219
+ /******/ // no baseURI
220
+ /******/
221
+ /******/ // object to store loaded and loading chunks
222
+ /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
223
+ /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
224
+ /******/ var installedChunks = {
225
+ /******/ "tsparticles.plugin.namedColor": 0
226
+ /******/ };
227
+ /******/
228
+ /******/ __webpack_require__.f.j = (chunkId, promises) => {
229
+ /******/ // JSONP chunk loading for javascript
230
+ /******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;
231
+ /******/ if(installedChunkData !== 0) { // 0 means "already installed".
232
+ /******/
233
+ /******/ // a Promise means "currently loading".
234
+ /******/ if(installedChunkData) {
235
+ /******/ promises.push(installedChunkData[2]);
236
+ /******/ } else {
237
+ /******/ if(true) { // all chunks have JS
238
+ /******/ // setup Promise in chunk cache
239
+ /******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));
240
+ /******/ promises.push(installedChunkData[2] = promise);
241
+ /******/
242
+ /******/ // start chunk loading
243
+ /******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId);
244
+ /******/ // create error before stack unwound to get useful stacktrace later
245
+ /******/ var error = new Error();
246
+ /******/ var loadingEnded = (event) => {
247
+ /******/ if(__webpack_require__.o(installedChunks, chunkId)) {
248
+ /******/ installedChunkData = installedChunks[chunkId];
249
+ /******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined;
250
+ /******/ if(installedChunkData) {
251
+ /******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type);
252
+ /******/ var realSrc = event && event.target && event.target.src;
253
+ /******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')';
254
+ /******/ error.name = 'ChunkLoadError';
255
+ /******/ error.type = errorType;
256
+ /******/ error.request = realSrc;
257
+ /******/ installedChunkData[1](error);
258
+ /******/ }
259
+ /******/ }
260
+ /******/ };
261
+ /******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId);
262
+ /******/ }
263
+ /******/ }
264
+ /******/ }
265
+ /******/ };
266
+ /******/
267
+ /******/ // no prefetching
268
+ /******/
269
+ /******/ // no preloaded
270
+ /******/
271
+ /******/ // no HMR
272
+ /******/
273
+ /******/ // no HMR manifest
274
+ /******/
275
+ /******/ // no on chunks loaded
276
+ /******/
277
+ /******/ // install a JSONP callback for chunk loading
278
+ /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
279
+ /******/ var [chunkIds, moreModules, runtime] = data;
280
+ /******/ // add "moreModules" to the modules object,
281
+ /******/ // then flag all "chunkIds" as loaded and fire callback
282
+ /******/ var moduleId, chunkId, i = 0;
283
+ /******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
284
+ /******/ for(moduleId in moreModules) {
285
+ /******/ if(__webpack_require__.o(moreModules, moduleId)) {
286
+ /******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
287
+ /******/ }
288
+ /******/ }
289
+ /******/ if(runtime) var result = runtime(__webpack_require__);
290
+ /******/ }
291
+ /******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
292
+ /******/ for(;i < chunkIds.length; i++) {
293
+ /******/ chunkId = chunkIds[i];
294
+ /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
295
+ /******/ installedChunks[chunkId][0]();
296
+ /******/ }
297
+ /******/ installedChunks[chunkId] = 0;
298
+ /******/ }
299
+ /******/
300
+ /******/ }
301
+ /******/
302
+ /******/ var chunkLoadingGlobal = this["webpackChunk_tsparticles_plugin_named_color"] = this["webpackChunk_tsparticles_plugin_named_color"] || [];
303
+ /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
304
+ /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
305
+ /******/ })();
306
+ /******/
128
307
  /************************************************************************/
129
308
  /******/
130
309
  /******/ // startup
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see tsparticles.plugin.namedColor.min.js.LICENSE.txt */
2
- !function(r,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine"],e);else{var g="object"==typeof exports?e(require("@tsparticles/engine")):e(r.window);for(var b in g)("object"==typeof exports?exports:r)[b]=g[b]}}(this,(r=>(()=>{var e={303:e=>{e.exports=r}},g={};function b(r){var a=g[r];if(void 0!==a)return a.exports;var o=g[r]={exports:{}};return e[r](o,o.exports,b),o.exports}b.d=(r,e)=>{for(var g in e)b.o(e,g)&&!b.o(r,g)&&Object.defineProperty(r,g,{enumerable:!0,get:e[g]})},b.o=(r,e)=>Object.prototype.hasOwnProperty.call(r,e),b.r=r=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})};var a={};b.r(a),b.d(a,{loadNamedColorPlugin:()=>i});var o=b(303);const l=new Map([["aliceblue",{r:240,g:248,b:255}],["antiquewhite",{r:250,g:235,b:215}],["aqua",{r:0,g:255,b:255}],["aquamarine",{r:127,g:255,b:212}],["azure",{r:240,g:255,b:255}],["beige",{r:245,g:245,b:220}],["bisque",{r:255,g:228,b:196}],["black",{r:0,g:0,b:0}],["blanchedalmond",{r:255,g:235,b:205}],["blue",{r:0,g:0,b:255}],["blueviolet",{r:138,g:43,b:226}],["brown",{r:165,g:42,b:42}],["burlywood",{r:222,g:184,b:135}],["cadetblue",{r:95,g:158,b:160}],["chartreuse",{r:127,g:255,b:0}],["chocolate",{r:210,g:105,b:30}],["coral",{r:255,g:127,b:80}],["cornflowerblue",{r:100,g:149,b:237}],["cornsilk",{r:255,g:248,b:220}],["crimson",{r:220,g:20,b:60}],["cyan",{r:0,g:255,b:255}],["darkblue",{r:0,g:0,b:139}],["darkcyan",{r:0,g:139,b:139}],["darkgoldenrod",{r:184,g:134,b:11}],["darkgray",{r:169,g:169,b:169}],["darkgreen",{r:0,g:100,b:0}],["darkgrey",{r:169,g:169,b:169}],["darkkhaki",{r:189,g:183,b:107}],["darkmagenta",{r:139,g:0,b:139}],["darkolivegreen",{r:85,g:107,b:47}],["darkorange",{r:255,g:140,b:0}],["darkorchid",{r:153,g:50,b:204}],["darkred",{r:139,g:0,b:0}],["darksalmon",{r:233,g:150,b:122}],["darkseagreen",{r:143,g:188,b:143}],["darkslateblue",{r:72,g:61,b:139}],["darkslategray",{r:47,g:79,b:79}],["darkslategrey",{r:47,g:79,b:79}],["darkturquoise",{r:0,g:206,b:209}],["darkviolet",{r:148,g:0,b:211}],["deeppink",{r:255,g:20,b:147}],["deepskyblue",{r:0,g:191,b:255}],["dimgray",{r:105,g:105,b:105}],["dimgrey",{r:105,g:105,b:105}],["dodgerblue",{r:30,g:144,b:255}],["firebrick",{r:178,g:34,b:34}],["floralwhite",{r:255,g:250,b:240}],["forestgreen",{r:34,g:139,b:34}],["fuchsia",{r:255,g:0,b:255}],["gainsboro",{r:220,g:220,b:220}],["ghostwhite",{r:248,g:248,b:255}],["gold",{r:255,g:215,b:0}],["goldenrod",{r:218,g:165,b:32}],["gray",{r:128,g:128,b:128}],["green",{r:0,g:128,b:0}],["greenyellow",{r:173,g:255,b:47}],["grey",{r:128,g:128,b:128}],["honeydew",{r:240,g:255,b:240}],["hotpink",{r:255,g:105,b:180}],["indianred",{r:205,g:92,b:92}],["indigo",{r:75,g:0,b:130}],["ivory",{r:255,g:255,b:240}],["khaki",{r:240,g:230,b:140}],["lavender",{r:230,g:230,b:250}],["lavenderblush",{r:255,g:240,b:245}],["lawngreen",{r:124,g:252,b:0}],["lemonchiffon",{r:255,g:250,b:205}],["lightblue",{r:173,g:216,b:230}],["lightcoral",{r:240,g:128,b:128}],["lightcyan",{r:224,g:255,b:255}],["lightgoldenrodyellow",{r:250,g:250,b:210}],["lightgray",{r:211,g:211,b:211}],["lightgreen",{r:144,g:238,b:144}],["lightgrey",{r:211,g:211,b:211}],["lightpink",{r:255,g:182,b:193}],["lightsalmon",{r:255,g:160,b:122}],["lightseagreen",{r:32,g:178,b:170}],["lightskyblue",{r:135,g:206,b:250}],["lightslategray",{r:119,g:136,b:153}],["lightslategrey",{r:119,g:136,b:153}],["lightsteelblue",{r:176,g:196,b:222}],["lightyellow",{r:255,g:255,b:224}],["lime",{r:0,g:255,b:0}],["limegreen",{r:50,g:205,b:50}],["linen",{r:250,g:240,b:230}],["magenta",{r:255,g:0,b:255}],["maroon",{r:128,g:0,b:0}],["mediumaquamarine",{r:102,g:205,b:170}],["mediumblue",{r:0,g:0,b:205}],["mediumorchid",{r:186,g:85,b:211}],["mediumpurple",{r:147,g:112,b:219}],["mediumseagreen",{r:60,g:179,b:113}],["mediumslateblue",{r:123,g:104,b:238}],["mediumspringgreen",{r:0,g:250,b:154}],["mediumturquoise",{r:72,g:209,b:204}],["mediumvioletred",{r:199,g:21,b:133}],["midnightblue",{r:25,g:25,b:112}],["mintcream",{r:245,g:255,b:250}],["mistyrose",{r:255,g:228,b:225}],["moccasin",{r:255,g:228,b:181}],["navajowhite",{r:255,g:222,b:173}],["navy",{r:0,g:0,b:128}],["oldlace",{r:253,g:245,b:230}],["olive",{r:128,g:128,b:0}],["olivedrab",{r:107,g:142,b:35}],["orange",{r:255,g:165,b:0}],["orangered",{r:255,g:69,b:0}],["orchid",{r:218,g:112,b:214}],["palegoldenrod",{r:238,g:232,b:170}],["palegreen",{r:152,g:251,b:152}],["paleturquoise",{r:175,g:238,b:238}],["palevioletred",{r:219,g:112,b:147}],["papayawhip",{r:255,g:239,b:213}],["peachpuff",{r:255,g:218,b:185}],["peru",{r:205,g:133,b:63}],["pink",{r:255,g:192,b:203}],["plum",{r:221,g:160,b:221}],["powderblue",{r:176,g:224,b:230}],["purple",{r:128,g:0,b:128}],["rebeccapurple",{r:102,g:51,b:153}],["red",{r:255,g:0,b:0}],["rosybrown",{r:188,g:143,b:143}],["royalblue",{r:65,g:105,b:225}],["saddlebrown",{r:139,g:69,b:19}],["salmon",{r:250,g:128,b:114}],["sandybrown",{r:244,g:164,b:96}],["seagreen",{r:46,g:139,b:87}],["seashell",{r:255,g:245,b:238}],["sienna",{r:160,g:82,b:45}],["silver",{r:192,g:192,b:192}],["skyblue",{r:135,g:206,b:235}],["slateblue",{r:106,g:90,b:205}],["slategray",{r:112,g:128,b:144}],["slategrey",{r:112,g:128,b:144}],["snow",{r:255,g:250,b:250}],["springgreen",{r:0,g:255,b:127}],["steelblue",{r:70,g:130,b:180}],["tan",{r:210,g:180,b:140}],["teal",{r:0,g:128,b:128}],["thistle",{r:216,g:191,b:216}],["tomato",{r:255,g:99,b:71}],["turquoise",{r:64,g:224,b:208}],["violet",{r:238,g:130,b:238}],["wheat",{r:245,g:222,b:179}],["white",{r:255,g:255,b:255}],["whitesmoke",{r:245,g:245,b:245}],["yellow",{r:255,g:255,b:0}],["yellowgreen",{r:154,g:205,b:50}]]);class t{constructor(){this.key="named",this.stringPrefix=""}handleColor(r){return this._parseString(r.value)}handleRangeColor(r){return this._parseString(r.value)}parseString(r){return this._parseString(r)}_parseString(r){if(!r||"string"!=typeof r)return;const e=l.get(r.toLowerCase());if(e)return{...e,a:255};(0,o.getLogger)().error("Color not found",r)}}async function i(r,e=!0){r.checkVersion("3.9.1"),await r.addColorManager(new t,e)}return a})()));
2
+ !function(e,r){if("object"==typeof exports&&"object"==typeof module)module.exports=r(require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine"],r);else{var t="object"==typeof exports?r(require("@tsparticles/engine")):r(e.window);for(var o in t)("object"==typeof exports?exports:e)[o]=t[o]}}(this,(e=>(()=>{var r,t,o={303(r){r.exports=e}},n={};function i(e){var r=n[e];if(void 0!==r)return r.exports;var t=n[e]={exports:{}};return o[e](t,t.exports,i),t.exports}i.m=o,i.d=(e,r)=>{for(var t in r)i.o(r,t)&&!i.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},i.f={},i.e=e=>Promise.all(Object.keys(i.f).reduce(((r,t)=>(i.f[t](e,r),r)),[])),i.u=e=>e+".min.js",i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),r={},t="@tsparticles/plugin-named-color:",i.l=(e,o,n,a)=>{if(r[e])r[e].push(o);else{var l,s;if(void 0!==n)for(var c=document.getElementsByTagName("script"),p=0;p<c.length;p++){var u=c[p];if(u.getAttribute("src")==e||u.getAttribute("data-webpack")==t+n){l=u;break}}l||(s=!0,(l=document.createElement("script")).charset="utf-8",i.nc&&l.setAttribute("nonce",i.nc),l.setAttribute("data-webpack",t+n),l.src=e),r[e]=[o];var d=(t,o)=>{l.onerror=l.onload=null,clearTimeout(f);var n=r[e];if(delete r[e],l.parentNode&&l.parentNode.removeChild(l),n&&n.forEach((e=>e(o))),t)return t(o)},f=setTimeout(d.bind(null,void 0,{type:"timeout",target:l}),12e4);l.onerror=d.bind(null,l.onerror),l.onload=d.bind(null,l.onload),s&&document.head.appendChild(l)}},i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;i.g.importScripts&&(e=i.g.location+"");var r=i.g.document;if(!e&&r&&(r.currentScript&&"SCRIPT"===r.currentScript.tagName.toUpperCase()&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");if(t.length)for(var o=t.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=t[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i.p=e})(),(()=>{var e={328:0};i.f.j=(r,t)=>{var o=i.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var n=new Promise(((t,n)=>o=e[r]=[t,n]));t.push(o[2]=n);var a=i.p+i.u(r),l=new Error;i.l(a,(t=>{if(i.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var n=t&&("load"===t.type?"missing":t.type),a=t&&t.target&&t.target.src;l.message="Loading chunk "+r+" failed.\n("+n+": "+a+")",l.name="ChunkLoadError",l.type=n,l.request=a,o[1](l)}}),"chunk-"+r,r)}};var r=(r,t)=>{var o,n,[a,l,s]=t,c=0;if(a.some((r=>0!==e[r]))){for(o in l)i.o(l,o)&&(i.m[o]=l[o]);if(s)s(i)}for(r&&r(t);c<a.length;c++)n=a[c],i.o(e,n)&&e[n]&&e[n][0](),e[n]=0},t=this.webpackChunk_tsparticles_plugin_named_color=this.webpackChunk_tsparticles_plugin_named_color||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})();var a={};function l(e){e.checkVersion("4.0.0-alpha.1"),e.register((async e=>{const{NamedColorManager:r}=await i.e(613).then(i.bind(i,613));e.addColorManager(new r)}))}return i.r(a),i.d(a,{loadNamedColorPlugin:()=>l}),a})()));
@@ -1 +1 @@
1
- /*! tsParticles Named Color Plugin v3.9.1 by Matteo Bruni */
1
+ /*! tsParticles Named Color Plugin v4.0.0-alpha.1 by Matteo Bruni */
@@ -1,8 +1,8 @@
1
1
  import { type IColor, type IColorManager, type IRangeColor, type IRgb, type IRgba } from "@tsparticles/engine";
2
2
  export declare class NamedColorManager implements IColorManager {
3
3
  readonly key: string;
4
- readonly stringPrefix: string;
5
4
  constructor();
5
+ accepts(input: string): boolean;
6
6
  handleColor(color: IColor): IRgb | undefined;
7
7
  handleRangeColor(color: IRangeColor): IRgb | undefined;
8
8
  parseString(input: string): IRgba | undefined;
package/types/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  import { type Engine } from "@tsparticles/engine";
2
- export declare function loadNamedColorPlugin(engine: Engine, refresh?: boolean): Promise<void>;
2
+ export declare function loadNamedColorPlugin(engine: Engine): void;
@@ -164,7 +164,9 @@
164
164
  class NamedColorManager {
165
165
  constructor() {
166
166
  this.key = "named";
167
- this.stringPrefix = "";
167
+ }
168
+ accepts(input) {
169
+ return namedColors.has(input.toLowerCase());
168
170
  }
169
171
  handleColor(color) {
170
172
  return this._parseString(color.value);
package/umd/index.js CHANGED
@@ -1,18 +1,54 @@
1
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
2
+ if (k2 === undefined) k2 = k;
3
+ var desc = Object.getOwnPropertyDescriptor(m, k);
4
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
5
+ desc = { enumerable: true, get: function() { return m[k]; } };
6
+ }
7
+ Object.defineProperty(o, k2, desc);
8
+ }) : (function(o, m, k, k2) {
9
+ if (k2 === undefined) k2 = k;
10
+ o[k2] = m[k];
11
+ }));
12
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
13
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
14
+ }) : function(o, v) {
15
+ o["default"] = v;
16
+ });
17
+ var __importStar = (this && this.__importStar) || (function () {
18
+ var ownKeys = function(o) {
19
+ ownKeys = Object.getOwnPropertyNames || function (o) {
20
+ var ar = [];
21
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
22
+ return ar;
23
+ };
24
+ return ownKeys(o);
25
+ };
26
+ return function (mod) {
27
+ if (mod && mod.__esModule) return mod;
28
+ var result = {};
29
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
30
+ __setModuleDefault(result, mod);
31
+ return result;
32
+ };
33
+ })();
1
34
  (function (factory) {
2
35
  if (typeof module === "object" && typeof module.exports === "object") {
3
36
  var v = factory(require, exports);
4
37
  if (v !== undefined) module.exports = v;
5
38
  }
6
39
  else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "./NamedColorManager.js"], factory);
40
+ define(["require", "exports"], factory);
8
41
  }
9
42
  })(function (require, exports) {
10
43
  "use strict";
44
+ var __syncRequire = typeof module === "object" && typeof module.exports === "object";
11
45
  Object.defineProperty(exports, "__esModule", { value: true });
12
46
  exports.loadNamedColorPlugin = loadNamedColorPlugin;
13
- const NamedColorManager_js_1 = require("./NamedColorManager.js");
14
- async function loadNamedColorPlugin(engine, refresh = true) {
15
- engine.checkVersion("3.9.1");
16
- await engine.addColorManager(new NamedColorManager_js_1.NamedColorManager(), refresh);
47
+ function loadNamedColorPlugin(engine) {
48
+ engine.checkVersion("4.0.0-alpha.1");
49
+ engine.register(async (e) => {
50
+ const { NamedColorManager } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./NamedColorManager.js"))) : new Promise((resolve_1, reject_1) => { require(["./NamedColorManager.js"], resolve_1, reject_1); }).then(__importStar));
51
+ e.addColorManager(new NamedColorManager());
52
+ });
17
53
  }
18
54
  });