Language
Edit

ColorUtilities.GradientCompress(Gradient, Single, Single) Method

Definition

Compresses the gradient to the interval (p1, p2). The colors at the start and end of the result are the same as the gradient a.

public static UnityEngine.Gradient GradientCompress(UnityEngine.Gradient a, float p1, float p2);
static member GradientCompress : UnityEngine.Gradient * single * single -> UnityEngine.Gradient
Public Shared Function GradientCompress (a As Gradient, p1 As Single, p2 As Single) As Gradient

Parameters

a
UnityEngine.Gradient

The gradient we are trying to compress.

p1
Single

The starting position of the compressed gradient, where 0 <= p1 < p2 <= 1.

p2
Single

The ending position of the compressed gradient, where 0 <= p1 < p2 <= 1.

Returns

UnityEngine.Gradient

A new gradient with the gradient a compressed into the interval (p1, p2).

Applies to