-
Notifications
You must be signed in to change notification settings - Fork 0
/
outputabstract.cpp
45 lines (39 loc) · 1.04 KB
/
outputabstract.cpp
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
#include "outputabstract.h"
int OutputAbstract::getNumLEDs()
{
return _numLEDs;
}
sCRGB OutputAbstract::getCorrectedColor(sCRGB color)
{
// Apply the default color correction
// FastLED/color.h, typical: 255, 176, 240
return sCRGB(color.r, color.g * 0.69, color.b * 0.94);
}
void OutputAbstract::fillBrightness(uint8_t brightness)
{
// Fill all LEDs with a given brightness
for (int i = 0; i < _numLEDs; ++i) {
setBrightness(i, brightness);
}
}
void OutputAbstract::fillColor(sCRGB color)
{
// Fill all LEDs with a given color, resetting brightness
for (int i = 0; i < _numLEDs; ++i) {
setColor(i, color);
}
}
void OutputAbstract::fillColor(sCRGB color, uint8_t brightness)
{
// Fill all LEDs with a given color and brightness
for (int i = 0; i < _numLEDs; ++i) {
setColor(i, color, brightness);
}
}
void OutputAbstract::fillHue(sCRGB color)
{
// Fill all LEDs with a given color, keeping brightness
for (int i = 0; i < _numLEDs; ++i) {
setHue(i, color);
}
}