Class HeatmapExtensions
Access to the heatmap color palettes of HeatmapTypes, loaded from the palette images embedded in this assembly.
public static class HeatmapExtensions
- Inheritance
-
objectHeatmapExtensions
Methods
GetColor(HeatmapTypes, int)
Gets the palette color at the given position.
public static Color GetColor(HeatmapTypes type, int percent)
Parameters
typeHeatmapTypesThe palette.
percentintPosition in the palette from 0 to 100; values outside the range are clamped to the first or the last color.
Returns
- Color
The palette color; System.Drawing.Color.Transparent when
percentis 0 or the palette is unknown.
Initialize()
Loads the palette images of all HeatmapTypes values and their colors. Thread-safe; does nothing once the palettes are loaded. Called by the static constructor, so explicit calls are not required; a missing or undecodable palette image therefore fails the first use of the class with a System.TypeInitializationException.
public static void Initialize()
IsCombinedHeatmap(HeatmapTypes)
Checks if the heatmap is a combination of two heatmaps for ask and bids separately
public static bool IsCombinedHeatmap(this HeatmapTypes heatmapTypes)
Parameters
heatmapTypesHeatmapTypes
Returns
- bool
TryGetImage(HeatmapTypes)
Gets the palette image of type: a horizontal gradient from the lowest to the highest volume color.
The bitmap is shared and must not be disposed or modified.
public static SKBitmap? TryGetImage(this HeatmapTypes type)
Parameters
typeHeatmapTypesThe palette.
Returns
- SKBitmap
The palette image, or null when there is no image for
type.