1
0
mirror of https://github.com/blawar/ooot.git synced 2024-07-04 18:13:37 +00:00
ooot/include/color.h

33 lines
490 B
C
Raw Normal View History

2021-12-27 19:23:03 +00:00
#pragma once
#include "macros.h"
2020-03-17 04:31:30 +00:00
2022-02-12 19:50:06 +00:00
struct Color_RGB8 {
u8 r, g, b;
2022-02-12 19:50:06 +00:00
};
2020-03-17 04:31:30 +00:00
2022-02-12 19:50:06 +00:00
struct Color_RGBA8 {
Color_RGBA8() = default;
Color_RGBA8(u8 r_, u8 g_, u8 b_, u8 a_) : r(r_), g(g_), b(b_), a(a_) {}
explicit operator u32 () {
return BE32(RGBA8(r, g, b, a));
}
u8 r, g, b, a;
2022-02-12 19:50:06 +00:00
};
2022-02-12 19:50:06 +00:00
struct Color_RGBAf {
2020-03-17 04:31:30 +00:00
f32 r, g, b, a;
2022-02-12 19:50:06 +00:00
};
2020-03-17 04:31:30 +00:00
typedef union {
struct {
u16 r : 5;
u16 g : 5;
u16 b : 5;
u16 a : 1;
};
u16 rgba;
} Color_RGBA16;