| 85 | } |
| 86 | |
| 87 | pag::Color QStringToColor(const QString& color) { |
| 88 | Color pagColor{}; |
| 89 | auto strColor = color.toStdString(); |
| 90 | auto strColor12 = strColor.substr(1, 2); |
| 91 | auto r = strColor12.c_str(); |
| 92 | auto strColor34 = strColor.substr(3, 2); |
| 93 | auto g = strColor34.c_str(); |
| 94 | auto strColor56 = strColor.substr(5, 2); |
| 95 | auto b = strColor56.c_str(); |
| 96 | |
| 97 | char* str; |
| 98 | uint8_t red = strtol(r, &str, 16); |
| 99 | uint8_t green = strtol(g, &str, 16); |
| 100 | uint8_t blue = strtol(b, &str, 16); |
| 101 | pagColor.red = red; |
| 102 | pagColor.green = green; |
| 103 | pagColor.blue = blue; |
| 104 | return pagColor; |
| 105 | } |
| 106 | |
| 107 | QString ColorToQString(const Color& color) { |
| 108 | char hexColor[8] = {0}; |
no outgoing calls
no test coverage detected