I'm wondering if there is a reason for the behavior or FadeToBlackBy() with a

I’m wondering if there is a reason for the behavior or FadeToBlackBy() with a zero parameter? It appears if you call the function with a scale of 0, it acts as it it’s a scale of 1.

It seems to me, this (or the nscale() functions upon which it relies) should exit if the scale parameter is 0. Or am I not understanding the nature of this function? If there is no scaling factor, I would expect it not to modify the led values.

Thoughts?

LIB8STATIC void nscale8x3_video( uint8_t& r, uint8_t& g, uint8_t& b, fract8 scale)
283 {
284 #if SCALE8_C == 1
285 uint8_t nonzeroscale = (scale != 0) ? 1 : 0;
286 r = (r == 0) ? 0 : (((int)r * (int)(scale) ) >> 8) + nonzeroscale;
287 g = (g == 0) ? 0 : (((int)g * (int)(scale) ) >> 8) + nonzeroscale;
288 b = (b == 0) ? 0 : (((int)b * (int)(scale) ) >> 8) + nonzeroscale;
289 #elif SCALE8_AVRASM == 1
290 nscale8_video_LEAVING_R1_DIRTY( r, scale);
291 nscale8_video_LEAVING_R1_DIRTY( g, scale);
292 nscale8_video_LEAVING_R1_DIRTY( b, scale);
293 cleanup_R1();
294 #else
295 #error “No implementation for nscale8x3 available.”
296 #endif
297 }

Since you’re digging into the headers, I recommend reading the associated comments. The ?scale*_video() functions have a specific use-case, which is documented.

Link for the lazy: https://github.com/FastLED/FastLED/blob/master/lib8tion/scale8.h#L337