12 std::uint8_t r, g, b, a;
14 constexpr Color() : r(0), g(0), b(0), a(255) {}
15 constexpr Color(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a) : r(r), g(g), b(b), a(a) {}
16 constexpr Color(std::uint32_t hex) {
17 r = (hex & 0xff000000) >> 24;
18 g = (hex & 0x00ff0000) >> 16;
19 b = (hex & 0x0000ff00) >> 8;
20 a = (hex & 0x000000ff) >> 0;
23 std::array<float,4> toFloat()
const {
24 return { r / 255.0f, g / 255.0f, b / 255.0f, a / 255.0f };