Socket
Socket
Sign inDemoInstall

tsparticles-updater-color

Package Overview
Dependencies
Maintainers
2
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tsparticles-updater-color - npm Package Compare versions

Comparing version 2.5.3 to 2.6.0

6

browser/ColorUpdater.js

@@ -9,6 +9,6 @@ import { getHslAnimationFromHsl, randomInRange, rangeColorToHsl } from "tsparticles-engine";

const offset = randomInRange(valueAnimation.offset), velocity = ((_a = value.velocity) !== null && _a !== void 0 ? _a : 0) * delta.factor + offset * 3.6, decay = (_b = value.decay) !== null && _b !== void 0 ? _b : 1;
if (!decrease || colorValue.status === 0) {
if (!decrease || colorValue.status === "increasing") {
colorValue.value += velocity;
if (decrease && colorValue.value > max) {
colorValue.status = 1;
colorValue.status = "decreasing";
colorValue.value -= colorValue.value % max;

@@ -20,3 +20,3 @@ }

if (colorValue.value < 0) {
colorValue.status = 0;
colorValue.status = "increasing";
colorValue.value += colorValue.value;

@@ -23,0 +23,0 @@ }

@@ -12,6 +12,6 @@ "use strict";

const offset = (0, tsparticles_engine_1.randomInRange)(valueAnimation.offset), velocity = ((_a = value.velocity) !== null && _a !== void 0 ? _a : 0) * delta.factor + offset * 3.6, decay = (_b = value.decay) !== null && _b !== void 0 ? _b : 1;
if (!decrease || colorValue.status === 0) {
if (!decrease || colorValue.status === "increasing") {
colorValue.value += velocity;
if (decrease && colorValue.value > max) {
colorValue.status = 1;
colorValue.status = "decreasing";
colorValue.value -= colorValue.value % max;

@@ -23,3 +23,3 @@ }

if (colorValue.value < 0) {
colorValue.status = 0;
colorValue.status = "increasing";
colorValue.value += colorValue.value;

@@ -26,0 +26,0 @@ }

@@ -9,6 +9,6 @@ import { getHslAnimationFromHsl, randomInRange, rangeColorToHsl } from "tsparticles-engine";

const offset = randomInRange(valueAnimation.offset), velocity = ((_a = value.velocity) !== null && _a !== void 0 ? _a : 0) * delta.factor + offset * 3.6, decay = (_b = value.decay) !== null && _b !== void 0 ? _b : 1;
if (!decrease || colorValue.status === 0) {
if (!decrease || colorValue.status === "increasing") {
colorValue.value += velocity;
if (decrease && colorValue.value > max) {
colorValue.status = 1;
colorValue.status = "decreasing";
colorValue.value -= colorValue.value % max;

@@ -20,3 +20,3 @@ }

if (colorValue.value < 0) {
colorValue.status = 0;
colorValue.status = "increasing";
colorValue.value += colorValue.value;

@@ -23,0 +23,0 @@ }

{
"name": "tsparticles-updater-color",
"version": "2.5.3",
"version": "2.6.0",
"description": "tsParticles particles color updater",

@@ -77,4 +77,4 @@ "homepage": "https://particles.js.org",

"dependencies": {
"tsparticles-engine": "^2.5.2"
"tsparticles-engine": "^2.6.0"
}
}

@@ -7,3 +7,3 @@ /*!

* How to use? : Check the GitHub README
* v2.5.3
* v2.6.0
*/

@@ -111,6 +111,6 @@ (function webpackUniversalModuleDefinition(root, factory) {

decay = (_b = value.decay) !== null && _b !== void 0 ? _b : 1;
if (!decrease || colorValue.status === 0) {
if (!decrease || colorValue.status === "increasing") {
colorValue.value += velocity;
if (decrease && colorValue.value > max) {
colorValue.status = 1;
colorValue.status = "decreasing";
colorValue.value -= colorValue.value % max;

@@ -121,3 +121,3 @@ }

if (colorValue.value < 0) {
colorValue.status = 0;
colorValue.status = "increasing";
colorValue.value += colorValue.value;

@@ -124,0 +124,0 @@ }

/*! For license information please see tsparticles.updater.color.min.js.LICENSE.txt */
!function(o,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 t="object"==typeof exports?e(require("tsparticles-engine")):e(o.window);for(var r in t)("object"==typeof exports?exports:o)[r]=t[r]}}(this,(o=>(()=>{"use strict";var e={961:e=>{e.exports=o}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var l=t[o]={exports:{}};return e[o](l,l.exports,r),l.exports}r.d=(o,e)=>{for(var t in e)r.o(e,t)&&!r.o(o,t)&&Object.defineProperty(o,t,{enumerable:!0,get:e[t]})},r.o=(o,e)=>Object.prototype.hasOwnProperty.call(o,e),r.r=o=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})};var n={};return(()=>{r.r(n),r.d(n,{loadColorUpdater:()=>l});var o=r(961);function e(e,t,r,n,l){var i,a;const s=t;if(!s||!r.enable)return;const c=(0,o.randomInRange)(r.offset),d=(null!==(i=t.velocity)&&void 0!==i?i:0)*e.factor+3.6*c,u=null!==(a=t.decay)&&void 0!==a?a:1;l&&0!==s.status?(s.value-=d,s.value<0&&(s.status=0,s.value+=s.value)):(s.value+=d,l&&s.value>n&&(s.status=1,s.value-=s.value%n)),s.velocity&&1!==u&&(s.velocity*=u),s.value>n&&(s.value%=n)}class t{constructor(o){this.container=o}init(e){const t=(0,o.rangeColorToHsl)(e.options.color,e.id,e.options.reduceDuplicates);t&&(e.color=(0,o.getHslAnimationFromHsl)(t,e.options.color.animation,this.container.retina.reduceFactor))}isEnabled(o){var e,t,r;const n=o.options.color.animation;return!o.destroyed&&!o.spawning&&(void 0!==(null===(e=o.color)||void 0===e?void 0:e.h.value)&&n.h.enable||void 0!==(null===(t=o.color)||void 0===t?void 0:t.s.value)&&n.s.enable||void 0!==(null===(r=o.color)||void 0===r?void 0:r.l.value)&&n.l.enable)}update(o,t){!function(o,t){var r,n,l;const i=o.options.color.animation;void 0!==(null===(r=o.color)||void 0===r?void 0:r.h)&&e(t,o.color.h,i.h,360,!1),void 0!==(null===(n=o.color)||void 0===n?void 0:n.s)&&e(t,o.color.s,i.s,100,!0),void 0!==(null===(l=o.color)||void 0===l?void 0:l.l)&&e(t,o.color.l,i.l,100,!0)}(o,t)}}async function l(o){await o.addParticleUpdater("color",(o=>new t(o)))}})(),n})()));
!function(o,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 t="object"==typeof exports?e(require("tsparticles-engine")):e(o.window);for(var r in t)("object"==typeof exports?exports:o)[r]=t[r]}}(this,(o=>(()=>{"use strict";var e={961:e=>{e.exports=o}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var i=t[o]={exports:{}};return e[o](i,i.exports,r),i.exports}r.d=(o,e)=>{for(var t in e)r.o(e,t)&&!r.o(o,t)&&Object.defineProperty(o,t,{enumerable:!0,get:e[t]})},r.o=(o,e)=>Object.prototype.hasOwnProperty.call(o,e),r.r=o=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})};var n={};return(()=>{r.r(n),r.d(n,{loadColorUpdater:()=>i});var o=r(961);function e(e,t,r,n,i){var l,a;const s=t;if(!s||!r.enable)return;const c=(0,o.randomInRange)(r.offset),d=(null!==(l=t.velocity)&&void 0!==l?l:0)*e.factor+3.6*c,u=null!==(a=t.decay)&&void 0!==a?a:1;i&&"increasing"!==s.status?(s.value-=d,s.value<0&&(s.status="increasing",s.value+=s.value)):(s.value+=d,i&&s.value>n&&(s.status="decreasing",s.value-=s.value%n)),s.velocity&&1!==u&&(s.velocity*=u),s.value>n&&(s.value%=n)}class t{constructor(o){this.container=o}init(e){const t=(0,o.rangeColorToHsl)(e.options.color,e.id,e.options.reduceDuplicates);t&&(e.color=(0,o.getHslAnimationFromHsl)(t,e.options.color.animation,this.container.retina.reduceFactor))}isEnabled(o){var e,t,r;const n=o.options.color.animation;return!o.destroyed&&!o.spawning&&(void 0!==(null===(e=o.color)||void 0===e?void 0:e.h.value)&&n.h.enable||void 0!==(null===(t=o.color)||void 0===t?void 0:t.s.value)&&n.s.enable||void 0!==(null===(r=o.color)||void 0===r?void 0:r.l.value)&&n.l.enable)}update(o,t){!function(o,t){var r,n,i;const l=o.options.color.animation;void 0!==(null===(r=o.color)||void 0===r?void 0:r.h)&&e(t,o.color.h,l.h,360,!1),void 0!==(null===(n=o.color)||void 0===n?void 0:n.s)&&e(t,o.color.s,l.s,100,!0),void 0!==(null===(i=o.color)||void 0===i?void 0:i.l)&&e(t,o.color.l,l.l,100,!0)}(o,t)}}async function i(o){await o.addParticleUpdater("color",(o=>new t(o)))}})(),n})()));

@@ -7,3 +7,3 @@ /*!

* How to use? : Check the GitHub README
* v2.5.3
* v2.6.0
*/

@@ -21,6 +21,6 @@ (function (factory) {

const offset = (0, tsparticles_engine_1.randomInRange)(valueAnimation.offset), velocity = ((_a = value.velocity) !== null && _a !== void 0 ? _a : 0) * delta.factor + offset * 3.6, decay = (_b = value.decay) !== null && _b !== void 0 ? _b : 1;
if (!decrease || colorValue.status === 0) {
if (!decrease || colorValue.status === "increasing") {
colorValue.value += velocity;
if (decrease && colorValue.value > max) {
colorValue.status = 1;
colorValue.status = "decreasing";
colorValue.value -= colorValue.value % max;

@@ -32,3 +32,3 @@ }

if (colorValue.value < 0) {
colorValue.status = 0;
colorValue.status = "increasing";
colorValue.value += colorValue.value;

@@ -35,0 +35,0 @@ }

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc