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.

35 lines (34 loc) 949 B
import { OptionsColor } from "../../../../Options/Classes/OptionsColor"; import { PolygonMaskDrawStroke } from "./PolygonMaskDrawStroke"; export class PolygonMaskDraw { constructor() { this.enable = false; this.stroke = new PolygonMaskDrawStroke(); } get lineWidth() { return this.stroke.width; } set lineWidth(value) { this.stroke.width = value; } get lineColor() { return this.stroke.color; } set lineColor(value) { this.stroke.color = OptionsColor.create(this.stroke.color, value); } load(data) { var _a; if (!data) { return; } if (data.enable !== undefined) { this.enable = data.enable; } const stroke = (_a = data.stroke) !== null && _a !== void 0 ? _a : { color: data.lineColor, width: data.lineWidth, }; this.stroke.load(stroke); } }