Centralize colors in theme.h and propagate true-black background

- Extract design tokens to firmware/src/theme.h (THEME_BG, THEME_PANEL,
  THEME_TEXT, etc.); ui.cpp aliases COL_* to the THEME_* tokens
- Splash container + canvas COL_EMPTY now use THEME_BG / 0x0000 instead
  of the hardcoded 0x0f0f0f / 0x10A2 dark grey
- tools/convert_to_c.js maps "transparent" palette entries to 0x0000
  (true black) so regenerated splash_animations.h matches the new bg
- Re-regenerate splash_animations.h
- Convert logo to RGB565A8 (alpha plane) so it composites against any
  background — no more grey halo around the upper-left logo on screens
  where the bg differs from the previous baked-in 0x18E3 color
This commit is contained in:
Hermann Björgvin Haraldsson
2026-05-11 01:04:11 +00:00
parent b34d99def8
commit b61936b42c
6 changed files with 1248 additions and 117 deletions
+2 -2
View File
@@ -26,7 +26,7 @@ function safeIdent(s) {
}
function hexToRgb565(hex) {
if (!hex || hex === 'transparent') return 0x10A2; // dark bg
if (!hex || hex === 'transparent') return 0x0000; // dark bg
let h = hex.replace('#', '');
if (h.length === 3) h = h.split('').map(c => c + c).join('');
const r = parseInt(h.substr(0, 2), 16);
@@ -36,7 +36,7 @@ function hexToRgb565(hex) {
}
function paletteToRgb565(palette) {
const out = new Array(PALETTE_SIZE).fill(0x10A2);
const out = new Array(PALETTE_SIZE).fill(0x0000);
for (let i = 0; i < palette.length && i < PALETTE_SIZE; i++) {
out[i] = hexToRgb565(palette[i]);
}