ColorSequence

class ColorSequence(val colors: List<Pair<Double, ConvertibleToColorRGBa>>)(source)

Represents a sequence of colors along with their corresponding positions in a normalized range 0.0, 1.0. The ColorSequence allows for creating interpolated colors between the specified color points.

Constructors

Link copied to clipboard
constructor(colors: List<Pair<Double, ConvertibleToColorRGBa>>)

Properties

Link copied to clipboard
val colors: List<Pair<Double, ConvertibleToColorRGBa>>

A list of pairs where the first value is a position (ranging from 0.0 to 1.0) and the second value is a color that implements ConvertibleToColorRGBa.

Functions

Link copied to clipboard
infix fun blend(steps: Int): List<ColorRGBa>
Link copied to clipboard
fun color(t: Double): ColorRGBa

Calculates a color using interpolation based on the provided parameter t.

fun color(t0: Double, t1: Double, steps: Int): List<ColorRGBa>

Generates a sequence of interpolated colors between two specified values.

Link copied to clipboard
fun toColorBuffer(drawer: Drawer, width: Int = 256, height: Int = 16, type: ColorType = ColorType.UINT8_SRGB, format: ColorFormat = ColorFormat.RGBa): ColorBuffer

Converts a color sequence into a color buffer with a gradient representation.