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.
34 lines (33 loc) • 930 B
JavaScript
import { DrawStroke } from "./DrawStroke";
import { OptionsColor } from "../../../../Options/Classes/OptionsColor";
export class Draw {
constructor() {
this.enable = false;
this.stroke = new DrawStroke();
}
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 !== undefined) {
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);
}
}
}