Transition to setFillColor?

Hey,

Is there a way I can transition an object’s fill color?

For example a rectangle that turns from green to red over a period of time.

Try this:

  1. Download this file: https://github.com/roaminggamer/SSKCorona/blob/master/ssk/libs/extensions/transition_color.lua

  2. Try  this sample:

    require “transition_color” local myCircle = display.newCircle( 100, 100, 25 ) transition.fromtocolor( myCircle, { 255, 255, 255 }, { 255, 0 , 0 }, 2000 )  

Tip: This code is not future-proof.  If transition adds fields with these names, it will break this code:

  • callback
  • fromtocolor

perfect, thank you

Try this:

  1. Download this file: https://github.com/roaminggamer/SSKCorona/blob/master/ssk/libs/extensions/transition_color.lua

  2. Try  this sample:

    require “transition_color” local myCircle = display.newCircle( 100, 100, 25 ) transition.fromtocolor( myCircle, { 255, 255, 255 }, { 255, 0 , 0 }, 2000 )  

Tip: This code is not future-proof.  If transition adds fields with these names, it will break this code:

  • callback
  • fromtocolor

perfect, thank you