tsparticles
Version:
Porting of the abandoned Vincent Garreau's particles.js, converted in TypeScript. Added many new cool features and various bug fixes.
25 lines (24 loc) • 642 B
JavaScript
import { Color } from "./Color";
export class Stroke {
constructor() {
this.color = new Color();
this.width = 0;
this.opacity = 1;
this.color.value = "#ff0000";
}
load(data) {
if (data !== undefined) {
if (data.color !== undefined) {
if (typeof data.color === "string") {
this.color.value = data.color;
}
else {
this.color.load(data.color);
}
}
if (data.width !== undefined) {
this.width = data.width;
}
}
}
}