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:
@@ -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]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user