ColorScheme Class
A continuous color ramp, interpolated in the OKLab color space between evenly spaced stops.
public sealed class ColorSchemeConstructors
| Name | Description |
|---|---|
| ColorScheme(string, IEnumerable<ChartColor>) | Initializes a new instance of the ColorScheme class. |
ColorScheme(string, IEnumerable<ChartColor>)
ColorScheme.csInitializes a new instance of the ColorScheme class.
public ColorScheme(string name, IEnumerable<ChartColor> stops)Parameters
namestring- The name of the scheme.
stopsIEnumerable<ChartColor>- The colors of the ramp, from its start to its end. At least two.
Exceptions
ArgumentExceptionstopshas fewer than two colors.
Properties
| Name | Description |
|---|---|
| Blues | Gets a ramp from a very light blue to a dark blue. |
| Greens | Gets a ramp from a very light green to a dark green. |
| Greys | Gets a ramp from white to almost black. |
| Magma | Gets a perceptually uniform ramp from black to light yellow (magma, CC0). |
| Name | Gets the name of the scheme. |
| Oranges | Gets a ramp from a very light orange to a dark orange. |
| RedBlue | Gets a diverging ramp from dark red to dark blue, through a light gray. |
| RedYellowGreen | Gets a diverging ramp from dark red to dark green, through a light yellow. |
| Reds | Gets a ramp from a very light red to a dark red. |
| Stops | Gets the colors of the ramp. |
| Viridis | Gets a perceptually uniform ramp from dark purple to yellow (viridis, CC0). |
Blues
ColorScheme.csGets a ramp from a very light blue to a dark blue.
public static ColorScheme Blues { get; }Property value
Greens
ColorScheme.csGets a ramp from a very light green to a dark green.
public static ColorScheme Greens { get; }Property value
Greys
ColorScheme.csMagma
ColorScheme.csGets a perceptually uniform ramp from black to light yellow (magma, CC0).
public static ColorScheme Magma { get; }Property value
Name
ColorScheme.csOranges
ColorScheme.csGets a ramp from a very light orange to a dark orange.
public static ColorScheme Oranges { get; }Property value
RedBlue
ColorScheme.csGets a diverging ramp from dark red to dark blue, through a light gray.
public static ColorScheme RedBlue { get; }Property value
RedYellowGreen
ColorScheme.csGets a diverging ramp from dark red to dark green, through a light yellow.
public static ColorScheme RedYellowGreen { get; }Property value
Reds
ColorScheme.csGets a ramp from a very light red to a dark red.
public static ColorScheme Reds { get; }Property value
Stops
ColorScheme.csViridis
ColorScheme.csGets a perceptually uniform ramp from dark purple to yellow (viridis, CC0).
public static ColorScheme Viridis { get; }Property value
Methods
| Name | Description |
|---|---|
| Interpolate(double) | Returns the color at a position of the ramp. |
| ToString() | Returns a string that represents the current object. |
Interpolate(double)
ColorScheme.csReturns the color at a position of the ramp.
public ChartColor Interpolate(double t)Parameters
tdouble- The position, from 0 (the first stop) to 1 (the last stop). It is clamped.
Returns
ChartColor The color.