ColorRampResult

data class ColorRampResult(val stops: List<ColorRampResult.Entry>, val valueForPosition: (position: Double) -> Double, val positionForValue: (value: Double) -> Double)

A data class that holds the result of generating a color ramp from a ColorScale. It contains the generated color stops and functions to map between values and positions.

Constructors

Link copied to clipboard
constructor(stops: List<ColorRampResult.Entry>, valueForPosition: (position: Double) -> Double, positionForValue: (value: Double) -> Double)

Types

Link copied to clipboard
data class Entry(val value: Double, val color: Color, val position: Double)

Represents a single point within the generated color ramp.

Properties

Link copied to clipboard
val positionForValue: (value: Double) -> Double

A function that returns a normalized position (0.0 to 1.0) for a given data value.

Link copied to clipboard

A list of Entry objects, each representing a specific color at a specific value and position.

Link copied to clipboard
val valueForPosition: (position: Double) -> Double

A function that returns a data value for a given normalized position (0.0 to 1.0).