ColorScheme Class

A continuous color ramp, interpolated in the OKLab color space between evenly spaced stops.

public sealed class ColorScheme

Constructors

NameDescription
ColorScheme(string, IEnumerable<ChartColor>)Initializes a new instance of the ColorScheme class.

ColorScheme(string, IEnumerable<ChartColor>)

ColorScheme.cs

Initializes a new instance of the ColorScheme class.

public ColorScheme(string name, IEnumerable<ChartColor> stops)

Parameters

name string
The name of the scheme.
stops IEnumerable<ChartColor>
The colors of the ramp, from its start to its end. At least two.

Exceptions

ArgumentException
stops has fewer than two colors.

Properties

NameDescription
BluesGets a ramp from a very light blue to a dark blue.
GreensGets a ramp from a very light green to a dark green.
GreysGets a ramp from white to almost black.
MagmaGets a perceptually uniform ramp from black to light yellow (magma, CC0).
NameGets the name of the scheme.
OrangesGets a ramp from a very light orange to a dark orange.
RedBlueGets a diverging ramp from dark red to dark blue, through a light gray.
RedYellowGreenGets a diverging ramp from dark red to dark green, through a light yellow.
RedsGets a ramp from a very light red to a dark red.
StopsGets the colors of the ramp.
ViridisGets a perceptually uniform ramp from dark purple to yellow (viridis, CC0).

Gets a ramp from a very light blue to a dark blue.

public static ColorScheme Blues { get; }

Property value

ColorScheme

Gets a ramp from a very light green to a dark green.

public static ColorScheme Greens { get; }

Property value

ColorScheme

Gets a ramp from white to almost black.

public static ColorScheme Greys { get; }

Property value

ColorScheme

Gets a perceptually uniform ramp from black to light yellow (magma, CC0).

public static ColorScheme Magma { get; }

Property value

ColorScheme

Gets the name of the scheme.

public string Name { get; }

Property value

string

Gets a ramp from a very light orange to a dark orange.

public static ColorScheme Oranges { get; }

Property value

ColorScheme

Gets a diverging ramp from dark red to dark blue, through a light gray.

public static ColorScheme RedBlue { get; }

Property value

ColorScheme

RedYellowGreen

ColorScheme.cs

Gets a diverging ramp from dark red to dark green, through a light yellow.

public static ColorScheme RedYellowGreen { get; }

Property value

ColorScheme

Gets a ramp from a very light red to a dark red.

public static ColorScheme Reds { get; }

Property value

ColorScheme

Gets the colors of the ramp.

public IReadOnlyList<ChartColor> Stops { get; }

Gets a perceptually uniform ramp from dark purple to yellow (viridis, CC0).

public static ColorScheme Viridis { get; }

Property value

ColorScheme

Methods

NameDescription
Interpolate(double)Returns the color at a position of the ramp.
ToString()Returns a string that represents the current object.

Interpolate(double)

ColorScheme.cs

Returns the color at a position of the ramp.

public ChartColor Interpolate(double t)

Parameters

t double
The position, from 0 (the first stop) to 1 (the last stop). It is clamped.

Returns

ChartColor The color.

ToString()

ColorScheme.cs

Returns a string that represents the current object.

public override string ToString()

Returns

string A string that represents the current object.