Gradientclass

Describes a gradient between multiple colors

objectGradient
Namespace
Sandbox
Assembly
Sandbox.System
Declaration
public sealed struct Sandbox.Gradient

Constructors2

Showing 2 constructors

Methods8

Showing 8 methods

public Color Evaluate(float time)PUBLIC

Evaluate the blend using the time, which is generally between 0 and 1

ParameterTypeDescription
timefloat
Returns:Color

public void FixOrder()PUBLIC

If the lists aren't in time order for some reason, this will fix them. This should really just be called when serializing, and in every other situation we should assume they're okay.

Returns:void

public static Sandbox.Gradient FromColors(Color[] colors)PUBLICSTATIC

Create a gradient from colors spaced out evenly

ParameterTypeDescription
colorsColor[]
Returns:Gradient

Properties4

Showing 4 properties

public System.Collections.Immutable.ImmutableList`1<Sandbox.Gradient.AlphaFrame> Sandbox.Gradient.Alphas { get; set; }PUBLICGETSET

A list of color stops, which should be ordered by time

Returns:ImmutableList<AlphaFrame>

public System.Collections.Immutable.ImmutableList`1<Sandbox.Gradient.ColorFrame> Sandbox.Gradient.Colors { get; set; }PUBLICGETSET

A list of color stops, which should be ordered by time

Returns:ImmutableList<ColorFrame>

On this page