MTColorRamp

@Serializable(with = MTColorRampSerializer::class)
class MTColorRamp

Reference to a color ramp instance.

Types

Functions

suspend fun clone(): MTColorRamp

Clone this color ramp.

Returns the bounds of this color ramp.

suspend fun getCanvasStrip(options: MTColorRampCanvasOptions? = null): String?

Returns a data URL of the rendered strip of this color ramp.

suspend fun getColor(value: Double, options: MTColorRampGetColorOptions? = null): List<Int>

Returns the RGBA color for a given value.

suspend fun getColorHex(value: Double, options: MTColorRampGetColorOptions? = null): String?

Returns the hex color for a given value.

suspend fun getColorRelative(value: Double, options: MTColorRampGetColorOptions? = null): List<Int>

Returns the RGBA color for a relative value between 0 and 1.

Returns the raw color stops backing this ramp.

Indicates if the ramp starts with transparency.

suspend fun resample(method: MTColorRampResamplingMethod, samples: Int = 15): MTColorRamp

Resample the ramp using a non-linear method.

suspend fun reverse(options: MTColorRampCloneOptions? = null): MTColorRamp

Reverse the ramp. When clone is false, the current ramp is mutated and returned.

suspend fun scale(min: Double, max: Double, options: MTColorRampCloneOptions? = null): MTColorRamp

Scale the ramp to a new interval. When clone is false, the current ramp is mutated and returned.

suspend fun setStops(stops: List<MTColorStop>, options: MTColorRampCloneOptions? = null): MTColorRamp

Replace the stops of this ramp. When clone is false, the current ramp is mutated and returned.

Returns a ramp that starts fully transparent.