-
Notifications
You must be signed in to change notification settings - Fork 0
/
themes.js
74 lines (69 loc) · 1.71 KB
/
themes.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
const themes = {
blue: {
messageBg: 'blue',
labelBg: 'blackBright',
labelColor: 'white',
messageColor: 'white',
},
red: {
messageBg: 'red',
labelBg: 'blackBright',
labelColor: 'white',
messageColor: 'white',
},
green: {
messageBg: 'green',
labelBg: 'blackBright',
labelColor: 'white',
messageColor: 'white',
},
yellow: {
messageBg: 'yellow',
labelBg: 'blackBright',
labelColor: 'white',
messageColor: 'black',
},
cyan: {
messageBg: 'cyan',
labelBg: 'blackBright',
labelColor: 'white',
messageColor: 'black',
},
magenta: {
messageBg: 'magenta',
labelBg: 'blackBright',
labelColor: 'white',
messageColor: 'black',
},
failed: {
messageBg: 'red',
labelBg: 'blackBright',
labelColor: 'white',
messageColor: 'white',
},
success: {
messageBg: 'green',
labelBg: 'blackBright',
labelColor: 'white',
messageColor: 'white',
},
};
module.exports = {
...themes,
exists(val) { return val in this; },
getOptionsForTheme(theme, swapTheme) {
if (!this.exists(theme)) {
return {};
}
const themeOpts = { ...this[theme] };
if (swapTheme) {
const pLblColor = themeOpts.labelColor;
themeOpts.labelColor = themeOpts.messageColor;
themeOpts.messageColor = pLblColor;
const pLblBg = themeOpts.labelBg;
themeOpts.labelBg = themeOpts.messageBg;
themeOpts.messageBg = pLblBg;
}
return themeOpts;
}
};