I want to create a christmas themed animation for my led stripe.

I want to create a christmas themed animation for my led stripe.

Every led should be green by default (like a tree).
And some random leds should blink red, yellow and white (like lights and decoration).

I already build an animation for a “night sky” where some leds twinkle like stars using the fadeToBlackBy-function.

Is there something like a fadeToGreenBy-function? :slight_smile:

If you haven’t checked it out already, you might also want to look at “TwinkleFox”-- twinkling holiday lights with selectable color palettes. https://plus.google.com/u/0/112916219338292742137/posts/XWiEEeDxFWZ?iem=4&gpawv=1&hl=en-US

Looks really great and I will consider putting it into my project.

But it’s not what I am looking for. :wink:

Heh. Duly noted.

Somewhere around here I have a generic “blend this pixel toward that color” function. I’ll see if I can dig it up when I’m back at my laptop.

A very slightly tweaked (palettes and timing) Twinkle Fox 2015 is running 400 12mm pixels on the front of my house (Lancashire, United Kingdom) this year, along with a 5 pointed star running a variation (background animation of confetti and juggle) on @Mark_Kriegsman marquee animation.

Its turned quite a few heads.

Season Greetings!

@Christoph_Wempe ​, did you notice that in twinkle fox you can set the background colour? And then just use a colour palette containing your desired foreground colours… That seems to be pretty close to what you asked for.

@Jeremy_Spencer
Thanks. I will look closer into this when I find the time.

This wouldn’t be very complicated using CHSV either. Set every pixel to CHSV green, and randomly pick a pixel to make a different color by just moving the C value towards red or blue or something like that. Pry a few lines of code at most.

I guess I will follow your advices and come up with my own lines of could.
I was just hoping there would already be a nice little function to do the trick. :blush:

I extracted my “fadeTowardColor” functions into this code; take a look at how it works, and as always feel free to incorporate it or modify it any way you wish! There are a few additional notes in the file. Enjoy, and please do post pictures or video of what you build!

@Mark_Kriegsman Thank you very much!

You’re welcome!

Cross-fades through the RGB colorspace are pretty easy: just separately fade the R, G, and B values toward their target values. As for cross-fades through HSV color space… I’m gonna pass on that topic for now.

Anyway – enjoy!