How can I make a material strobe between different colors?

This would do it:

344850-strobe.gif