calendar: use hardware version to set color scheme

pull/1126/head
Minges, Alexander Ralph Michael (almin100) 2021-12-17 14:12:58 +01:00
parent bae67ecf6d
commit a67ef83bd8
3 changed files with 13 additions and 5 deletions

View File

@ -1,4 +1,4 @@
0.01: Basic calendar
0.02: Make Bangle 2 compatible
0.03: Add setting to start week on Sunday
0.04: Add setting to switch color schemes. Default color scheme will now use colors that are not dithered on Bangle 2. Use localized names for months and days of the week (Language app needed).
0.04: Add setting to switch color schemes. On Bangle 2 non-dithering colors will be used by default. Use localized names for months and days of the week (Language app needed).

View File

@ -20,10 +20,14 @@ const yellow = "#ffff00";
let settings = require('Storage').readJSON("calendar.json", true) || {};
if (settings.startOnSun === undefined)
settings.startOnSun = false;
if (settings.ndColor === undefined)
settings.ndColor = true;
if (settings.ndColors === undefined)
if (process.env.HWVERSION == 2) {
settings.ndColors = true;
} else {
settings.ndColors = false;
}
if (settings.ndColor === true) {
if (settings.ndColors === true) {
let bgColor = white;
let bgColorMonth = blue;
let bgColorDow = black;

View File

@ -4,7 +4,11 @@
if (settings.startOnSun === undefined)
settings.startOnSun = false;
if (settings.ndColors === undefined)
settings.ndColors = true;
if (process.env.HWVERSION == 2) {
settings.ndColors = true;
} else {
settings.ndColors = false;
}
function writeSettings() {
require('Storage').writeJSON(FILE, settings);