mirror of https://github.com/espruino/BangleApps
28 lines
773 B
JavaScript
28 lines
773 B
JavaScript
|
(function(back) {
|
||
|
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);
|
||
|
}
|
||
|
|
||
|
var foregroundColors = ["Red", "Purple", "White"];
|
||
|
|
||
|
// 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];}
|
||
|
},
|
||
|
});
|
||
|
})
|