Skip to content

FourCornerGradient

StructChartGuruChartGuru
public struct FourCornerGradient

Stores one colour per corner of a rectangle and supports bilinear colour evaluation. Coordinate convention: Y is up (bottom-left = (0,0), top-right = (1,1)).

[Tooltip("Colour at the top-left corner of the area.")]
public Color TopLeft

Returns

UnityEngine.Color

[Tooltip("Colour at the top-right corner of the area.")]
public Color TopRight

Returns

UnityEngine.Color

[Tooltip("Colour at the bottom-left corner of the area.")]
public Color BottomLeft

Returns

UnityEngine.Color

[Tooltip("Colour at the bottom-right corner of the area.")]
public Color BottomRight

Returns

UnityEngine.Color

FourCornerGradient(Color, Color, Color, Color)

Section titled “FourCornerGradient(Color, Color, Color, Color)”
public FourCornerGradient(Color topLeft, Color topRight, Color bottomLeft, Color bottomRight)

Creates a bilinear gradient by assigning a color to each corner in bottom-left-origin coordinates.

Parameters

Name Type
topLeft UnityEngine.Color
topRight UnityEngine.Color
bottomLeft UnityEngine.Color
bottomRight UnityEngine.Color

public Color Evaluate(float u, float v)

Bilinearly interpolates the four corner colours at normalised Position (u, v). u = 0 is left, u = 1 is right; v = 0 is bottom, v = 1 is top.

Parameters

Name Type
u System.Single
v System.Single

Returns

UnityEngine.Color

public static FourCornerGradient Default { get; }

Default: light grey top-left/bottom-right, slightly lighter top-right/bottom-left (diagonal gradient).

Returns

ChartGuru.FourCornerGradient

public static FourCornerGradient HorizonDawn { get; }

Calm blue-to-cyan dawn palette.

Returns

ChartGuru.FourCornerGradient

public static FourCornerGradient CoralSunset { get; }

Warm sunset: pink top shifting into amber/peach on the bottom.

Returns

ChartGuru.FourCornerGradient

public static FourCornerGradient MintLagoon { get; }

Cool lime-to-teal wash, nicely saturated for light themes.

Returns

ChartGuru.FourCornerGradient

public static FourCornerGradient NebulaVioletRose { get; }

Violet-to-magenta with a pink lower band; high contrast for dark themes.

Returns

ChartGuru.FourCornerGradient

public static FourCornerGradient TwilightEmber { get; }

Dark indigo fading into amber for a moody “dusk” look.

Returns

ChartGuru.FourCornerGradient

public static FourCornerGradient MidnightSlate { get; }

Polished dark-surface Preset (inky blues) for dark themes.

Returns

ChartGuru.FourCornerGradient