DDNet documentation
Loading...
Searching...
No Matches
log_color.h
Go to the documentation of this file.
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
9template<>
10constexpr 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
Definition color.h:183
float b
Definition color.h:53
float r
Definition color.h:45
float g
Definition color.h:49
constexpr LOG_COLOR color_cast(const ColorRGBA &rgb)
Definition log_color.h:10
Definition log.h:17