Change color_picker by using if is blue return color blue
This commit is contained in:
2023-11-24 02:27:31 +01:00
parent 4da408dadf
commit fb8abbb753

View File

@@ -224,85 +224,84 @@ void mug_init(void) {
} }
uint32_t color_picker(char* color) { uint32_t color_picker(char* color) {
uint32_t output = LCD_BLACK;
if(strcmp((const char*)color, "blue") == 0) { if(strcmp((const char*)color, "blue") == 0) {
output = LCD_BLUE; return LCD_BLUE;
} }
if(strcmp((const char*)color, "green") == 0) { if(strcmp((const char*)color, "green") == 0) {
output = LCD_GREEN; return LCD_GREEN;
} }
if(strcmp((const char*)color, "red") == 0) { if(strcmp((const char*)color, "red") == 0) {
output = LCD_RED; return LCD_RED;
} }
if(strcmp((const char*)color, "cyan") == 0) { if(strcmp((const char*)color, "cyan") == 0) {
output = LCD_CYAN; return LCD_CYAN;
} }
if(strcmp((const char*)color, "magenta") == 0) { if(strcmp((const char*)color, "magenta") == 0) {
output = LCD_MAGENTA; return LCD_MAGENTA;
} }
if(strcmp((const char*)color, "yellow") == 0) { if(strcmp((const char*)color, "yellow") == 0) {
output = LCD_YELLOW; return LCD_YELLOW;
} }
if(strcmp((const char*)color, "light blue") == 0) { if(strcmp((const char*)color, "light blue") == 0) {
output = LCD_LIGHTBLUE; return LCD_LIGHTBLUE;
} }
if(strcmp((const char*)color, "light green") == 0) { if(strcmp((const char*)color, "light green") == 0) {
output = LCD_LIGHTGREEN; return LCD_LIGHTGREEN;
} }
if(strcmp((const char*)color, "light red") == 0) { if(strcmp((const char*)color, "light red") == 0) {
output = LCD_LIGHTRED; return LCD_LIGHTRED;
} }
if(strcmp((const char*)color, "light cyan") == 0) { if(strcmp((const char*)color, "light cyan") == 0) {
output = LCD_LIGHTCYAN; return LCD_LIGHTCYAN;
} }
if(strcmp((const char*)color, "light magenta") == 0) { if(strcmp((const char*)color, "light magenta") == 0) {
output = LCD_LIGHTMAGENTA; return LCD_LIGHTMAGENTA;
} }
if(strcmp((const char*)color, "light yellow") == 0) { if(strcmp((const char*)color, "light yellow") == 0) {
output = LCD_LIGHTYELLOW; return LCD_LIGHTYELLOW;
} }
if(strcmp((const char*)color, "dark blue") == 0) { if(strcmp((const char*)color, "dark blue") == 0) {
output = LCD_DARKBLUE; return LCD_DARKBLUE;
} }
if(strcmp((const char*)color, "dark green") == 0) { if(strcmp((const char*)color, "dark green") == 0) {
output = LCD_DARKGREEN; return LCD_DARKGREEN;
} }
if(strcmp((const char*)color, "dark red") == 0) { if(strcmp((const char*)color, "dark red") == 0) {
output = LCD_DARKRED; return LCD_DARKRED;
} }
if(strcmp((const char*)color, "dark cyan") == 0) { if(strcmp((const char*)color, "dark cyan") == 0) {
output = LCD_DARKCYAN; return LCD_DARKCYAN;
} }
if(strcmp((const char*)color, "dark magenta") == 0) { if(strcmp((const char*)color, "dark magenta") == 0) {
output = LCD_DARKMAGENTA; return LCD_DARKMAGENTA;
} }
if(strcmp((const char*)color, "dark yellow") == 0) { if(strcmp((const char*)color, "dark yellow") == 0) {
output = LCD_DARKYELLOW; return LCD_DARKYELLOW;
} }
if(strcmp((const char*)color, "white") == 0) { if(strcmp((const char*)color, "white") == 0) {
output = LCD_WHITE; return LCD_WHITE;
} }
if(strcmp((const char*)color, "light gray") == 0) { if(strcmp((const char*)color, "light gray") == 0) {
output = LCD_LIGHTGRAY; return LCD_LIGHTGRAY;
} }
if(strcmp((const char*)color, "gray") == 0) { if(strcmp((const char*)color, "gray") == 0) {
output = LCD_GRAY; return LCD_GRAY;
} }
if(strcmp((const char*)color, "dark gray") == 0) { if(strcmp((const char*)color, "dark gray") == 0) {
output = LCD_DARKGRAY; return LCD_DARKGRAY;
} }
if(strcmp((const char*)color, "black") == 0) { if(strcmp((const char*)color, "black") == 0) {
output = LCD_BLACK; return LCD_BLACK;
} }
if(strcmp((const char*)color, "brown") == 0) { if(strcmp((const char*)color, "brown") == 0) {
output = LCD_BROWN; return LCD_BROWN;
} }
if(strcmp((const char*)color, "orange") == 0) { if(strcmp((const char*)color, "orange") == 0) {
output = LCD_ORANGE; return LCD_ORANGE;
} }
if(strcmp((const char*)color, "transparent") == 0) { if(strcmp((const char*)color, "transparent") == 0) {
output = LCD_TRANSPARENT; return LCD_TRANSPARENT;
} }
return output; return LCD_BLACK;
} }