summaryrefslogtreecommitdiff
path: root/Runtime/Graphics/Color.h
blob: 043590babd0f9f3c6fede3f5769db47abcddf1a0 (plain)
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
56
57
#pragma once

#include "../Utilities/Type.h"

namespace Internal
{

	struct Color
    {
        Color(float r = 0, float g = 0, float b = 0, float a = 0)
        {
            this->r = r;
            this->g = g;
            this->b = b;
            this->a = a;
        }
        void Set(float r = 0, float g = 0, float b = 0, float a = 0)
        {
            this->r = r;
            this->g = g;
            this->b = b;
            this->a = a;
        }
        float r, g, b, a;
    };

	struct Color32
    {
        Color32(unsigned char r = 0, unsigned char g = 0, unsigned char b = 0, unsigned char a = 0)
        {
            this->r = r;
            this->g = g;
            this->b = b;
            this->a = a;
        }
        void Set(unsigned char r = 0, unsigned char g = 0, unsigned char b = 0, unsigned char a = 0)
        {
            this->r = r;
            this->g = g;
            this->b = b;
            this->a = a;
        }

        bool operator !=(const Color32& col)
        {
            return !(r == col.r && g == col.g && b == col.b && a == col.a);
        }

		unsigned char r, g, b, a;

        static const Color32 white;
    };

}

typedef Internal::Color Color;
typedef Internal::Color32 Color32;