I love being able to set widget color, thank you for that. I have two suggestions to make the API easier for makers:
-
Overload
.setProperty(int, "color", char*)
to accept a uint32_t value like0xFF00FF
in addition to the char array"#FF00FF"
. This avoids people having to figure out sprintf or String::format for their platforms. I often see RGB colors represented byuint32_t
, especially in color calculation functions. -
Consider adding a
setColor(uint32_t)
(or justcolor
) method to the base Widget class, so that you could do more object-oriented expressions like:WidgetLED led1(V1);
led1.on();
led1.color(0xFF0000); // uint32_t
// …
led1.color("#0000FF"); // html string
// …
led1.color(0, 255, 0); // You could even overload to accept R, G, B
What do you think?