Animated

open class Animated(hue: Float, saturation: Float, brightness: Float, alpha: Float) : PolyColor

An animatable version of Color, that supports recoloring with animations.

Inheritors

Constructors

Link copied to clipboard
constructor(hue: Float, saturation: Float, brightness: Float, alpha: Float)

Properties

Link copied to clipboard
@get:JvmName(name = "alpha")
val a: Int

alpha value of this color, from 0 to 255

Link copied to clipboard

The alpha of this color. Clamped between 0f..1f.

Link copied to clipboard
@get:JvmName(name = "getARGB")
var argb: Int

return an integer representation of this color. Utilizes bit-shifts to store the color as one 32-bit integer, like so:

Link copied to clipboard
@get:JvmName(name = "blue")
val b: Int

blue value of this color, from 0 to 255

Link copied to clipboard

The brightness of this color. Clamped between 0f..1f.

Link copied to clipboard

Set this to true to update the argb value.

Link copied to clipboard
@get:JvmName(name = "green")
val g: Int

green value of this color, from 0 to 255

Link copied to clipboard
var hue: Float

The hue of this color. Can be any value, but is mod 360, so values are always between 0 and 360.

Link copied to clipboard
@get:JvmName(name = "red")
val r: Int

red value of this color, from 0 to 255

Link copied to clipboard

The saturation of this color. Clamped between 0f..1f.

Link copied to clipboard
Link copied to clipboard
open val updating: Boolean

return if the color is still updating (i.e. it has an animation to finish)

Functions

Link copied to clipboard
open override fun clone(): PolyColor.Animated
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
@ApiStatus.Experimental
fun <S : Drawable> PolyColor.makeChroma(speedNanos: Ref.LongRef = 5.seconds.toChromaSpeed()): DrawableOp

Make the given color chroma, meaning it will change its hue over time.

Link copied to clipboard
open fun recolor(target: Color, animation: Animation? = null)

recolor this color to the target color, with the given animation type and duration.

Link copied to clipboard
fun take(color: Color): Color
Link copied to clipboard
open override fun toAnimatable(): PolyColor.Animated
Link copied to clipboard

Return a static java Color object of this color at the instant this method is called.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
open fun update(deltaTimeNanos: Long): Boolean

update the color animation, if present. After, the animation is cleared, and the color becomes static again.