@tsparticles/plugin-hex-color 4.0.0-alpha.2 → 4.0.0-alpha.21
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/97.min.js +1 -0
- package/browser/HexColorManager.js +5 -8
- package/browser/index.js +4 -4
- package/cjs/HexColorManager.js +5 -8
- package/cjs/index.js +4 -4
- package/dist_browser_HexColorManager_js.js +2 -2
- package/esm/HexColorManager.js +5 -8
- package/esm/index.js +4 -4
- package/package.json +2 -2
- package/report.html +3 -3
- package/tsparticles.plugin.hexColor.js +2 -2
- package/tsparticles.plugin.hexColor.min.js +2 -2
- package/types/HexColorManager.d.ts +0 -2
- package/types/index.d.ts +1 -1
- package/umd/HexColorManager.js +5 -8
- package/umd/index.js +4 -4
- package/69.min.js +0 -2
- package/69.min.js.LICENSE.txt +0 -1
- package/tsparticles.plugin.hexColor.min.js.LICENSE.txt +0 -1
|
@@ -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
|
-
* v4.0.0-alpha.
|
|
7
|
+
* v4.0.0-alpha.21
|
|
8
8
|
*/
|
|
9
9
|
/*
|
|
10
10
|
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
@@ -34,7 +34,7 @@ return /******/ (() => { // webpackBootstrap
|
|
|
34
34
|
\*******************************/
|
|
35
35
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
36
36
|
|
|
37
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadHexColorPlugin: () => (/* binding */ loadHexColorPlugin)\n/* harmony export */ });\
|
|
37
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadHexColorPlugin: () => (/* binding */ loadHexColorPlugin)\n/* harmony export */ });\nasync function loadHexColorPlugin(engine) {\n engine.checkVersion(\"4.0.0-alpha.21\");\n await engine.register(async (e)=>{\n const { HexColorManager } = await __webpack_require__.e(/*! import() */ \"dist_browser_HexColorManager_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./HexColorManager.js */ \"./dist/browser/HexColorManager.js\"));\n e.addColorManager(\"hex\", new HexColorManager());\n });\n}\n\n\n//# sourceURL=webpack://@tsparticles/plugin-hex-color/./dist/browser/index.js?\n}");
|
|
38
38
|
|
|
39
39
|
/***/ }
|
|
40
40
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var o in r)("object"==typeof exports?exports:e)[o]=r[o]}}(this,()=>(()=>{"use strict";var e,t,r,o={},n={};function i(e){var t=n[e];if(void 0!==t)return t.exports;var r=n[e]={exports:{}};return o[e](r,r.exports,i),r.exports}i.m=o,i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.f={},i.e=e=>Promise.all(Object.keys(i.f).reduce((t,r)=>(i.f[r](e,t),t),[])),i.u=e=>""+e+".min.js",i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a={},i.l=(e,t,r,o)=>{if(a[e])return void a[e].push(t);if(void 0!==r)for(var n,l,c=document.getElementsByTagName("script"),s=0;s<c.length;s++){var p=c[s];if(p.getAttribute("src")==e||p.getAttribute("data-webpack")=="@tsparticles/plugin-hex-color:"+r){n=p;break}}n||(l=!0,(n=document.createElement("script")).charset="utf-8",i.nc&&n.setAttribute("nonce",i.nc),n.setAttribute("data-webpack","@tsparticles/plugin-hex-color:"+r),n.src=e),a[e]=[t];var u=(t,r)=>{n.onerror=n.onload=null,clearTimeout(d);var o=a[e];if(delete a[e],n.parentNode&&n.parentNode.removeChild(n),o&&o.forEach(e=>e(r)),t)return t(r)},d=setTimeout(u.bind(null,void 0,{type:"timeout",target:n}),12e4);n.onerror=u.bind(null,n.onerror),n.onload=u.bind(null,n.onload),l&&document.head.appendChild(n)},i.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.g.importScripts&&(l=i.g.location+"");var a,l,c=i.g.document;if(!l&&c&&(c.currentScript&&"SCRIPT"===c.currentScript.tagName.toUpperCase()&&(l=c.currentScript.src),!l)){var s=c.getElementsByTagName("script");if(s.length)for(var p=s.length-1;p>-1&&(!l||!/^http(s?):/.test(l));)l=s[p--].src}if(!l)throw Error("Automatic publicPath is not supported in this browser");i.p=l=l.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),e={964:0},i.f.j=(t,r)=>{var o=i.o(e,t)?e[t]:void 0;if(0!==o)if(o)r.push(o[2]);else{var n=new Promise((r,n)=>o=e[t]=[r,n]);r.push(o[2]=n);var a=i.p+i.u(t),l=Error();i.l(a,r=>{if(i.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var n=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;l.message="Loading chunk "+t+` failed.
|
|
2
|
+
(`+n+": "+a+")",l.name="ChunkLoadError",l.type=n,l.request=a,o[1](l)}},"chunk-"+t,t)}},t=(t,r)=>{var o,n,[a,l,c]=r,s=0;if(a.some(t=>0!==e[t])){for(o in l)i.o(l,o)&&(i.m[o]=l[o]);c&&c(i)}for(t&&t(r);s<a.length;s++)n=a[s],i.o(e,n)&&e[n]&&e[n][0](),e[n]=0},(r=this.webpackChunk_tsparticles_plugin_hex_color=this.webpackChunk_tsparticles_plugin_hex_color||[]).forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r));var u={};async function d(e){e.checkVersion("4.0.0-alpha.21"),await e.register(async e=>{let{HexColorManager:t}=await i.e(97).then(i.bind(i,97));e.addColorManager("hex",new t)})}return i.r(u),i.d(u,{loadHexColorPlugin:()=>d}),u})());
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import type { IColor, IColorManager, IRangeColor, IRgb, IRgba } from "@tsparticles/engine";
|
|
2
2
|
export declare class HexColorManager implements IColorManager {
|
|
3
|
-
readonly key: string;
|
|
4
|
-
constructor();
|
|
5
3
|
accepts(input: string): boolean;
|
|
6
4
|
handleColor(color: IColor): IRgb | undefined;
|
|
7
5
|
handleRangeColor(color: IRangeColor): IRgb | undefined;
|
package/types/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { type Engine } from "@tsparticles/engine";
|
|
2
|
-
export declare function loadHexColorPlugin(engine: Engine): void
|
|
2
|
+
export declare function loadHexColorPlugin(engine: Engine): Promise<void>;
|
package/umd/HexColorManager.js
CHANGED
|
@@ -19,9 +19,6 @@
|
|
|
19
19
|
})(RgbIndexes || (RgbIndexes = {}));
|
|
20
20
|
const shorthandHexRegex = /^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i, hexRegex = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i, hexRadix = 16, defaultAlpha = 1, alphaFactor = 0xff;
|
|
21
21
|
class HexColorManager {
|
|
22
|
-
constructor() {
|
|
23
|
-
this.key = "hex";
|
|
24
|
-
}
|
|
25
22
|
accepts(input) {
|
|
26
23
|
return input.startsWith("#");
|
|
27
24
|
}
|
|
@@ -39,14 +36,14 @@
|
|
|
39
36
|
return;
|
|
40
37
|
}
|
|
41
38
|
const hexFixed = hexColor.replace(shorthandHexRegex, (_, r, g, b, a) => {
|
|
42
|
-
return r + r + g + g + b + b + (a
|
|
39
|
+
return r + r + g + g + b + b + (a === undefined ? "" : a + a);
|
|
43
40
|
}), result = hexRegex.exec(hexFixed);
|
|
44
41
|
return result
|
|
45
42
|
? {
|
|
46
|
-
a: result[RgbIndexes.a] ? parseInt(result[RgbIndexes.a], hexRadix) / alphaFactor : defaultAlpha,
|
|
47
|
-
b: parseInt(result[RgbIndexes.b] ?? "0", hexRadix),
|
|
48
|
-
g: parseInt(result[RgbIndexes.g] ?? "0", hexRadix),
|
|
49
|
-
r: parseInt(result[RgbIndexes.r] ?? "0", hexRadix),
|
|
43
|
+
a: result[RgbIndexes.a] ? Number.parseInt(result[RgbIndexes.a], hexRadix) / alphaFactor : defaultAlpha,
|
|
44
|
+
b: Number.parseInt(result[RgbIndexes.b] ?? "0", hexRadix),
|
|
45
|
+
g: Number.parseInt(result[RgbIndexes.g] ?? "0", hexRadix),
|
|
46
|
+
r: Number.parseInt(result[RgbIndexes.r] ?? "0", hexRadix),
|
|
50
47
|
}
|
|
51
48
|
: undefined;
|
|
52
49
|
}
|
package/umd/index.js
CHANGED
|
@@ -44,11 +44,11 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
44
44
|
var __syncRequire = typeof module === "object" && typeof module.exports === "object";
|
|
45
45
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
46
|
exports.loadHexColorPlugin = loadHexColorPlugin;
|
|
47
|
-
function loadHexColorPlugin(engine) {
|
|
48
|
-
engine.checkVersion("4.0.0-alpha.
|
|
49
|
-
engine.register(async (e) => {
|
|
47
|
+
async function loadHexColorPlugin(engine) {
|
|
48
|
+
engine.checkVersion("4.0.0-alpha.21");
|
|
49
|
+
await engine.register(async (e) => {
|
|
50
50
|
const { HexColorManager } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./HexColorManager.js"))) : new Promise((resolve_1, reject_1) => { require(["./HexColorManager.js"], resolve_1, reject_1); }).then(__importStar));
|
|
51
|
-
e.addColorManager(new HexColorManager());
|
|
51
|
+
e.addColorManager("hex", new HexColorManager());
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
54
|
});
|
package/69.min.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see 69.min.js.LICENSE.txt */
|
|
2
|
-
(this.webpackChunk_tsparticles_plugin_hex_color=this.webpackChunk_tsparticles_plugin_hex_color||[]).push([[69],{69(r,a,t){var e;t.d(a,{HexColorManager:()=>i}),function(r){r[r.r=1]="r",r[r.g=2]="g",r[r.b=3]="b",r[r.a=4]="a"}(e||(e={}));const s=/^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i,n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i;class i{constructor(){this.key="hex"}accepts(r){return r.startsWith("#")}handleColor(r){return this._parseString(r.value)}handleRangeColor(r){return this._parseString(r.value)}parseString(r){return this._parseString(r)}_parseString(r){if("string"!=typeof r||!this.accepts(r))return;const a=r.replace(s,((r,a,t,e,s)=>a+a+t+t+e+e+(void 0!==s?s+s:""))),t=n.exec(a);return t?{a:t[e.a]?parseInt(t[e.a],16)/255:1,b:parseInt(t[e.b]??"0",16),g:parseInt(t[e.g]??"0",16),r:parseInt(t[e.r]??"0",16)}:void 0}}}}]);
|
package/69.min.js.LICENSE.txt
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! tsParticles Hex Color Plugin v4.0.0-alpha.2 by Matteo Bruni */
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! tsParticles Hex Color Plugin v4.0.0-alpha.2 by Matteo Bruni */
|