-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathColor.h
More file actions
95 lines (79 loc) · 3.84 KB
/
Color.h
File metadata and controls
95 lines (79 loc) · 3.84 KB
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
#ifndef COLOR_H
#define COLOR_H
typedef uint32_t color_t;
//------------------------------------------------------------------------------
// https://www.rapidtables.com/web/color/RGB_Color.html
#define BLACK 0x000000
#define DWHITE 0x999999
#define RED 0xFF0000
#define MAROON 0x100000 // was 80000000
#define YELLOW 0xFFFF00
#define ORANGE 0xFF9500 // modified
#define GREEN 0x001000 // was 0x008000
#define LIME 0x00FF00
#define BLUE 0x0000FF
#define NAVY 0x000080
#define CYAN 0x00FFFF
#define TEAL 0x008080
#define MAGNETA 0xFF00FF
#define PINK 0xFF69B4
#define PURPLE 0x800080
#define OLIVE 0x808000
#define GRAY 0x808080
#define SILVER 0xC0C0C0
//------------------------------------------------------------------------------
#define FIXED_COLOR_ON_NUM 10
color_t fixedOnColors[FIXED_COLOR_ON_NUM] = {
BLACK, MAROON, OLIVE, ORANGE, GREEN,
NAVY, TEAL, MAGNETA, PURPLE, GRAY
};
#define FIXED_COLOR_OFF_NUM 10
color_t fixedOffColors[FIXED_COLOR_OFF_NUM] = {
BLACK, 0x020000, 0x010100, 0x110100, 0x000200,
0x000002, 0x000101, 0x020002, 0x010001, 0x010101
};
//------------------------------------------------------------------------------
// Defines to fill up rainbowColors[]. Makes a call to HSLtoRGB
// The difference between one color to the next. The higher the value,
// the more the colors "blend" into eachother.
// Value should only be 180 or 360
#define COLOR_GRADIENT 360
// Saturation of the color. Sets the intensity of the color.
// Value should be between 0-100
// 100 = vivid colors, 0 = darker colors
#define SATURATION 80
// The brightness of the color. The higher the value, the whiter it looks
// Value should be between 0-100
// 100 = white, 50 = good balance, 0 = black
#define LIGHTNESS 20
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// PlazINT
//Byte val 2PI Cosine Wave, offset by 1 PI
//supports fast trig calcs and smooth LED fading/pulsing.
const uint8_t cos_wave[256] =
{0,0,0,0,1,1,1,2,2,3,4,5,6,6,8,9,10,11,12,14,15,17,18,20,22,23,25,27,29,31,33,35,38,40,42,
45,47,49,52,54,57,60,62,65,68,71,73,76,79,82,85,88,91,94,97,100,103,106,109,113,116,119,
122,125,128,131,135,138,141,144,147,150,153,156,159,162,165,168,171,174,177,180,183,186,
189,191,194,197,199,202,204,207,209,212,214,216,218,221,223,225,227,229,231,232,234,236,
238,239,241,242,243,245,246,247,248,249,250,251,252,252,253,253,254,254,255,255,255,255,
255,255,255,255,254,254,253,253,252,252,251,250,249,248,247,246,245,243,242,241,239,238,
236,234,232,231,229,227,225,223,221,218,216,214,212,209,207,204,202,199,197,194,191,189,
186,183,180,177,174,171,168,165,162,159,156,153,150,147,144,141,138,135,131,128,125,122,
119,116,113,109,106,103,100,97,94,91,88,85,82,79,76,73,71,68,65,62,60,57,54,52,49,47,45,
42,40,38,35,33,31,29,27,25,23,22,20,18,17,15,14,12,11,10,9,8,6,6,5,4,3,2,2,1,1,1,0,0,0,0
};
//Gamma Correction Curve
const uint8_t exp_gamma[256] =
{0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,3,3,3,3,3,
4,4,4,4,4,5,5,5,5,5,6,6,6,7,7,7,7,8,8,8,9,9,9,10,10,10,11,11,12,12,12,13,13,14,14,14,15,15,
16,16,17,17,18,18,19,19,20,20,21,21,22,23,23,24,24,25,26,26,27,28,28,29,30,30,31,32,32,33,
34,35,35,36,37,38,39,39,40,41,42,43,44,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,70,71,72,73,74,75,77,78,79,80,82,83,84,85,87,89,91,92,93,95,96,98,
99,100,101,102,105,106,108,109,111,112,114,115,117,118,120,121,123,125,126,128,130,131,133,
135,136,138,140,142,143,145,147,149,151,152,154,156,158,160,162,164,165,167,169,171,173,175,
177,179,181,183,185,187,190,192,194,196,198,200,202,204,207,209,211,213,216,218,220,222,225,
227,229,232,234,236,239,241,244,246,249,251,253,254,255
};
//------------------------------------------------------------------------------
#endif /* COLOR_H */