mirror of https://github.com/espruino/BangleApps
set theme to light, add black as an option for foreground color
parent
650add7c84
commit
852e25b189
|
@ -36,6 +36,10 @@ switch (settings.foregroundColor) {
|
|||
foregroundColor = COLOUR_WHITE;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
foregroundColor = COLOUR_BLACK;
|
||||
break;
|
||||
|
||||
default:
|
||||
foregroundColor = COLOUR_BLACK; // to detect problems
|
||||
break;
|
||||
|
@ -144,7 +148,7 @@ function draw() {
|
|||
}
|
||||
|
||||
// Clear the screen once, at startup
|
||||
g.setTheme({ bg: COLOUR_VPW_GREEN, fg: foregroundColor, dark: true }).clear();
|
||||
g.setTheme({ bg: COLOUR_VPW_GREEN, fg: foregroundColor, dark: false }).clear();
|
||||
// draw immediately at first, queue update
|
||||
draw();
|
||||
// Stop updates when LCD is off, restart when on
|
||||
|
|
|
@ -1,28 +1,28 @@
|
|||
(function(back) {
|
||||
var FILE = "vpw_clock.settings.json";
|
||||
// Load settings
|
||||
var settings = Object.assign({
|
||||
foregroundColor: 0,
|
||||
}, require('Storage').readJSON(FILE, true) || {});
|
||||
var FILE = "vpw_clock.settings.json";
|
||||
// Load settings
|
||||
var settings = Object.assign({
|
||||
foregroundColor: 0,
|
||||
}, require('Storage').readJSON(FILE, true) || {});
|
||||
|
||||
function writeSettings() {
|
||||
require('Storage').writeJSON(FILE, settings);
|
||||
}
|
||||
function writeSettings() {
|
||||
require('Storage').writeJSON(FILE, settings);
|
||||
}
|
||||
|
||||
var foregroundColors = ["Red", "Purple", "White"];
|
||||
var foregroundColors = ["Red", "Purple", "White", "Black"];
|
||||
|
||||
// Show the menu
|
||||
E.showMenu({
|
||||
"" : { "title" : "Vaporwave Sunset" },
|
||||
"< Back" : () => back(),
|
||||
'Foreground color': {
|
||||
value: 0|settings.foregroundColor, // 0| converts undefined to 0
|
||||
min: 0, max: 2,
|
||||
onchange: v => {
|
||||
settings.foregroundColor = v;
|
||||
writeSettings();
|
||||
},
|
||||
format: function (v) {return foregroundColors[v];}
|
||||
// Show the menu
|
||||
E.showMenu({
|
||||
"" : { "title" : "Vaporwave Sunset" },
|
||||
"< Back" : () => back(),
|
||||
'Foreground color': {
|
||||
value: 0|settings.foregroundColor, // 0| converts undefined to 0
|
||||
min: 0, max: 3,
|
||||
onchange: v => {
|
||||
settings.foregroundColor = v;
|
||||
writeSettings();
|
||||
},
|
||||
});
|
||||
})
|
||||
format: function (v) {return foregroundColors[v];}
|
||||
},
|
||||
});
|
||||
})
|
Loading…
Reference in New Issue