Files
homeassistant_espscreen/components/smart_display/tile_palette.h
T
Max Gramser 437b8c55b4 Calendar analog clock with ticks and numerals; tiles without background
Firmware 0.2.16: the analog clock uses index strokes with 12/3/6/9
numerals on large cards and shows a calendar block (weekday, big day,
short month) beside the dial on single tiles; wide cards keep the digital
time and date. New palette key 'none' hides only the card fill and
border: geometry, padding and the pressed flash stay identical. Skeleton
frames and the render self-test honour the transparency.

App 0.2.15: 'Geen' in the background palette with a dashed mockup tile,
min_firmware 0.2.16 for such layouts, demo layout with the bare calendar
clock (--wide for the double-width clock). README and AGENTS note that
every push is a release and bumps the add-on version.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-13 09:52:33 +02:00

22 lines
754 B
C++

#pragma once
#include <cstdint>
#include <string>
namespace tile_palette {
// Match the editor palette; all backgrounds are chosen for dark text.
inline uint32_t color(const std::string &name) {
if(name=="red")return 0xFADADD;
if(name=="orange")return 0xFFE1C6;
if(name=="yellow")return 0xFFF0C2;
if(name=="green")return 0xD9EEDC;
if(name=="mint")return 0xD5F0EA;
if(name=="blue")return 0xD9EAFB;
if(name=="purple")return 0xE9DDF5;
if(name=="pink")return 0xF7DDEC;
if(name=="gray")return 0xE5E7EB;
return 0; // Automatic/default, including unknown future palette names.
}
// "Geen": no card behind the tile contents. Older firmware treats it as automatic.
inline bool transparent(const std::string &name) { return name=="none"; }
}