How can I make a material strobe between different colors?

I swear I’ve seen this before, but I’m failing to find any examples or tutorials for this. How would I make a material that will strobe between colors, like a lava lamp or something like that?

This would do it:

344850-strobe.gif

Thanks! That works. Follow up questions:

How could I skip the black color?

Where do I control the speed? Is it the multiply nodes?

What gif maker do you use? Mine always turn out much choppier than yours.

I was playing around with Sine and it does not look like a consistent change. It seems to ramp up to full intensity of one color, then abruptly switch to the next, then repeat with this new color. Any advice on getting the color change to be smoother or more gradual?

The speed is in 3 places

344857-screenshot-1.jpg

The lower you put those numbers, the slower the whole thing goes.

You can skip black by not letting the sines get to zero.

I use ScreenToGif.

Here’s a better one:

You probably also get different results if you start with blue or green…

Oh wow! I never found HueShift before. Thanks!!!