Skip to content

Commit bb9877b

Browse files
Added the possibility to choose block colors for each type
1 parent 396fed5 commit bb9877b

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

blocktypeconfig.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@
99
"c2": "Integer",
1010
"c3": "Real",
1111
"c4": "Text(80, 10)"
12-
}
12+
},
13+
"bg_color": "yellow",
14+
"fg_color": "blue",
15+
"sel_border_color": "green",
16+
"border_color": "#EEE"
1317
},
1418
"Type-B": {
1519

static/index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ class DefaultConfBlock extends Block {
2121
}
2222
}
2323
}
24+
25+
if(type.bg_color != null) this.bg_color = type.bg_color;
26+
if(type.fg_color != null) this.fg_color = type.fg_color;
27+
if(type.border_color != null) this.border_color = type.border_color;
28+
if(type.sel_border_color != null) {
29+
30+
this.sel_border_color = type.sel_border_color;
31+
}
2432
}
2533

2634
setConfig(prop, value) {

0 commit comments

Comments
 (0)