[themes] Color with pointers

This commit is contained in:
Laury
2022-02-11 18:41:00 +01:00
parent 84d88a3e8d
commit 63d1e0ee4e
175 changed files with 546 additions and 652 deletions

View File

@@ -230,20 +230,20 @@ KDColor MicroPython::Color::Parse(mp_obj_t input, Mode mode){
if (mp_obj_is_str(input)) {
size_t l;
const char * color = mp_obj_str_get_data(input, &l);
constexpr NamedColor pairs[] = {
NamedColor("blue", KDColorBlue),
NamedColor("b", KDColorBlue),
NamedColor("red", KDColorRed),
NamedColor("r", KDColorRed),
const NamedColor pairs[] = {
NamedColor("blue", &KDColorBlue),
NamedColor("b", &KDColorBlue),
NamedColor("red", &KDColorRed),
NamedColor("r", &KDColorRed),
NamedColor("green", Palette::Green),
NamedColor("g", Palette::Green),
NamedColor("yellow", KDColorYellow),
NamedColor("y", KDColorYellow),
NamedColor("yellow", &KDColorYellow),
NamedColor("y", &KDColorYellow),
NamedColor("brown", Palette::Brown),
NamedColor("black", KDColorBlack),
NamedColor("k", KDColorBlack),
NamedColor("white", KDColorWhite),
NamedColor("w", KDColorWhite),
NamedColor("black", &KDColorBlack),
NamedColor("k", &KDColorBlack),
NamedColor("white", &KDColorWhite),
NamedColor("w", &KDColorWhite),
NamedColor("pink", Palette::Pink),
NamedColor("orange", Palette::Orange),
NamedColor("purple", Palette::Purple),