Icon color changing with time

Is it possible to change the icon color as in a loop.
Kind of like a scene you have on light strips or other RGB lights?

I have one light that is always in a scene with looping color.
My thought was to use a state changing color with time. Last digit of the seconds = a new color.
I havn’t found any “time” you can use as state. Is there?

Or something like that.