I am trying to fade a specific hex color to black and then back

I am trying to fade a specific hex color to black and then back to the hex color again. Any built in function that I can use to accomplish this? Trying to get one last Christmas light animation done for tonight. Basically all odd LEDs will be fading from black to white and the even LEDs will be fading from green to black to red to black and back to green.

That’s the idea anyways.

You could probably modify this to use your specific colors instead a random target color.

@marmil Marc, Thanks for the help. I wasn’t super happy with the results and gave up. The hex color I am using is the C9 white from Mark’s TwinkleFox sketch which if you look it up online is a green color so when it was fading to black it went green then black. I’ll give it another go next year.

the blend() functions seems like a reasonable place to start?