Table of Contents

DOGradientColor Method

Namespace
DG.Tweening

DOGradientColor(Material, Gradient, float)

public static Sequence DOGradientColor(this Material target, Gradient gradient, float duration)

Tweens a Material's color using the given gradient (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener). Also stores the image as the tween's target so it can be used for filtered operations

Parameters

target Material
gradient Gradient

The gradient to use

duration float

The duration of the tween

Returns

Sequence

DOGradientColor(Material, Gradient, string, float)

public static Sequence DOGradientColor(this Material target, Gradient gradient, string property, float duration)

Tweens a Material's named color property using the given gradient (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener). Also stores the image as the tween's target so it can be used for filtered operations

Parameters

target Material
gradient Gradient

The gradient to use

property string

The name of the material property to tween (like _Tint or _SpecColor)

duration float

The duration of the tween

Returns

Sequence