-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDecorCategory.ino
210 lines (174 loc) · 5.66 KB
/
DecorCategory.ino
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
// https://cssgradient.io/
// Copy CSS code to https://palette-library.vercel.app/
DEFINE_GRADIENT_PALETTE( amber_warmwhite ) {
0, 255, 0, 0,
127, 255, 50, 0,
255, 255, 100, 42
};
CRGBPalette16 pal_AWW = amber_warmwhite;
// converted for FastLED with gammas (2.6, 2.2, 2.5)
DEFINE_GRADIENT_PALETTE(matt_test){
0, 1, 255, 228,
92, 11, 139, 6,
186, 152, 0, 128,
255, 0, 169, 255};
CRGBPalette16 pal_Matt = matt_test;
DEFINE_GRADIENT_PALETTE(brian_test){
0, 6, 128, 121,
84, 1, 1, 133,
145, 2, 64, 19,
199, 1, 42, 154,
255, 6, 128, 121};
CRGBPalette16 pal_Brian = brian_test;
// Gradient palette "Sunset_Real_gp", originally from
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/nd/atmospheric/tn/Sunset_Real.png.index.html
// converted for FastLED with gammas (2.6, 2.2, 2.5)
// Size: 28 bytes of program space.
DEFINE_GRADIENT_PALETTE(Sunset_Real_gp){
0, 120, 0, 0,
22, 179, 22, 0,
51, 255, 104, 0,
85, 167, 22, 18,
135, 100, 0, 103,
198, 16, 0, 130,
255, 0, 0, 160};
CRGBPalette16 pal_Outrun = Sunset_Real_gp;
// Gradient palette "scoutie_gp", originally from
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/rc/tn/scoutie.png.index.html
// converted for FastLED with gammas (2.6, 2.2, 2.5)
// Size: 16 bytes of program space.
DEFINE_GRADIENT_PALETTE(scoutie_gp){
0, 255, 156, 0,
127, 0, 195, 18,
216, 1, 0, 39,
255, 1, 0, 39};
CRGBPalette16 pal_GreenYellowBlue = scoutie_gp;
DEFINE_GRADIENT_PALETTE(rasta_flag){
0, 255, 0, 0,
125, 232, 255, 0,
255, 0, 93, 1};
CRGBPalette16 pal_rasta_flag = rasta_flag;
// -------------------------------------------------------
// FUNCTIONS
// -------------------------------------------------------
void decor_category(int patternMode)
{
globalStrings.categoryName = "DECOR";
switch (patternMode)
{
case 1:
paletteOne();
break;
case 2:
paletteTwo();
break;
case 3:
paletteThree();
break;
case 4:
paletteFour();
break;
case 5:
paletteFive();
break;
case 6:
RastaFlag();
break;
case 7:
paletteAmberWarmWhite();
break;
}
}
void paletteAmberWarmWhite()
{
globalStrings.functionName = "Amber - Warm White";
byte poop = patternSettings.patternAdjust[globals.mode][patternSettings.pattern[globals.mode]];
//fill_palette(patternSettings.leds, NUM_LEDS, 0, 255 / NUM_LEDS, pal_AWW, 255, LINEARBLEND);
if (poop != 0)
{
fill_palette(patternSettings.leds, NUM_LEDS, poop, 0, pal_AWW, 255, LINEARBLEND);
}
else
{
fill_palette(patternSettings.leds, NUM_LEDS, 0, 255 / NUM_LEDS, pal_AWW, 255, LINEARBLEND);
}
}
void paletteOne()
{
globalStrings.functionName = "PaletteOne";
byte poop = patternSettings.patternAdjust[globals.mode][patternSettings.pattern[globals.mode]];
fill_palette(patternSettings.leds, NUM_LEDS, 0, 255 / NUM_LEDS, pal_Brian, 255, LINEARBLEND);
}
void paletteTwo()
{
globalStrings.functionName = "PaletteTwo";
byte poop = patternSettings.patternAdjust[globals.mode][patternSettings.pattern[globals.mode]];
fill_solid(patternSettings.leds, NUM_LEDS, CHSV(poop, 255, 255));
}
void paletteThree()
{
globalStrings.functionName = "PaletteThree";
byte poop = patternSettings.patternAdjust[globals.mode][patternSettings.pattern[globals.mode]];
if (poop != 0)
{
fill_palette(patternSettings.leds, NUM_LEDS, poop, 0, pal_Outrun, 255, LINEARBLEND);
}
else
{
fill_palette(patternSettings.leds, NUM_LEDS, 0, 255 / NUM_LEDS, pal_Outrun, 255, LINEARBLEND);
}
}
void paletteFour()
{
globalStrings.functionName = "PaletteFour";
byte poop = patternSettings.patternAdjust[globals.mode][patternSettings.pattern[globals.mode]];
if (poop != 0)
{
fadeToBlackBy(patternSettings.leds, NUM_LEDS, poop);
patternSettings.leds[random(0, NUM_LEDS - 1)] = ColorFromPalette(pal_GreenYellowBlue, random8(), 255, LINEARBLEND);
}
else
{
fill_palette(patternSettings.leds, NUM_LEDS, 0, 255 / NUM_LEDS, pal_GreenYellowBlue, 255, LINEARBLEND);
}
}
void paletteFive()
{
globalStrings.functionName = "PaletteFive";
byte poop = patternSettings.patternAdjust[globals.mode][patternSettings.pattern[globals.mode]];
if (poop != 0)
{
for (int i = 0; i < NUM_LEDS; i++)
{
patternSettings.leds[i] = ColorFromPalette(pal_Brian, patternSettings.colorIndex[i]);
patternSettings.colorIndex[i] += poop / 40;
int beat1 = beatsin16(poop / 30, 0, 255, (65536 / NUM_LEDS) * i, 0);
int beat2 = beatsin16(poop / 10, 0, 255, (65536 / NUM_LEDS) * i, 0);
patternSettings.leds[i].fadeToBlackBy((beat1 + beat2) / 2);
}
}
else
{
fill_palette(patternSettings.leds, NUM_LEDS, 0, 255 / NUM_LEDS, pal_Brian, 255, LINEARBLEND);
}
}
void RastaFlag()
{
globalStrings.functionName = "RastaFlag";
byte poop = patternSettings.patternAdjust[globals.mode][patternSettings.pattern[globals.mode]];
if (poop != 0)
{
for (int i = 0; i < NUM_LEDS; i++)
{
patternSettings.leds[i] = ColorFromPalette(pal_rasta_flag, patternSettings.colorIndex[i]);
patternSettings.colorIndex[i] += poop / 40;
int beat1 = beatsin16(poop / 30, 0, 255, (65536 / NUM_LEDS) * i, 0);
int beat2 = beatsin16(poop / 10, 0, 255, (65536 / NUM_LEDS) * i, 0);
patternSettings.leds[i].fadeToBlackBy((beat1 + beat2) / 2);
}
}
else
{
fill_palette(patternSettings.leds, NUM_LEDS, 0, 255 / NUM_LEDS, pal_rasta_flag, 255, LINEARBLEND);
}
}