[display] Make COLOR_OFF and COLOR_ON inline constexpr (#14044)

This commit is contained in:
J. Nick Koston
2026-02-18 08:22:07 -06:00
committed by GitHub
parent a3d7e76992
commit fb35ddebb9
2 changed files with 3 additions and 4 deletions
+1 -2
View File
@@ -9,8 +9,7 @@ namespace esphome {
namespace display {
static const char *const TAG = "display";
const Color COLOR_OFF(0, 0, 0, 0);
const Color COLOR_ON(255, 255, 255, 255);
// COLOR_OFF and COLOR_ON are now inline constexpr in display.h
void Display::fill(Color color) { this->filled_rectangle(0, 0, this->get_width(), this->get_height(), color); }
void Display::clear() { this->fill(COLOR_OFF); }
+2 -2
View File
@@ -298,9 +298,9 @@ using display_writer_t = DisplayWriter<Display>;
}
/// Turn the pixel OFF.
extern const Color COLOR_OFF;
inline constexpr Color COLOR_OFF(0, 0, 0, 0);
/// Turn the pixel ON.
extern const Color COLOR_ON;
inline constexpr Color COLOR_ON(255, 255, 255, 255);
class BaseImage {
public: