summaryrefslogtreecommitdiff
path: root/osframework/source/SexyAppFramework/Color.h
blob: c22026eb99551fdb3816f7584e63524472f0d265 (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
#ifndef __COLOR_H__
#define __COLOR_H__

#include "Common.h"

namespace Sexy
{

#pragma pack(push,1)
struct SexyRGBA {unsigned char b,g,r,a;};
#pragma pack(pop)

class Color
{
public:
	int mRed;
	int mGreen;
	int mBlue;
	int mAlpha;

	static Color Black;
	static Color White;

public:
	Color();
	Color(int theColor);
	Color(int theColor, int theAlpha);
	Color(int theRed, int theGreen, int theBlue);
	Color(int theRed, int theGreen, int theBlue, int theAlpha);
	Color(const SexyRGBA &theColor);
	Color(const uchar* theElements);	
	Color(const int* theElements);

	int						GetRed() const;
	int						GetGreen() const;
	int						GetBlue() const;
	int						GetAlpha() const;
	ulong					ToInt() const;
	SexyRGBA				ToRGBA() const;

	int&					operator[](int theIdx);
	int						operator[](int theIdx) const;	
};

bool operator==(const Color& theColor1, const Color& theColor2);
bool operator!=(const Color& theColor1, const Color& theColor2);

}

#endif //__COLOR_H__