HueState

class HueState(initial: Hue)(source)

Holds the session hue. The UI can re-roll it with shuffle ("Shuffle colors") or set a specific one through hue (e.g. from a hue slider). Reading hue in composition subscribes to changes.

Constructors

Link copied to clipboard
constructor(initial: Hue)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
var hue: Hue

The current hue. Setting it recolors everything themed from this state; any angle is accepted, since Hue is already normalised to [0, 360).

Functions

Link copied to clipboard
fun shuffle(random: Random = Random.Default, minDistance: Float = 45.0f)

Replaces hue with a random hue at least minDistance degrees away from the current one, so a shuffle always looks like a change. minDistance is clamped to [0, 180].