Fork me on GitHub
View source

package haxepunk.tweens.misc

class ColorTween


extends Tween

Tweens a color's red, green, and blue properties independently. Can also tween an alpha value.

Constructor

View source

new (type : TweenType) : Void

Constructor.


Parameters:
complete   

Optional completion callback.

type   

Tween type.

Variables

alpha : Float

The current alpha.

read only blue : Int

Blue value of the current color, from 0 to 255.

color : Color

The current color.

read only green : Int

Green value of the current color, from 0 to 255.

read only red : Int

Red value of the current color, from 0 to 255.

Functions

View source

tween (duration : Float, fromColor : Color, toColor : Color, fromAlpha : Float = 1, toAlpha : Float = 1, ease : EaseFunction) : Void

Tweens the color to a new color and an alpha to a new alpha.


Parameters:
duration   

Duration of the tween.

fromColor   

Start color.

toColor   

End color.

fromAlpha   

Start alpha

toAlpha   

End alpha.

ease   

Optional easer function.