UNPKG

tsparticles

Version:

Porting of the abandoned Vincent Garreau's particles.js, converted in TypeScript. Added many new cool features and various bug fixes.

28 lines (27 loc) 783 B
import { Color } from "./Color"; export class Trail { constructor() { this.enable = false; this.length = 10; this.fillColor = new Color(); this.fillColor.value = "#000000"; } load(data) { if (data !== undefined) { if (data.enable !== undefined) { this.enable = data.enable; } if (data.fillColor !== undefined) { if (typeof data.fillColor === "string") { this.fillColor.value = data.fillColor; } else { this.fillColor.load(data.fillColor); } } if (data.length !== undefined) { this.length = data.length; } } } }