MCPcopy Create free account
hub / github.com/OpenEPaperLink/OpenEPaperLink / getColor

Function getColor

ESP32_AP-Flasher/src/contentmanager.cpp:2973–2991  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2971}
2972
2973uint16_t getColor(const String &color) {
2974 if (color == "0" || color == "white") return TFT_WHITE;
2975 if (color == "1" || color == "" || color == "black") return TFT_BLACK;
2976 if (color == "2" || color == "red") return TFT_RED;
2977 if (color == "3" || color == "yellow") return TFT_YELLOW;
2978 if (color == "4" || color == "lightgray") return 0xBDF7;
2979 if (color == "5" || color == "darkgray") return TFT_DARKGREY;
2980 if (color == "6" || color == "pink") return 0xFBCF;
2981 if (color == "7" || color == "brown") return 0x8400;
2982 if (color == "8" || color == "green") return TFT_GREEN;
2983 if (color == "9" || color == "blue") return TFT_BLUE;
2984 if (color == "10" || color == "orange") return 0xFBE0;
2985 uint16_t r, g, b;
2986 if (color.length() == 7 && color[0] == '#' &&
2987 sscanf(color.c_str(), "#%2hx%2hx%2hx", &r, &g, &b) == 3) {
2988 return ((r >> 3) << 11) | ((g >> 2) << 5) | (b >> 3);
2989 }
2990 return TFT_WHITE;
2991}
2992
2993char *formatHttpDate(const time_t t) {
2994 static char buf[40];

Callers 5

drawNewFunction · 0.85
getCalFeedFunction · 0.85
getPercentileColorFunction · 0.85
getDayAheadFeedFunction · 0.85
drawElementFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected