158{
159
160
161
162
163 uint16_t PRNG16 = 11337;
164
165 uint32_t clock32 = millis();
166
167
168
169
170
176 if( bglight > 64) {
178 } else if( bglight > 16) {
180 } else {
182 }
183 } else {
185 }
186
188
189 for(
CRGB& pixel: L) {
190 PRNG16 = (uint16_t)(PRNG16 * 2053) + 1384;
191 uint16_t myclockoffset16= PRNG16;
192 PRNG16 = (uint16_t)(PRNG16 * 2053) + 1384;
193
194 uint8_t myspeedmultiplierQ5_3 = ((((PRNG16 & 0xFF)>>4) + (PRNG16 & 0x0F)) & 0x0F) + 0x08;
195 uint32_t myclock30 = (uint32_t)((clock32 * myspeedmultiplierQ5_3) >> 3) + myclockoffset16;
196 uint8_t myunique8 = PRNG16 >> 8;
197
198
199
200
202
204 int16_t deltabright = cbright - backgroundBrightness;
205 if( deltabright >= 32 || (!bg)) {
206
207
208 pixel = c;
209 } else if( deltabright > 0 ) {
210
211
212 pixel =
blend( bg, c, deltabright * 8);
213 } else {
214
215
216 pixel = bg;
217 }
218 }
219}
CRGBPalette16 gCurrentPalette
CRGB computeOneTwinkle(uint32_t ms, uint8_t salt)
CRGB blend(const CRGB &p1, const CRGB &p2, fract8 amountOfP2)
FASTLED_FORCE_INLINE fl::u8 getAverageLight() const
Get the average of the R, G, and B values.
FASTLED_FORCE_INLINE CRGB & nscale8_video(fl::u8 scaledown)
Scale down a RGB to N/256ths of it's current brightness using "video" dimming rules.
Representation of an RGB pixel (Red, Green, Blue)
#define AUTO_SELECT_BACKGROUND_COLOR