Shimmer

data class Shimmer(highlightColor: Color, val animationSpec: InfiniteRepeatableSpec<Float> = infiniteRepeatable( animation = tween(durationMillis = 650, easing = LinearEasing), ), intensity: Float = 0.0f, dropOff: Float = 0.5f, tilt: Float = 20.0f) : PlaceholderHighlight

A PlaceholderHighlight that applies a shimmer effect.

This implementation is based on the concepts from the reference shimmer composable, adapting its properties like intensity, dropOff, and tilt for use with a Brush.

Parameters

highlightColor

The color of the shimmer highlight.

animationSpec

The animation spec for the shimmer progress.

intensity

Controls the brightness of the highlight at the center. Values are typically between 0f and 1f.

dropOff

Controls the size of the fading edge of the highlight. Values are typically between 0f and 1f.

tilt

The angle at which the highlight is tilted, in degrees.

durationMillis

The duration of one shimmer animation cycle.

Constructors

Link copied to clipboard
constructor(highlightColor: Color, animationSpec: InfiniteRepeatableSpec<Float> = infiniteRepeatable( animation = tween(durationMillis = 650, easing = LinearEasing), ), intensity: Float = 0.0f, dropOff: Float = 0.5f, tilt: Float = 20.0f)

Properties

Link copied to clipboard

Functions

Link copied to clipboard
open override fun alpha(progress: Float): Float

Returns the alpha (opacity) of the highlight at the current animation progress.

Link copied to clipboard
open override fun brush(progress: Float, size: Size): Brush

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