1 | import { setRangeValue } from "../../Utils";
|
2 |
|
3 |
|
4 |
|
5 | export class ColorAnimation {
|
6 | constructor() {
|
7 | this.count = 0;
|
8 | this.enable = false;
|
9 | this.offset = 0;
|
10 | this.speed = 1;
|
11 | this.sync = true;
|
12 | }
|
13 | load(data) {
|
14 | if (data === undefined) {
|
15 | return;
|
16 | }
|
17 | if (data.count !== undefined) {
|
18 | this.count = data.count;
|
19 | }
|
20 | if (data.enable !== undefined) {
|
21 | this.enable = data.enable;
|
22 | }
|
23 | if (data.offset !== undefined) {
|
24 | this.offset = setRangeValue(data.offset);
|
25 | }
|
26 | if (data.speed !== undefined) {
|
27 | this.speed = data.speed;
|
28 | }
|
29 | if (data.sync !== undefined) {
|
30 | this.sync = data.sync;
|
31 | }
|
32 | }
|
33 | }
|