10 const struct CRGB &color) {
11 for (
int i = 0; i < numToFill; ++i) {
12 targetArray[i] = color;
17 const struct CHSV &color) {
18 for (
int i = 0; i < numToFill; ++i) {
19 targetArray[i] = color;
35 for (
int i = 0; i < numToFill; ++i) {
47 for (
int i = 0; i < numToFill; ++i) {
54 uint8_t initialhue,
bool reversed) {
63 const uint16_t hueChange =
64 65535 / (uint16_t)numToFill;
66 uint16_t hueOffset = 0;
68 for (
int i = 0; i < numToFill; ++i) {
71 hueOffset -= hueChange;
73 hueOffset += hueChange;
74 hsv.hue = initialhue +
75 (uint8_t)(hueOffset >>
81 uint8_t initialhue,
bool reversed) {
90 const uint16_t hueChange =
91 65535 / (uint16_t)numToFill;
93 uint16_t hueOffset = 0;
95 for (
int i = 0; i < numToFill; ++i) {
98 hueOffset -= hueChange;
100 hueOffset += hueChange;
101 hsv.hue = initialhue +
102 (uint8_t)(hueOffset >>
108 uint16_t endpos,
CRGB endcolor) {
110 if (endpos < startpos) {
113 endcolor = startcolor;
123 rdistance87 = (endcolor.r - startcolor.r) << 7;
124 gdistance87 = (endcolor.g - startcolor.g) << 7;
125 bdistance87 = (endcolor.b - startcolor.b) << 7;
127 uint16_t pixeldistance = endpos - startpos;
128 int16_t divisor = pixeldistance ? pixeldistance : 1;
130 saccum87 rdelta87 = rdistance87 / divisor;
131 saccum87 gdelta87 = gdistance87 / divisor;
132 saccum87 bdelta87 = bdistance87 / divisor;
138 accum88 r88 = startcolor.r << 8;
139 accum88 g88 = startcolor.g << 8;
140 accum88 b88 = startcolor.b << 8;
141 for (uint16_t i = startpos; i <= endpos; ++i) {
142 leds[i] =
CRGB(r88 >> 8, g88 >> 8, b88 >> 8);
151 uint16_t last = numLeds - 1;
157 uint16_t half = (numLeds / 2);
158 uint16_t last = numLeds - 1;
165 uint16_t onethird = (numLeds / 3);
166 uint16_t twothirds = ((numLeds * 2) / 3);
167 uint16_t last = numLeds - 1;
#define saccum87
ANSI: signed short _Accum.
void fill_rainbow_circular(struct CRGB *targetArray, int numToFill, uint8_t initialhue, bool reversed)
Fill a range of LEDs with a rainbow of colors, so that the hues are continuous between the end of the...
void fill_rainbow(struct CRGB *targetArray, int numToFill, uint8_t initialhue, uint8_t deltahue)
Fill a range of LEDs with a rainbow of colors.
void fill_gradient_RGB(CRGB *leds, uint16_t startpos, CRGB startcolor, uint16_t endpos, CRGB endcolor)
Fill a range of LEDs with a smooth RGB gradient between two RGB colors.
void fill_solid(struct CRGB *targetArray, int numToFill, const struct CRGB &color)
Fill a range of LEDs with a solid color.
uint16_t accum88
ANSI: unsigned short _Accum. 8 bits int, 8 bits fraction.
Implements a simple red square effect for 2D LED grids.
Representation of an HSV pixel (hue, saturation, value (aka brightness)).
Representation of an RGB pixel (Red, Green, Blue)