Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
blob: 79388d8d212d2be0b151d989246d16c05029a481 (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/*
   ui/palette.cc
   This file is part of the Osirion project and is distributed under
   the terms of the GNU General Public License version 2
*/

#include "ui/palette.h"
#include "sys/sys.h"

namespace ui
{

Palette::Palette()
{
	palette_foreground.assign(1.0f, 1.0f);
	palette_highlight.assign(1.0f, 1.0f, 0.5f);
	palette_text.assign(0.75f);
	palette_background.assign(0.5f, 0.75f);
	palette_border.assign(0.0f, 0.8f, 0.0f, 0.5f);
	palette_pointer.assign(0.0f, 0.75f, 0.0f);
	palette_active.assign(0.0f, 1.0f, 0.0f);

	palette_debug.assign(1.0f, 0.0f, 1.0f, 0.75f);
}

Palette::~Palette()
{
}

const math::Color &Palette::color(Color palettecolor) const
{
	switch(palettecolor) {
		case Foreground:
			return foreground();
			break;
		case Background:
			return background();
			break;
		case Highlight:
			return highlight();
			break;
		case Border:
			return border();
			break;
		case Pointer:
			return pointer();
			break;
		case Active:
			return active();
			break;
		case Debug:
			return debug();
		default:
			return foreground();
			break;
	}
}

void Palette::set_foreground(math::Color const &color)
{
	palette_foreground.assign(color);
}

void Palette::set_highlight(math::Color const &color)
{
	palette_highlight.assign(color);
}

void Palette::set_text(math::Color const &color)
{
	palette_text.assign(color);
}

void Palette::set_background(math::Color const &color)
{
	palette_background.assign(color);
}

void Palette::set_border(math::Color const &color)
{
	palette_border.assign(color);
}

void Palette::set_pointer(math::Color const &color)
{
	palette_pointer.assign(color);
}

void Palette::set_active(math::Color const &color)
{
	palette_active.assign(color);
}

void Palette::set_debug(math::Color const &color)
{
	palette_debug.assign(color);
}

}