UNPKG

tsparticles

Version:

Easily create highly customizable particle, confetti and fireworks 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.

30 lines (29 loc) 999 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.PolygonMaskDrawStroke = void 0; const OptionsColor_1 = require("../../../../Options/Classes/OptionsColor"); const Utils_1 = require("../../../../Utils"); class PolygonMaskDrawStroke { constructor() { this.color = new OptionsColor_1.OptionsColor(); this.width = 0.5; this.opacity = 1; } load(data) { var _a; if (!data) { return; } this.color = OptionsColor_1.OptionsColor.create(this.color, data.color); if (typeof this.color.value === "string") { this.opacity = (_a = (0, Utils_1.stringToAlpha)(this.color.value)) !== null && _a !== void 0 ? _a : this.opacity; } if (data.opacity !== undefined) { this.opacity = data.opacity; } if (data.width !== undefined) { this.width = data.width; } } } exports.PolygonMaskDrawStroke = PolygonMaskDrawStroke;