tsparticles
Version:
Porting of the abandoned Vincent Garreau's particles.js, converted in TypeScript. Added many new cool features and various bug fixes.
40 lines (39 loc) • 1.11 kB
JavaScript
import { Color } from "./Color";
export class Shadow {
constructor() {
this.blur = 0;
this.color = new Color();
this.enable = false;
this.offset = {
x: 0,
y: 0,
};
this.color.value = "#000000";
}
load(data) {
if (data !== undefined) {
if (data.blur !== undefined) {
this.blur = data.blur;
}
if (data.color !== undefined) {
if (typeof data.color === "string") {
this.color.value = data.color;
}
else {
this.color.load(data.color);
}
}
if (data.enable !== undefined) {
this.enable = data.enable;
}
if (data.offset !== undefined) {
if (data.offset.x !== undefined) {
this.offset.x = data.offset.x;
}
if (data.offset.y !== undefined) {
this.offset.y = data.offset.y;
}
}
}
}
}