Recolor

class Recolor<S : Drawable>(drawable: S, toColor: PolyColor, animation: Animation? = null, onFinish: S.() -> Unit? = null) : ComponentOp.Animatable<S>

Changes the color of the component to the specified color. Supports animation and callback function on finish.

If the color is a PolyColor.Gradient, this component's color will be changed to a gradient between the current color and the specified color.

Since

0.19.1

Parameters

toColor

The color to change the component to.

animation

The animation to use.

onFinish

The callback function to execute when the color change animation finishes.

Constructors

Link copied to clipboard
constructor(drawable: S, toColor: PolyColor, animation: Animation? = null, onFinish: S.() -> Unit? = null)

Properties

Link copied to clipboard
var onFinish: S.() -> Unit?

Functions

Link copied to clipboard
fun add()
Link copied to clipboard
open override fun apply()
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open fun exclusive(): Boolean

If this is true, when this drawable operation is attempted to be added, if one is already present, instead of replacing it, it will be ignored.

Link copied to clipboard
@ApiStatus.Experimental
open fun finishNow()

finish this operation immediately.

Link copied to clipboard
fun remove()
Link copied to clipboard
open fun reset()
Link copied to clipboard
open fun reverse()
Link copied to clipboard
open override fun unapply(): Boolean
Link copied to clipboard
open override fun verify(): Boolean

override this function to verify that this operation is valid, which is run before it is applied. (default: always true)