@tsparticles/plugin-hsv-color 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  import { HsvColorManager } from "./HsvColorManager.js";
2
2
  export async function loadHsvColorPlugin(engine) {
3
- engine.checkVersion("4.3.2");
3
+ engine.checkVersion("4.4.0");
4
4
  await engine.pluginManager.register(e => {
5
5
  e.pluginManager.addColorManager("hsv", new HsvColorManager());
6
6
  });
@@ -1,5 +1,5 @@
1
1
  export async function loadHsvColorPlugin(engine) {
2
- engine.checkVersion("4.3.2");
2
+ engine.checkVersion("4.4.0");
3
3
  await engine.pluginManager.register(async (e) => {
4
4
  const { HsvColorManager } = await import("./HsvColorManager.js");
5
5
  e.pluginManager.addColorManager("hsv", new HsvColorManager());
package/browser/utils.js CHANGED
@@ -33,8 +33,8 @@ export function rgbaToHsva(rgba) {
33
33
  ...rgbToHsv(rgba),
34
34
  };
35
35
  }
36
- export function getStyleFromHsv(color, hdr, opacity) {
37
- return getStyleFromHsl(hsvToHsl(color), hdr, opacity);
36
+ export function getStyleFromHsv(color, hdr, opacity, peakNits, mode) {
37
+ return getStyleFromHsl(hsvToHsl(color), hdr, opacity, peakNits, mode);
38
38
  }
39
39
  export function hslToHsv(hsl) {
40
40
  const l = hsl.l / percentDenominator, sl = hsl.s / percentDenominator, offset = 1, noValue = 0, v = l + sl * Math.min(l, offset - l), sv = !v ? noValue : double * (offset - l / v);
package/cjs/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { HsvColorManager } from "./HsvColorManager.js";
2
2
  export async function loadHsvColorPlugin(engine) {
3
- engine.checkVersion("4.3.2");
3
+ engine.checkVersion("4.4.0");
4
4
  await engine.pluginManager.register(e => {
5
5
  e.pluginManager.addColorManager("hsv", new HsvColorManager());
6
6
  });
package/cjs/index.lazy.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export async function loadHsvColorPlugin(engine) {
2
- engine.checkVersion("4.3.2");
2
+ engine.checkVersion("4.4.0");
3
3
  await engine.pluginManager.register(async (e) => {
4
4
  const { HsvColorManager } = await import("./HsvColorManager.js");
5
5
  e.pluginManager.addColorManager("hsv", new HsvColorManager());
package/cjs/utils.js CHANGED
@@ -33,8 +33,8 @@ export function rgbaToHsva(rgba) {
33
33
  ...rgbToHsv(rgba),
34
34
  };
35
35
  }
36
- export function getStyleFromHsv(color, hdr, opacity) {
37
- return getStyleFromHsl(hsvToHsl(color), hdr, opacity);
36
+ export function getStyleFromHsv(color, hdr, opacity, peakNits, mode) {
37
+ return getStyleFromHsl(hsvToHsl(color), hdr, opacity, peakNits, mode);
38
38
  }
39
39
  export function hslToHsv(hsl) {
40
40
  const l = hsl.l / percentDenominator, sl = hsl.s / percentDenominator, offset = 1, noValue = 0, v = l + sl * Math.min(l, offset - l), sv = !v ? noValue : double * (offset - l / v);
package/esm/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { HsvColorManager } from "./HsvColorManager.js";
2
2
  export async function loadHsvColorPlugin(engine) {
3
- engine.checkVersion("4.3.2");
3
+ engine.checkVersion("4.4.0");
4
4
  await engine.pluginManager.register(e => {
5
5
  e.pluginManager.addColorManager("hsv", new HsvColorManager());
6
6
  });
package/esm/index.lazy.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export async function loadHsvColorPlugin(engine) {
2
- engine.checkVersion("4.3.2");
2
+ engine.checkVersion("4.4.0");
3
3
  await engine.pluginManager.register(async (e) => {
4
4
  const { HsvColorManager } = await import("./HsvColorManager.js");
5
5
  e.pluginManager.addColorManager("hsv", new HsvColorManager());
package/esm/utils.js CHANGED
@@ -33,8 +33,8 @@ export function rgbaToHsva(rgba) {
33
33
  ...rgbToHsv(rgba),
34
34
  };
35
35
  }
36
- export function getStyleFromHsv(color, hdr, opacity) {
37
- return getStyleFromHsl(hsvToHsl(color), hdr, opacity);
36
+ export function getStyleFromHsv(color, hdr, opacity, peakNits, mode) {
37
+ return getStyleFromHsl(hsvToHsl(color), hdr, opacity, peakNits, mode);
38
38
  }
39
39
  export function hslToHsv(hsl) {
40
40
  const l = hsl.l / percentDenominator, sl = hsl.s / percentDenominator, offset = 1, noValue = 0, v = l + sl * Math.min(l, offset - l), sv = !v ? noValue : double * (offset - l / v);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsparticles/plugin-hsv-color",
3
- "version": "4.3.2",
3
+ "version": "4.4.0",
4
4
  "description": "tsParticles HSV color plugin",
5
5
  "homepage": "https://particles.js.org",
6
6
  "repository": {
@@ -106,7 +106,7 @@
106
106
  "./package.json": "./package.json"
107
107
  },
108
108
  "peerDependencies": {
109
- "@tsparticles/engine": "4.3.2"
109
+ "@tsparticles/engine": "4.4.0"
110
110
  },
111
111
  "publishConfig": {
112
112
  "access": "public"
package/report.html CHANGED
@@ -4930,7 +4930,7 @@ var drawChart = (function (exports) {
4930
4930
  </script>
4931
4931
  <script>
4932
4932
  /*<!--*/
4933
- const data = {"version":2,"tree":{"name":"root","children":[{"name":"tsparticles.plugin.hsvColor.js","children":[{"name":"dist/browser","children":[{"uid":"d32167a0-1","name":"utils.js"},{"uid":"d32167a0-3","name":"HsvColorManager.js"},{"uid":"d32167a0-5","name":"index.js"},{"uid":"d32167a0-7","name":"browser.js"}]}]}],"isRoot":true},"nodeParts":{"d32167a0-1":{"renderedLength":2190,"gzipLength":0,"brotliLength":0,"metaUid":"d32167a0-0"},"d32167a0-3":{"renderedLength":1706,"gzipLength":0,"brotliLength":0,"metaUid":"d32167a0-2"},"d32167a0-5":{"renderedLength":229,"gzipLength":0,"brotliLength":0,"metaUid":"d32167a0-4"},"d32167a0-7":{"renderedLength":179,"gzipLength":0,"brotliLength":0,"metaUid":"d32167a0-6"}},"nodeMetas":{"d32167a0-0":{"id":"/dist/browser/utils.js","moduleParts":{"tsparticles.plugin.hsvColor.js":"d32167a0-1"},"imported":[{"uid":"d32167a0-8"}],"importedBy":[{"uid":"d32167a0-2"}]},"d32167a0-2":{"id":"/dist/browser/HsvColorManager.js","moduleParts":{"tsparticles.plugin.hsvColor.js":"d32167a0-3"},"imported":[{"uid":"d32167a0-8"},{"uid":"d32167a0-0"}],"importedBy":[{"uid":"d32167a0-4"}]},"d32167a0-4":{"id":"/dist/browser/index.js","moduleParts":{"tsparticles.plugin.hsvColor.js":"d32167a0-5"},"imported":[{"uid":"d32167a0-2"}],"importedBy":[{"uid":"d32167a0-6"}]},"d32167a0-6":{"id":"/dist/browser/browser.js","moduleParts":{"tsparticles.plugin.hsvColor.js":"d32167a0-7"},"imported":[{"uid":"d32167a0-4"}],"importedBy":[],"isEntry":true},"d32167a0-8":{"id":"@tsparticles/engine","moduleParts":{},"imported":[],"importedBy":[{"uid":"d32167a0-2"},{"uid":"d32167a0-0"}],"isExternal":true}},"env":{"rollup":"4.62.2"},"options":{"gzip":false,"brotli":false,"sourcemap":false}};
4933
+ const data = {"version":2,"tree":{"name":"root","children":[{"name":"tsparticles.plugin.hsvColor.js","children":[{"name":"dist/browser","children":[{"uid":"08a94eb7-1","name":"utils.js"},{"uid":"08a94eb7-3","name":"HsvColorManager.js"},{"uid":"08a94eb7-5","name":"index.js"},{"uid":"08a94eb7-7","name":"browser.js"}]}]}],"isRoot":true},"nodeParts":{"08a94eb7-1":{"renderedLength":2190,"gzipLength":0,"brotliLength":0,"metaUid":"08a94eb7-0"},"08a94eb7-3":{"renderedLength":1706,"gzipLength":0,"brotliLength":0,"metaUid":"08a94eb7-2"},"08a94eb7-5":{"renderedLength":229,"gzipLength":0,"brotliLength":0,"metaUid":"08a94eb7-4"},"08a94eb7-7":{"renderedLength":179,"gzipLength":0,"brotliLength":0,"metaUid":"08a94eb7-6"}},"nodeMetas":{"08a94eb7-0":{"id":"/dist/browser/utils.js","moduleParts":{"tsparticles.plugin.hsvColor.js":"08a94eb7-1"},"imported":[{"uid":"08a94eb7-8"}],"importedBy":[{"uid":"08a94eb7-2"}]},"08a94eb7-2":{"id":"/dist/browser/HsvColorManager.js","moduleParts":{"tsparticles.plugin.hsvColor.js":"08a94eb7-3"},"imported":[{"uid":"08a94eb7-8"},{"uid":"08a94eb7-0"}],"importedBy":[{"uid":"08a94eb7-4"}]},"08a94eb7-4":{"id":"/dist/browser/index.js","moduleParts":{"tsparticles.plugin.hsvColor.js":"08a94eb7-5"},"imported":[{"uid":"08a94eb7-2"}],"importedBy":[{"uid":"08a94eb7-6"}]},"08a94eb7-6":{"id":"/dist/browser/browser.js","moduleParts":{"tsparticles.plugin.hsvColor.js":"08a94eb7-7"},"imported":[{"uid":"08a94eb7-4"}],"importedBy":[],"isEntry":true},"08a94eb7-8":{"id":"@tsparticles/engine","moduleParts":{},"imported":[],"importedBy":[{"uid":"08a94eb7-2"},{"uid":"08a94eb7-0"}],"isExternal":true}},"env":{"rollup":"4.63.1"},"options":{"gzip":false,"brotli":false,"sourcemap":false}};
4934
4934
 
4935
4935
  const run = () => {
4936
4936
  const width = window.innerWidth;
@@ -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
- /* Plugin v4.3.2 */
2
+ /* Plugin v4.4.0 */
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tsparticles/engine')) :
5
5
  typeof define === 'function' && define.amd ? define(['exports', '@tsparticles/engine'], factory) :
@@ -116,7 +116,7 @@
116
116
  }
117
117
 
118
118
  async function loadHsvColorPlugin(engine) {
119
- engine.checkVersion("4.3.2");
119
+ engine.checkVersion("4.4.0");
120
120
  await engine.pluginManager.register(e => {
121
121
  e.pluginManager.addColorManager("hsv", new HsvColorManager());
122
122
  });
@@ -1 +1 @@
1
- !function(s){s.__tsParticlesInternals=s.__tsParticlesInternals||{},s.__tsParticlesInternals.bundles=s.__tsParticlesInternals.bundles||{},s.__tsParticlesInternals.effects=s.__tsParticlesInternals.effects||{},s.__tsParticlesInternals.engine=s.__tsParticlesInternals.engine||{},s.__tsParticlesInternals.interactions=s.__tsParticlesInternals.interactions||{},s.__tsParticlesInternals.palettes=s.__tsParticlesInternals.palettes||{},s.__tsParticlesInternals.paths=s.__tsParticlesInternals.paths||{},s.__tsParticlesInternals.plugins=s.__tsParticlesInternals.plugins||{},s.__tsParticlesInternals.plugins=s.__tsParticlesInternals.plugins||{},s.__tsParticlesInternals.plugins.emittersShapes=s.__tsParticlesInternals.plugins.emittersShapes||{},s.__tsParticlesInternals.presets=s.__tsParticlesInternals.presets||{},s.__tsParticlesInternals.shapes=s.__tsParticlesInternals.shapes||{},s.__tsParticlesInternals.updaters=s.__tsParticlesInternals.updaters||{},s.__tsParticlesInternals.utils=s.__tsParticlesInternals.utils||{},s.__tsParticlesInternals.canvas=s.__tsParticlesInternals.canvas||{},s.__tsParticlesInternals.canvas=s.__tsParticlesInternals.canvas||{},s.__tsParticlesInternals.canvas.utils=s.__tsParticlesInternals.canvas.utils||{},s.__tsParticlesInternals.path=s.__tsParticlesInternals.path||{},s.__tsParticlesInternals.path=s.__tsParticlesInternals.path||{},s.__tsParticlesInternals.path.utils=s.__tsParticlesInternals.path.utils||{};var t="undefined"!=typeof Proxy?function(s){return new Proxy(s,{get:function(s,t){return t in s||(s[t]={}),s[t]}})}:function(s){return s};s.__tsParticlesInternals.bundles=t(s.__tsParticlesInternals.bundles),s.__tsParticlesInternals.effects=t(s.__tsParticlesInternals.effects),s.__tsParticlesInternals.interactions=t(s.__tsParticlesInternals.interactions),s.__tsParticlesInternals.palettes=t(s.__tsParticlesInternals.palettes),s.__tsParticlesInternals.paths=t(s.__tsParticlesInternals.paths),s.__tsParticlesInternals.plugins=t(s.__tsParticlesInternals.plugins),s.__tsParticlesInternals.plugins.emittersShapes=t(s.__tsParticlesInternals.plugins.emittersShapes),s.__tsParticlesInternals.presets=t(s.__tsParticlesInternals.presets),s.__tsParticlesInternals.shapes=t(s.__tsParticlesInternals.shapes),s.__tsParticlesInternals.updaters=t(s.__tsParticlesInternals.updaters),s.__tsParticlesInternals.utils=t(s.__tsParticlesInternals.utils),s.__tsParticlesInternals.canvas=t(s.__tsParticlesInternals.canvas),s.__tsParticlesInternals.path=t(s.__tsParticlesInternals.path),s.tsparticlesInternalExports=s.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(s,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@tsparticles/engine")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/engine"],t):t(((s="undefined"!=typeof globalThis?globalThis:s||self).__tsParticlesInternals=s.__tsParticlesInternals||{},s.__tsParticlesInternals.plugins=s.__tsParticlesInternals.plugins||{},s.__tsParticlesInternals.plugins.hsvColor=s.__tsParticlesInternals.plugins.hsvColor||{}),s.__tsParticlesInternals.engine)}(this,function(s,t){"use strict";function e(s){const e={b:0,g:0,r:0},n=s.h/60,a=s.s/t.percentDenominator,l=s.v/t.percentDenominator,r=l*a,i=r*(1-Math.abs(n%2-1));let _;if(n>=0&&n<=1?_={r:r,g:i,b:0}:n>1&&n<=2?_={r:i,g:r,b:0}:n>2&&n<=3?_={r:0,g:r,b:i}:n>3&&n<=4?_={r:0,g:i,b:r}:n>4&&n<=5?_={r:i,g:0,b:r}:n>5&&n<=6&&(_={r:r,g:0,b:i}),_){const s=l-r;e.r=Math.floor((_.r+s)*t.rgbMax),e.g=Math.floor((_.g+s)*t.rgbMax),e.b=Math.floor((_.b+s)*t.rgbMax)}return e}const n=/hsva?\(\s*(\d+)°\s*[\s,]\s*(\d+)%\s*[\s,]\s*(\d+)%\s*([\s,]\s*(0|1|0?\.\d+|(\d{1,3})%)\s*)?\)/i;class a{accepts(s){return s.startsWith("hsv")}handleColor(s){const t=s.value.hsv??s.value;if("h"in t&&"s"in t&&"v"in t)return e(t)}handleRangeColor(s){const n=s.value.hsv??s.value;if("h"in n&&"s"in n&&"v"in n)return e({h:t.getRangeValue(n.h),s:t.getRangeValue(n.s),v:t.getRangeValue(n.v)})}parseString(s){if(!this.accepts(s))return;const a=n.exec(s),l=1,r=2,i=3,_=5;return a?{a:(c={a:a.length>4?t.parseAlpha(a[_]):1,h:parseInt(a[l]??"0",10),s:parseInt(a[r]??"0",10),v:parseInt(a[i]??"0",10)}).a,...e(c)}:void 0;var c}}async function l(s){s.checkVersion("4.3.2"),await s.pluginManager.register(s=>{s.pluginManager.addColorManager("hsv",new a)})}const r=globalThis;r.__tsParticlesInternals=r.__tsParticlesInternals??{},r.loadHsvColorPlugin=l,s.loadHsvColorPlugin=l}),Object.assign(globalThis.window||globalThis,{loadHsvColorPlugin:(globalThis.__tsParticlesInternals.plugins.hsvColor||{}).loadHsvColorPlugin}),delete(globalThis.window||globalThis).tsparticlesInternalExports;
1
+ !function(s){s.__tsParticlesInternals=s.__tsParticlesInternals||{},s.__tsParticlesInternals.bundles=s.__tsParticlesInternals.bundles||{},s.__tsParticlesInternals.effects=s.__tsParticlesInternals.effects||{},s.__tsParticlesInternals.engine=s.__tsParticlesInternals.engine||{},s.__tsParticlesInternals.interactions=s.__tsParticlesInternals.interactions||{},s.__tsParticlesInternals.palettes=s.__tsParticlesInternals.palettes||{},s.__tsParticlesInternals.paths=s.__tsParticlesInternals.paths||{},s.__tsParticlesInternals.plugins=s.__tsParticlesInternals.plugins||{},s.__tsParticlesInternals.plugins=s.__tsParticlesInternals.plugins||{},s.__tsParticlesInternals.plugins.emittersShapes=s.__tsParticlesInternals.plugins.emittersShapes||{},s.__tsParticlesInternals.presets=s.__tsParticlesInternals.presets||{},s.__tsParticlesInternals.shapes=s.__tsParticlesInternals.shapes||{},s.__tsParticlesInternals.updaters=s.__tsParticlesInternals.updaters||{},s.__tsParticlesInternals.utils=s.__tsParticlesInternals.utils||{},s.__tsParticlesInternals.canvas=s.__tsParticlesInternals.canvas||{},s.__tsParticlesInternals.canvas=s.__tsParticlesInternals.canvas||{},s.__tsParticlesInternals.canvas.utils=s.__tsParticlesInternals.canvas.utils||{},s.__tsParticlesInternals.path=s.__tsParticlesInternals.path||{},s.__tsParticlesInternals.path=s.__tsParticlesInternals.path||{},s.__tsParticlesInternals.path.utils=s.__tsParticlesInternals.path.utils||{};var t="undefined"!=typeof Proxy?function(s){return new Proxy(s,{get:function(s,t){return t in s||(s[t]={}),s[t]}})}:function(s){return s};s.__tsParticlesInternals.bundles=t(s.__tsParticlesInternals.bundles),s.__tsParticlesInternals.effects=t(s.__tsParticlesInternals.effects),s.__tsParticlesInternals.interactions=t(s.__tsParticlesInternals.interactions),s.__tsParticlesInternals.palettes=t(s.__tsParticlesInternals.palettes),s.__tsParticlesInternals.paths=t(s.__tsParticlesInternals.paths),s.__tsParticlesInternals.plugins=t(s.__tsParticlesInternals.plugins),s.__tsParticlesInternals.plugins.emittersShapes=t(s.__tsParticlesInternals.plugins.emittersShapes),s.__tsParticlesInternals.presets=t(s.__tsParticlesInternals.presets),s.__tsParticlesInternals.shapes=t(s.__tsParticlesInternals.shapes),s.__tsParticlesInternals.updaters=t(s.__tsParticlesInternals.updaters),s.__tsParticlesInternals.utils=t(s.__tsParticlesInternals.utils),s.__tsParticlesInternals.canvas=t(s.__tsParticlesInternals.canvas),s.__tsParticlesInternals.path=t(s.__tsParticlesInternals.path),s.tsparticlesInternalExports=s.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(s,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@tsparticles/engine")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/engine"],t):t(((s="undefined"!=typeof globalThis?globalThis:s||self).__tsParticlesInternals=s.__tsParticlesInternals||{},s.__tsParticlesInternals.plugins=s.__tsParticlesInternals.plugins||{},s.__tsParticlesInternals.plugins.hsvColor=s.__tsParticlesInternals.plugins.hsvColor||{}),s.__tsParticlesInternals.engine)}(this,function(s,t){"use strict";function e(s){const e={b:0,g:0,r:0},n=s.h/60,a=s.s/t.percentDenominator,l=s.v/t.percentDenominator,r=l*a,i=r*(1-Math.abs(n%2-1));let _;if(n>=0&&n<=1?_={r:r,g:i,b:0}:n>1&&n<=2?_={r:i,g:r,b:0}:n>2&&n<=3?_={r:0,g:r,b:i}:n>3&&n<=4?_={r:0,g:i,b:r}:n>4&&n<=5?_={r:i,g:0,b:r}:n>5&&n<=6&&(_={r:r,g:0,b:i}),_){const s=l-r;e.r=Math.floor((_.r+s)*t.rgbMax),e.g=Math.floor((_.g+s)*t.rgbMax),e.b=Math.floor((_.b+s)*t.rgbMax)}return e}const n=/hsva?\(\s*(\d+)°\s*[\s,]\s*(\d+)%\s*[\s,]\s*(\d+)%\s*([\s,]\s*(0|1|0?\.\d+|(\d{1,3})%)\s*)?\)/i;class a{accepts(s){return s.startsWith("hsv")}handleColor(s){const t=s.value.hsv??s.value;if("h"in t&&"s"in t&&"v"in t)return e(t)}handleRangeColor(s){const n=s.value.hsv??s.value;if("h"in n&&"s"in n&&"v"in n)return e({h:t.getRangeValue(n.h),s:t.getRangeValue(n.s),v:t.getRangeValue(n.v)})}parseString(s){if(!this.accepts(s))return;const a=n.exec(s),l=1,r=2,i=3,_=5;return a?{a:(c={a:a.length>4?t.parseAlpha(a[_]):1,h:parseInt(a[l]??"0",10),s:parseInt(a[r]??"0",10),v:parseInt(a[i]??"0",10)}).a,...e(c)}:void 0;var c}}async function l(s){s.checkVersion("4.4.0"),await s.pluginManager.register(s=>{s.pluginManager.addColorManager("hsv",new a)})}const r=globalThis;r.__tsParticlesInternals=r.__tsParticlesInternals??{},r.loadHsvColorPlugin=l,s.loadHsvColorPlugin=l}),Object.assign(globalThis.window||globalThis,{loadHsvColorPlugin:(globalThis.__tsParticlesInternals.plugins.hsvColor||{}).loadHsvColorPlugin}),delete(globalThis.window||globalThis).tsparticlesInternalExports;
package/types/utils.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { type IHsl, type IHsla, type IHsv, type IHsva, type IRgb, type IRgba } from "@tsparticles/engine";
1
+ import { type HdrMode, type IHsl, type IHsla, type IHsv, type IHsva, type IRgb, type IRgba } from "@tsparticles/engine";
2
2
  export declare function rgbToHsv(rgb: IRgb): IHsv;
3
3
  export declare function rgbaToHsva(rgba: IRgba): IHsva;
4
- export declare function getStyleFromHsv(color: IHsv, hdr: boolean, opacity?: number): string;
4
+ export declare function getStyleFromHsv(color: IHsv, hdr: boolean, opacity?: number, peakNits?: number, mode?: HdrMode): string;
5
5
  export declare function hslToHsv(hsl: IHsl): IHsv;
6
6
  export declare function hslaToHsva(hsla: IHsla): IHsva;
7
7
  export declare function hsvToHsl(hsv: IHsv): IHsl;