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
|
#include "color.h"
static const iColor transparent_;
iColor get_Color(int color) {
static const iColor palette[] = {
{ 0, 0, 0, 255 },
{ 40, 40, 40, 255 },
{ 80, 80, 80, 255 },
{ 160, 160, 160, 255 },
{ 255, 255, 255, 255 },
{ 106, 80, 0, 255 },
{ 255, 192, 0, 255 },
{ 0, 96, 128, 255 },
{ 0, 192, 255, 255 },
{ 255, 255, 32, 255 },
{ 255, 64, 64, 255 },
{ 255, 0, 255, 255 },
{ 132, 132, 255, 255 },
{ 0, 200, 0, 255 },
};
const iColor *clr = &transparent_;
if (color >= 0 && color < (int) iElemCount(palette)) {
clr = &palette[color];
}
return *clr;
}
|