UNPKG

@tsparticles/plugin-polygon-mask

Version:

tsParticles polygon mask plugin

29 lines (28 loc) 938 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.PolygonMaskDrawStroke = void 0; const engine_1 = require("@tsparticles/engine"); class PolygonMaskDrawStroke { constructor(engine) { this._engine = engine; this.color = new engine_1.OptionsColor(); this.width = 0.5; this.opacity = 1; } load(data) { if ((0, engine_1.isNull)(data)) { return; } this.color = engine_1.OptionsColor.create(this.color, data.color); if ((0, engine_1.isString)(this.color.value)) { this.opacity = (0, engine_1.stringToAlpha)(this._engine, this.color.value) ?? this.opacity; } if (data.opacity !== undefined) { this.opacity = data.opacity; } if (data.width !== undefined) { this.width = data.width; } } } exports.PolygonMaskDrawStroke = PolygonMaskDrawStroke;