Table of Contents

DOGradientColor Method

Namespace
DG.Tweening

DOGradientColor(SpriteRenderer, Gradient, float)

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

Tweens a SpriteRenderer'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 SpriteRenderer
gradient Gradient

The gradient to use

duration float

The duration of the tween

Returns

Sequence