public sealed struct Sandbox.Gradient
Describes a gradient between multiple colors
Related Guides
Broader workflow and conceptual references connected to this API.
When creating your own Classes/Structs/Assets/ect, you'll sometimes want custom editors that pair with them. For example, a Gradient Editor so you can visually see what the Gradient looks like instead of editing the Gradient as if it were a Struct with a list of Colours.
This class applies atmospheric effects to a fragment.
We try to keep as close to standard web styles as possible - but not every property is implemented. We'll use this page to highlight any differences.
In the editor Textures can be generated in a number of ways. They can be created from an image (which is pretty normal), or a color, or a gradient, or text, or SVG source. These are called texture generators.
Constructors
Showing 2 constructors
No results match this filter.
Methods
Showing 8 methods
public Color Evaluate(float time)
Evaluate the blend using the time, which is generally between 0 and 1
public void FixOrder()
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.
public static Sandbox.Gradient FromColors(Color[] colors)
Create a gradient from colors spaced out evenly
public Sandbox.Gradient WithFrames(System.Collections.Immutable.ImmutableList`1<Sandbox.Gradient.ColorFrame> frames)
No results match this filter.
Properties
Showing 4 properties
public System.Collections.Immutable.ImmutableList`1<Sandbox.Gradient.AlphaFrame> Sandbox.Gradient.Alphas { get; set; }
A list of color stops, which should be ordered by time
public System.Collections.Immutable.ImmutableList`1<Sandbox.Gradient.ColorFrame> Sandbox.Gradient.Colors { get; set; }
A list of color stops, which should be ordered by time
public Sandbox.Gradient.ColorFrame Sandbox.Gradient.Item { get; set; }
No results match this filter.
Metadata
| Field | Value |
|---|---|
| Namespace | Sandbox |
| Type | class |
| Assembly | Sandbox.System |
| Doc ID | T:Sandbox.Gradient |