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