-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcolors.h
56 lines (40 loc) · 790 Bytes
/
colors.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
* @file: colors.h
* @author: Ondrej Hirjak, 2010
* @description: Defines color structures.
*/
#ifndef colors_h
#define colors_h
struct Color
{
public:
double r, g, b, a;
Color() : r(0.0), g(0.0), b(0.0), a(0.0) { }
Color(const Color &c) : r(c.r), g(c.g), b(c.b), a(c.a) { }
Color(double c1, double c2, double c3, double c4) : r(c1), g(c2), b(c3), a(c4) { }
Color Cap();
Color operator +(Color c);
Color operator *(Color c);
Color operator *(double t);
};
union ColorRGBA
{
unsigned char color[4];
struct {
unsigned char R;
unsigned char G;
unsigned char B;
unsigned char A;
} x;
};
union ColorBGRA
{
unsigned char color[4];
struct {
unsigned char B;
unsigned char G;
unsigned char R;
unsigned char A;
} x;
};
#endif // colors_h