@@ -2260,17 +2260,18 @@ uint16_t mode_meteor() {
2260
2260
2261
2261
byte* trail = SEGENV.data ;
2262
2262
2263
- byte meteorSize= 1 + SEGLEN / 10 ;
2263
+ const unsigned meteorSize= 1 + SEGLEN / 20 ; // 5%
2264
2264
uint16_t counter = strip.now * ((SEGMENT.speed >> 2 ) +8 );
2265
2265
uint16_t in = counter * SEGLEN >> 16 ;
2266
2266
2267
+ const int max = SEGMENT.palette ==5 || !SEGMENT.check1 ? 240 : 255 ;
2267
2268
// fade all leds to colors[1] in LEDs one step
2268
2269
for (int i = 0 ; i < SEGLEN; i++) {
2269
- if (random8 () <= 255 - SEGMENT.intensity )
2270
- {
2271
- byte meteorTrailDecay = 128 + random8 (127 );
2270
+ if (random8 () <= 255 - SEGMENT.intensity ) {
2271
+ byte meteorTrailDecay = 162 + random8 (92 );
2272
2272
trail[i] = scale8 (trail[i], meteorTrailDecay);
2273
- SEGMENT.setPixelColor (i, color_blend (SEGCOLOR (1 ), SEGMENT.color_from_palette (i, true , false , 0 ), trail[i]));
2273
+ uint32_t col = SEGMENT.check1 ? SEGMENT.color_from_palette (i, true , false , 0 , trail[i]) : SEGMENT.color_from_palette (trail[i], false , true , 255 );
2274
+ SEGMENT.setPixelColor (i, col);
2274
2275
}
2275
2276
}
2276
2277
@@ -2280,13 +2281,14 @@ uint16_t mode_meteor() {
2280
2281
if (index >= SEGLEN) {
2281
2282
index -= SEGLEN;
2282
2283
}
2283
- trail[index ] = 240 ;
2284
- SEGMENT.setPixelColor (index , SEGMENT.color_from_palette (index , true , false , 0 ));
2284
+ trail[index ] = max;
2285
+ uint32_t col = SEGMENT.check1 ? SEGMENT.color_from_palette (index , true , false , 0 , trail[index ]) : SEGMENT.color_from_palette (trail[index ], false , true , 255 );
2286
+ SEGMENT.setPixelColor (index , col);
2285
2287
}
2286
2288
2287
2289
return FRAMETIME;
2288
2290
}
2289
- static const char _data_FX_MODE_METEOR[] PROGMEM = " Meteor@!,Trail length;!,! ;!;1" ;
2291
+ static const char _data_FX_MODE_METEOR[] PROGMEM = " Meteor@!,Trail,,,,Gradient; ;!;1" ;
2290
2292
2291
2293
2292
2294
// smooth meteor effect
@@ -2298,18 +2300,17 @@ uint16_t mode_meteor_smooth() {
2298
2300
2299
2301
byte* trail = SEGENV.data ;
2300
2302
2301
- byte meteorSize= 1 + SEGLEN / 10 ;
2303
+ const unsigned meteorSize= 1 + SEGLEN / 20 ; // 5%
2302
2304
uint16_t in = map ((SEGENV.step >> 6 & 0xFF ), 0 , 255 , 0 , SEGLEN -1 );
2303
2305
2306
+ const int max = SEGMENT.palette ==5 || !SEGMENT.check1 ? 240 : 255 ;
2304
2307
// fade all leds to colors[1] in LEDs one step
2305
2308
for (int i = 0 ; i < SEGLEN; i++) {
2306
- if (trail[i] != 0 && random8 () <= 255 - SEGMENT.intensity )
2307
- {
2308
- int change = 3 - random8 (12 ); // change each time between -8 and +3
2309
- trail[i] += change;
2310
- if (trail[i] > 245 ) trail[i] = 0 ;
2311
- if (trail[i] > 240 ) trail[i] = 240 ;
2312
- SEGMENT.setPixelColor (i, color_blend (SEGCOLOR (1 ), SEGMENT.color_from_palette (i, true , false , 0 ), trail[i]));
2309
+ if (/* trail[i] != 0 &&*/ random8 () <= 255 - SEGMENT.intensity ) {
2310
+ int change = trail[i] + 4 - random8 (24 ); // change each time between -20 and +4
2311
+ trail[i] = constrain (change, 0 , max);
2312
+ uint32_t col = SEGMENT.check1 ? SEGMENT.color_from_palette (i, true , false , 0 , trail[i]) : SEGMENT.color_from_palette (trail[i], false , true , 255 );
2313
+ SEGMENT.setPixelColor (i, col);
2313
2314
}
2314
2315
}
2315
2316
@@ -2319,14 +2320,15 @@ uint16_t mode_meteor_smooth() {
2319
2320
if (index >= SEGLEN) {
2320
2321
index -= SEGLEN;
2321
2322
}
2322
- trail[index ] = 240 ;
2323
- SEGMENT.setPixelColor (index , SEGMENT.color_from_palette (index , true , false , 0 ));
2323
+ trail[index ] = max;
2324
+ uint32_t col = SEGMENT.check1 ? SEGMENT.color_from_palette (index , true , false , 0 , trail[index ]) : SEGMENT.color_from_palette (trail[index ], false , true , 255 );
2325
+ SEGMENT.setPixelColor (index , col);
2324
2326
}
2325
2327
2326
2328
SEGENV.step += SEGMENT.speed +1 ;
2327
2329
return FRAMETIME;
2328
2330
}
2329
- static const char _data_FX_MODE_METEOR_SMOOTH[] PROGMEM = " Meteor Smooth@!,Trail length;!,! ;!;1" ;
2331
+ static const char _data_FX_MODE_METEOR_SMOOTH[] PROGMEM = " Meteor Smooth@!,Trail,,,,Gradient; ;!;1" ;
2330
2332
2331
2333
2332
2334
// Railway Crossing / Christmas Fairy lights
@@ -5984,12 +5986,12 @@ uint16_t mode_2Dscrollingtext(void) {
5984
5986
col1 = SEGCOLOR (0 );
5985
5987
col2 = SEGCOLOR (2 );
5986
5988
}
5987
- SEGMENT.drawCharacter (text[i], xoffset, yoffset, letterWidth, letterHeight, col1, col2, (SEGMENT.custom3 + 1 )>> 3 );
5989
+ SEGMENT.drawCharacter (text[i], xoffset, yoffset, letterWidth, letterHeight, col1, col2, map (SEGMENT.custom3 , 0 , 31 , - 2 , 2 ) );
5988
5990
}
5989
5991
5990
5992
return FRAMETIME;
5991
5993
}
5992
- static const char _data_FX_MODE_2DSCROLLTEXT[] PROGMEM = " Scrolling Text@!,Y Offset,Trail,Font size,Rotate,Gradient,Overlay,Reverse;!,!,Gradient;!;2;ix=128,c1=0,c3=0, rev=0,mi=0,rY=0,mY=0" ;
5994
+ static const char _data_FX_MODE_2DSCROLLTEXT[] PROGMEM = " Scrolling Text@!,Y Offset,Trail,Font size,Rotate,Gradient,Overlay,Reverse;!,!,Gradient;!;2;ix=128,c1=0,rev=0,mi=0,rY=0,mY=0" ;
5993
5995
5994
5996
5995
5997
// //////////////////////////
0 commit comments