I don't know how do that use the loop

I need your help
I don’t know how to do that use the loop to change the color

截圖 2020-11-08 上午9.30.26

Do you have the positions calculated?

For color look a lerpColor command in the reference and use the variable of your for-loop