aboutsummaryrefslogtreecommitdiff
path: root/src/pattern.js
diff options
context:
space:
mode:
authorDeterminant <ted.sybil@gmail.com>2019-02-11 00:13:45 -0500
committerDeterminant <ted.sybil@gmail.com>2019-02-11 00:13:45 -0500
commit7ec26813a0cae0996f2d5873b9bdd1aeede68d41 (patch)
tree442bccf6f7de6d8b6e32a33c145377d62f5f88ab /src/pattern.js
parent8a0f7d58a136e87f71b790bbbb489af111472796 (diff)
support custom color
Diffstat (limited to 'src/pattern.js')
-rw-r--r--src/pattern.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/pattern.js b/src/pattern.js
index b4100e2..858f2a3 100644
--- a/src/pattern.js
+++ b/src/pattern.js
@@ -22,11 +22,12 @@ export class Pattern {
}
export class PatternEntry {
- constructor(name, idx, calPattern, eventPattern) {
+ constructor(name, idx, calPattern, eventPattern, color) {
this.name = name;
this.idx = idx;
this.cal = calPattern;
this.event = eventPattern;
+ this.color = color;
}
deflate() {
@@ -34,12 +35,14 @@ export class PatternEntry {
name: this.name,
idx: this.idx,
cal: this.cal.deflate(),
- event: this.event.deflate()
+ event: this.event.deflate(),
+ color: this.color
};
}
- static defaultPatternEntry = (idx) => new PatternEntry('', idx, Pattern.emptyPattern(), Pattern.anyPattern());
+ static defaultPatternEntry = (idx) => new PatternEntry('', idx, Pattern.emptyPattern(), Pattern.anyPattern(), {background: null});
static inflate = obj => new PatternEntry(
obj.name, obj.idx,
- Pattern.inflate(obj.cal), Pattern.inflate(obj.event));
+ Pattern.inflate(obj.cal), Pattern.inflate(obj.event),
+ obj.color);
}