Gradient

class Gradient @JvmOverloads constructor(val colors: IntArray, val startPoints: FloatArray, val colorMapSize: Int = DEFAULT_COLOR_MAP_SIZE)

A class to generate a color map from a given array of colors and the fractions that the colors represent by interpolating between their HSV values. This color map is to be used in the HeatmapTileProvider.

Parameters

colors

The colors to be used in the gradient.

startPoints

The starting point for each color, given as a percentage of the maximum intensity. This is given as an array of floats with values in the interval 0, 1.

colorMapSize

The size of the colorMap to be generated by the Gradient. Default value is 1000.

Constructors

Link copied to clipboard
constructor(colors: IntArray, startPoints: FloatArray, colorMapSize: Int = DEFAULT_COLOR_MAP_SIZE)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun generateColorMap(opacity: Double = HeatmapTileProvider.DEFAULT_OPACITY): IntArray

Generates a color map array from the gradient's colors and start points. This map is a key component for rendering the heatmap, where each color corresponds to a different intensity level.