82 initialhue, reversed);
106 u16 endpos,
CHSV endcolor,
109 if (endpos < startpos) {
112 endcolor = startcolor;
122 if (endcolor.value == 0 || endcolor.saturation == 0) {
123 endcolor.hue = startcolor.hue;
130 if (startcolor.value == 0 || startcolor.saturation == 0) {
131 startcolor.hue = endcolor.hue;
138 satdistance87 = (endcolor.sat - startcolor.sat) << 7;
139 valdistance87 = (endcolor.val - startcolor.val) << 7;
141 fl::u8 huedelta8 = endcolor.hue - startcolor.hue;
145 if (huedelta8 > 127) {
152 if (huedelta8 < 128) {
158 huedistance87 = huedelta8 << 7;
161 huedistance87 = (
fl::u8)(256 - huedelta8) << 7;
162 huedistance87 = -huedistance87;
165 u16 pixeldistance = endpos - startpos;
166 i16 divisor = pixeldistance ? pixeldistance : 1;
168#if FASTLED_USE_32_BIT_GRADIENT_FILL
170 i32 huedelta823 = (huedistance87 * 65536) / divisor;
171 i32 satdelta823 = (satdistance87 * 65536) / divisor;
172 i32 valdelta823 = (valdistance87 * 65536) / divisor;
177 u32 hue824 =
static_cast<u32
>(startcolor.hue) << 24;
178 u32 sat824 =
static_cast<u32
>(startcolor.sat) << 24;
179 u32 val824 =
static_cast<u32
>(startcolor.val) << 24;
180 for (u16 i = startpos; i <= endpos; ++i) {
181 targetArray[i] =
CHSV(hue824 >> 24, sat824 >> 24, val824 >> 24);
182 hue824 += huedelta823;
183 sat824 += satdelta823;
184 val824 += valdelta823;
188 saccum87 huedelta87 = huedistance87 / divisor;
189 saccum87 satdelta87 = satdistance87 / divisor;
190 saccum87 valdelta87 = valdistance87 / divisor;
196 accum88 hue88 = startcolor.hue << 8;
197 accum88 sat88 = startcolor.sat << 8;
198 accum88 val88 = startcolor.val << 8;
199 for (u16 i = startpos; i <= endpos; ++i) {
200 targetArray[i] =
CHSV(hue88 >> 8, sat88 >> 8, val88 >> 8);
219 u16 last = numLeds - 1;
235 u16 half = (numLeds / 2);
236 u16 last = numLeds - 1;
238 fill_gradient(targetArray, half, c2, last, c3, directionCode);
254 u16 onethird = (numLeds / 3);
255 u16 twothirds = ((numLeds * 2) / 3);
256 u16 last = numLeds - 1;
257 fill_gradient(targetArray, 0, c1, onethird, c2, directionCode);
258 fill_gradient(targetArray, onethird, c2, twothirds, c3, directionCode);
259 fill_gradient(targetArray, twothirds, c3, last, c4, directionCode);
263#define fill_gradient_HSV fill_gradient
void fill_rainbow_circular(CRGB *targetArray, int numToFill, fl::u8 initialhue, bool reversed=false) FL_NOEXCEPT
Fill a range of LEDs with a rainbow of colors, so that the hues are continuous between the end of the...
#define saccum87
ANSI: signed short _Accum.
void fill_rainbow_circular(CRGB *targetArray, int numToFill, u8 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(CRGB *targetArray, int numToFill, u8 initialhue, u8 deltahue)
Fill a range of LEDs with a rainbow of colors.
void fill_gradient(T *targetArray, u16 startpos, CHSV startcolor, u16 endpos, CHSV endcolor, TGradientDirectionCode directionCode=SHORTEST_HUES) FL_NOEXCEPT
Fill a range of LEDs with a smooth HSV gradient between two HSV colors.
void fill_gradient_RGB(CRGB *leds, u16 startpos, CRGB startcolor, u16 endpos, CRGB endcolor)
Fill a range of LEDs with a smooth RGB gradient between two RGB colors.
void fill_solid(CRGB *targetArray, int numToFill, const CRGB &color)
Fill a range of LEDs with a solid color.
u16 accum88
ANSI: unsigned short _Accum. 8 bits int, 8 bits fraction.
TGradientDirectionCode
Hue direction for calculating fill gradients.
@ SHORTEST_HUES
Hue goes whichever way is shortest.
@ LONGEST_HUES
Hue goes whichever way is longest.
@ FORWARD_HUES
Hue always goes clockwise around the color wheel.
@ BACKWARD_HUES
Hue always goes counter-clockwise around the color wheel.
Base definition for an LED controller.
#define FL_DISABLE_WARNING_RETURN_TYPE
#define FL_DISABLE_WARNING_IMPLICIT_INT_CONVERSION
#define FL_DISABLE_WARNING_PUSH
#define FL_DISABLE_WARNING_SIGN_CONVERSION
#define FL_DISABLE_WARNING_POP
#define FL_DISABLE_WARNING_UNUSED_PARAMETER
#define FL_DISABLE_WARNING_FLOAT_CONVERSION
Representation of an 8-bit RGB pixel (Red, Green, Blue)