148{
149
150
151
152
153 uint16_t PRNG16 = 11337;
154
155 uint32_t clock32 = millis();
156
157
158
159
160
166 if( bglight > 64) {
168 } else if( bglight > 16) {
170 } else {
172 }
173 } else {
175 }
176
178
179 for(
CRGB& pixel: L) {
180 PRNG16 = (uint16_t)(PRNG16 * 2053) + 1384;
181 uint16_t myclockoffset16= PRNG16;
182 PRNG16 = (uint16_t)(PRNG16 * 2053) + 1384;
183
184 uint8_t myspeedmultiplierQ5_3 = ((((PRNG16 & 0xFF)>>4) + (PRNG16 & 0x0F)) & 0x0F) + 0x08;
185 uint32_t myclock30 = (uint32_t)((clock32 * myspeedmultiplierQ5_3) >> 3) + myclockoffset16;
186 uint8_t myunique8 = PRNG16 >> 8;
187
188
189
190
192
194 int16_t deltabright = cbright - backgroundBrightness;
195 if( deltabright >= 32 || (!bg)) {
196
197
198 pixel = c;
199 } else if( deltabright > 0 ) {
200
201
202 pixel =
blend( bg, c, deltabright * 8);
203 } else {
204
205
206 pixel = bg;
207 }
208 }
209}
CRGBPalette16 gCurrentPalette
CRGB computeOneTwinkle(uint32_t ms, uint8_t salt)
CRGB blend(const CRGB &p1, const CRGB &p2, fract8 amountOfP2)
Computes a new color blended some fraction of the way between two other colors.
FASTLED_FORCE_INLINE CRGB & nscale8_video(uint8_t scaledown)
Scale down a RGB to N/256ths of it's current brightness using "video" dimming rules.
FASTLED_FORCE_INLINE uint8_t getAverageLight() const
Get the average of the R, G, and B values.
Representation of an RGB pixel (Red, Green, Blue)
#define AUTO_SELECT_BACKGROUND_COLOR