forked from allthingsida/GraphSlick
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcolorgen.h
47 lines (38 loc) · 1.27 KB
/
colorgen.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
/*--------------------------------------------------------------------------
GraphSlick (c) Elias Bachaalany
-------------------------------------
Color generation module
This module implements the color generator
--------------------------------------------------------------------------*/
//--------------------------------------------------------------------------
class colorgen_t;
class colorvargen_t
{
friend class colorgen_t;
unsigned int l, L_END, L_INT;
unsigned int h, s;
bool bRealRgb;
public:
unsigned int get_color();
};
//--------------------------------------------------------------------------
class colorgen_t
{
private:
unsigned int h, s;
bool bRealRgb;
public:
unsigned int S_START, S_END, S_INT;
unsigned int H_START, H_END, H_INT;
unsigned int L_START, L_END, L_INT;
colorgen_t(bool bRealRgb = false,
unsigned int h_start=0, unsigned int h_end=255, unsigned int h_int=14,
unsigned int s_start=255, unsigned int s_end=60, unsigned int s_int=-8,
unsigned int l_start=190, unsigned int l_end=100, unsigned int l_int=-3);
bool get_colorvar(colorvargen_t &cv);
/**
* @brief Generates a color. Prefers first a color variant
*/
unsigned int get_color_anyway(colorvargen_t &cv);
void rewind();
};