| 127 | } |
| 128 | |
| 129 | std::string Color::asHexString() const |
| 130 | { |
| 131 | // clang-format off |
| 132 | std::stringstream ss; |
| 133 | ss << "#" << std::hex << std::uppercase << std::setfill('0') |
| 134 | << std::setw(2) << int(std::lround(r * 255.0F)) |
| 135 | << std::setw(2) << int(std::lround(g * 255.0F)) |
| 136 | << std::setw(2) << int(std::lround(b * 255.0F)); |
| 137 | return ss.str(); |
| 138 | // clang-format on |
| 139 | } |
| 140 | |
| 141 | bool Color::fromHexString(const std::string& hex) |
| 142 | { |
no test coverage detected