| 1 | #ifndef BASE_LOG_COLOR_H |
|---|---|
| 2 | #define BASE_LOG_COLOR_H |
| 3 | |
| 4 | #include "color.h" |
| 5 | #include "log.h" |
| 6 | |
| 7 | #include <cstdint> |
| 8 | |
| 9 | template<> |
| 10 | constexpr LOG_COLOR color_cast(const ColorRGBA &rgb) |
| 11 | { |
| 12 | return LOG_COLOR{ |
| 13 | .r = (uint8_t)(rgb.r * 255.0f + 0.5f), |
| 14 | .g = (uint8_t)(rgb.g * 255.0f + 0.5f), |
| 15 | .b = (uint8_t)(rgb.b * 255.0f + 0.5f), |
| 16 | }; |
| 17 | } |
| 18 | |
| 19 | #endif // BASE_LOG_COLOR_H |
| 20 |