aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/Color.h
blob: c207ba7c7275015ebf8ff1a4bd7e53e20b344a51 (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
#pragma once

#include <cstdint>

namespace crepe {

// TODO: make Color a struct w/o constructors/destructors
class Color {

	// FIXME: can't these colors be defined as a `static constexpr const Color`
	// instead?

public:
	Color(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha);
	static const Color & get_white();
	static const Color & get_red();
	static const Color & get_green();
	static const Color & get_blue();
	static const Color & get_cyan();
	static const Color & get_magenta();
	static const Color & get_yellow();
	static const Color & get_black();

public:
	uint8_t r;
	uint8_t g;
	uint8_t b;
	uint8_t a;

private:
	static Color white;
	static Color red;
	static Color green;
	static Color blue;
	static Color cyan;
	static Color magenta;
	static Color yellow;
	static Color black;

private:
	friend class SDLContext;
};

} // namespace crepe