| 397 | } |
| 398 | |
| 399 | bool parseFragmentsText(const JsonArray &fragmentArray, std::vector<uint32_t> &colors, std::vector<String> &fragments, uint32_t standardColor) |
| 400 | { |
| 401 | colors.clear(); |
| 402 | fragments.clear(); |
| 403 | |
| 404 | for (JsonObject fragmentObj : fragmentArray) |
| 405 | { |
| 406 | String textFragment = fragmentObj["t"]; |
| 407 | uint32_t color; |
| 408 | if (fragmentObj.containsKey("c")) |
| 409 | { |
| 410 | auto fragColor = fragmentObj["c"]; |
| 411 | color = getColorFromJsonVariant(fragColor, standardColor); |
| 412 | } |
| 413 | else |
| 414 | { |
| 415 | color = standardColor; |
| 416 | } |
| 417 | |
| 418 | fragments.push_back(utf8ascii(textFragment)); |
| 419 | colors.push_back(color); |
| 420 | } |
| 421 | return true; |
| 422 | } |
| 423 | |
| 424 | bool DisplayManager_::parseCustomPage(const String &name, const char *json, bool preventSave) |
| 425 | { |
no test coverage detected