Pulse

data class Pulse(highlightColor: Color, val animationSpec: InfiniteRepeatableSpec<Float>) : PlaceholderHighlight

A PlaceholderHighlight that pulses the highlight color in and out.

This is achieved by animating the alpha of a solid color brush.

Parameters

highlightColor

The color of the pulse highlight.

animationSpec

The specification for the animation.

Constructors

Link copied to clipboard
constructor(highlightColor: Color, animationSpec: InfiniteRepeatableSpec<Float>)

Properties

Link copied to clipboard

Functions

Link copied to clipboard
open override fun alpha(@FloatRange(from = 0.0, to = 1.0) progress: Float): Float

The alpha value is directly driven by the animation progress.

Link copied to clipboard
open override fun brush(@FloatRange(from = 0.0, to = 1.0) progress: Float, size: Size): Brush

Returns the brush to draw the highlight at the current animation progress.