Jump to content
GreenSock

iotron

Change fill color of svg on each repeat and apply a random color from array

Recommended Posts

Hi, I am trying to change the fill color in the colorAnime function so the elements get randomised colors on each loop iteration. Kindly help, right now the fill doesn't change after the first iteration. Thank you.

See the Pen MWVWvgP by iotronlab (@iotronlab) on CodePen

Link to comment
Share on other sites

It looks like you just forgot to set repeatRefresh: true so that on each iteration, it flushes out all the recorded start/end values and re-initializes all the animations so they pull new data from the function(s):

See the Pen mdxRwVb?editors=0010 by GreenSock (@GreenSock) on CodePen

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×