VizPalette

The colours a drawing works in.

Each palette is three stops through a colour space built on what the eye actually sees, plus a ground to sit on and a bright marker. Working that way rather than in red, green and blue keeps a drawing that cycles its colour from pulsing: walking hue round the circle in the usual way makes the picture pulse, because yellow at a given setting is far lighter than blue at the same setting. Here a full turn keeps its brightness the whole way round.

low to high runs from the bottom of a bar to the top, so a loud bar reaches the hot end of the ramp. cap is the falling marker and background is what sits behind everything.

baseHue and hueSpan are for the drawings that cycle colour over time. Staying inside a palette's own span is what keeps a rotating hue looking like the same palette rather than like a rainbow that wandered in.

Twelve are built in. fromColors and fromImage build new ones, for example from an album cover.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val cap: Color
Link copied to clipboard
val high: Color
Link copied to clipboard
Link copied to clipboard
val low: Color
Link copied to clipboard
val mid: Color
Link copied to clipboard

Functions

Link copied to clipboard
fun cycled(position: Float, saturation: Float = 0.85f, value: Float = 1.0f, alpha: Float = 1.0f): Color

A colour from this palette's own span. position wraps, so feeding it a rising number cycles forever.

Link copied to clipboard
fun ramp(position: Float): Color

The ramp read at position, 0 at low and 1 at high.

Link copied to clipboard
open override fun toString(): String