UNPKG

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.

29 lines (28 loc) 994 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DrawStroke = void 0; const OptionsColor_1 = require("../../../../Options/Classes/OptionsColor"); const Utils_1 = require("../../../../Utils"); class DrawStroke { constructor() { this.color = new OptionsColor_1.OptionsColor(); this.width = 0.5; this.opacity = 1; } load(data) { var _a; if (data !== undefined) { this.color = OptionsColor_1.OptionsColor.create(this.color, data.color); if (typeof this.color.value === "string") { this.opacity = (_a = Utils_1.ColorUtils.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.DrawStroke = DrawStroke;