IS there an opposite to fadetoblackby?

IS there an opposite to fadetoblackby? Something like fadetocolorby that would allow a slow fade up? Seems like it would be possible, but I didn’t see a function for it.

There are several ways to achieve effects like the ones that I think you’re describing.

Are you always going to be fading ‘up’ from black? Or are you going to be cross-fading from one color to another?

Good question. One or the other, but I might try both to see which I like better.

OK, so I played with it more and fadetoblackby makes sense and can be made to have a nice smooth dimming curve. What I was trying to figure out was how to do the opposite? So instead of fading to black, go from black to the full brightness of the color. Is there a function to do that?

Try blend, for one technique:

CRGB targetColor = {whatever}
uint8_t amountToBlend = 16;

leds[i] = blend( leds[i], targetColor, amountToBlend);

Hmmm, havent seen that function, thanks. How do you control the time it takes to fade from start to finish? I assume it is a set time?

No; like all of these functions it does a small amount of work and returns immediately. That’s how the ‘fade’ functions work, too.

So the body of your code should say, roughly:

adjust all the values in the "leds" array a little bit
call FastLED.show() to display the new colors
loop as needed

“blend” computes one blended color, eg
Result = blend( Old, Target, amountToBlend)
where amountToBlend is 0-255; zero means that Result is pure Old, and 255 means that Result is pure Target. 128 would mean that Result is half Old and half Target.

So if you repeatedly did this:
result = blend( current, target, amount);
current = result;
The color of ‘current’ would drift toward target over time.

(There are some snags having to do with integer rounding of color values, but the idea is correct.)

fadeToBlackBy( amount) can be thought of as
blend( existing, CRGB::Black, amount);

But the looping and timing is in your code, not the color math functions.

Awesome, thanks, that makes sense. I’ll be giving it a shot tonight during the game and will report back.

This all worked great, thanks so much! I even went and changed the fadetoblack to use the blend as well so that they have the same looking profile. The code I used for fading up and down was:

for(int j = 0; j <256; j++)
{
    for(int i = 0; i < NUM_LEDS; i++) 
    { 
      leds[i] = blend( CRGB::Black, colorIndex[(i+1)%2], j);
      FastLED.show();
      FastLED.delay(1);
    }
}
FastLED.delay(300000);
for(int j = 255; j >=0; j--)
{
    for(int i = 0; i < NUM_LEDS; i++) 
    { 
      leds[i] = blend( CRGB::Black, colorIndex[(i+1)%2], j);
      FastLED.show();
      FastLED.delay(1);
    }
}  
FastLED.delay(300000);

BTW, the FastLED.delay(300000); seems to only delay for about 4 min 10 seconds or so, I assume that that is just drifting inaccuracies with the clock? It is close enough for me to be fine, but I was just curious.