tsparticles
Version:
Easily create highly customizable particle animations and use them as animated backgrounds for your website. Ready to use components available also for React, Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact, Riot.js, Inferno.
35 lines (34 loc) • 1.1 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.AnimatableColor = void 0;
const OptionsColor_1 = require("./OptionsColor");
const HslAnimation_1 = require("./HslAnimation");
class AnimatableColor extends OptionsColor_1.OptionsColor {
constructor() {
super();
this.animation = new HslAnimation_1.HslAnimation();
}
static create(source, data) {
const color = source !== null && source !== void 0 ? source : new AnimatableColor();
if (data !== undefined) {
color.load(typeof data === "string" ? { value: data } : data);
}
return color;
}
load(data) {
super.load(data);
if (!data) {
return;
}
const colorAnimation = data.animation;
if (colorAnimation !== undefined) {
if (colorAnimation.enable !== undefined) {
this.animation.h.load(colorAnimation);
}
else {
this.animation.load(data.animation);
}
}
}
}
exports.AnimatableColor = AnimatableColor;
;