How to animate color


I don’t know how to explain it.
What I want to do is something like this:



So the color should “move” forwared and go back again. Like the PingPong animation.
How can I achive such a behave? I made two materials, but I dont get the logic.

Hope you can give me some tips.


Google is your friend and someone made a video to help you: