sead
Loading...
Searching...
No Matches
seadColor.h
Go to the documentation of this file.
1#ifndef SEAD_COLOR_H_
2#define SEAD_COLOR_H_
3
4#include <basis/seadTypes.h>
5
6namespace sead {
7
8struct Color4f
9{
11 : r(cElementMin)
12 , g(cElementMin)
13 , b(cElementMin)
14 , a(cElementMax)
15 {
16 }
17
18 Color4f(f32 _r, f32 _g, f32 _b, f32 _a)
19 : r(_r)
20 , g(_g)
21 , b(_b)
22 , a(_a)
23 {
24 }
25
26 void setf(f32 _r, f32 _g, f32 _b, f32 _a)
27 {
28 r = _r;
29 g = _g;
30 b = _b;
31 a = _a;
32 }
33
34 void setLerp(const Color4f& from, const Color4f& to, f32 ratio);
35
36 Color4f& operator+=(const Color4f& rhs);
37 Color4f& operator*=(const Color4f& rhs);
38 Color4f& operator*=(f32 rhs);
39
40 friend Color4f operator*(const Color4f& lhs, const Color4f& rhs);
41 friend Color4f operator*(const Color4f& lhs, f32 rhs);
42 friend bool operator==(const Color4f& lhs, const Color4f& rhs);
43
44 union
45 {
46 struct
47 {
52 };
53 struct
54 {
55 f32 c[4];
56 };
57 };
58
59 static const f32 cElementMax;
60 static const f32 cElementMin;
61
62 static const Color4f cBlack;
63 static const Color4f cGray;
64 static const Color4f cWhite;
65 static const Color4f cRed;
66 static const Color4f cGreen;
67 static const Color4f cBlue;
68 static const Color4f cYellow;
69 static const Color4f cMagenta;
70 static const Color4f cCyan;
71};
72#ifdef cafe
73static_assert(sizeof(Color4f) == 0x10, "sead::Color4f size mismatch");
74#endif // cafe
75
76} // namespace sead
77
78#endif // #define SEAD_COLOR_H_
Definition seadAssert.h:44
Color4f operator*(const Color4f &lhs, const Color4f &rhs)
Definition seadColor.cpp:51
bool operator==(const Color4f &lhs, const Color4f &rhs)
Definition seadColor.cpp:65
Color4f operator*(const Color4f &lhs, f32 rhs)
Definition seadColor.cpp:58
Definition seadColor.h:9
static const f32 cElementMax
Definition seadColor.h:59
f32 r
Definition seadColor.h:48
f32 a
Definition seadColor.h:51
static const f32 cElementMin
Definition seadColor.h:60
static const Color4f cBlack
Definition seadColor.h:62
static const Color4f cCyan
Definition seadColor.h:70
f32 g
Definition seadColor.h:49
static const Color4f cGreen
Definition seadColor.h:66
static const Color4f cBlue
Definition seadColor.h:67
static const Color4f cGray
Definition seadColor.h:63
void setLerp(const Color4f &from, const Color4f &to, f32 ratio)
Definition seadColor.cpp:15
Color4f & operator*=(const Color4f &rhs)
Definition seadColor.cpp:33
static const Color4f cMagenta
Definition seadColor.h:69
Color4f()
Definition seadColor.h:10
Color4f(f32 _r, f32 _g, f32 _b, f32 _a)
Definition seadColor.h:18
f32 c[4]
Definition seadColor.h:55
void setf(f32 _r, f32 _g, f32 _b, f32 _a)
Definition seadColor.h:26
Color4f & operator+=(const Color4f &rhs)
Definition seadColor.cpp:24
static const Color4f cWhite
Definition seadColor.h:64
f32 b
Definition seadColor.h:50
static const Color4f cRed
Definition seadColor.h:65
Color4f & operator*=(f32 rhs)
Definition seadColor.cpp:42
static const Color4f cYellow
Definition seadColor.h:68