Arrange shapes in a line equally and stop duplication

You need reference to object. Use  choosenColors[1].s as first argument for transition e.g.

transition.to(choosenColors[1].s,{time=vanishTime, alpha=0.01, xScale = 0.1, yScale = 0.1}) 

Note:

  • You omitted local key word in definition of newDelay function so you make it global.
  • Consider make s variable local. 

Read more :

Good luck:)