pulse

fun Modifier.pulse(enabled: Boolean = true, targetScale: Float = 1.5f, initialScale: Float = 1.0f, color: Color = SparkTheme.colors.onSurface.dim3, shape: Shape = CircleShape, animationSpec: DurationBasedAnimationSpec<Float> = tween(1000)): Modifier

Applies a pulsating effect that is drawn behind the composable element. This effect creates a visual appearance where the background pulse scales up and fades out in a loop, simulating a pulsating effect.

Return

A Modifier that applies the pulsating effect behind the composable element.

Parameters

targetScale

The scale to which the pulse effect will grow during the animation.

initialScale

The starting scale of the pulse effect. Default to the component size. If you want to draw the pulse on a component with a transparent background then you should set this to be inferior than 1f otherwise you will get a flashing effect at the start of each pulse

color

The color used to fill the pulse effect.

shape

The shape of the pulse effect.

animationSpec

The animation specification.


fun Modifier.pulse(brush: Brush, enabled: Boolean = true, targetScale: Float = 1.5f, initialScale: Float = 1.0f, shape: Shape = CircleShape, animationSpec: DurationBasedAnimationSpec<Float> = tween(1000)): Modifier

Applies a pulsating effect that is drawn behind the composable element. This effect creates a visual appearance where the background pulse scales up and fades out in a loop, simulating a pulsating effect.

Return

A Modifier that applies the pulsating effect behind the composable element.

Parameters

targetScale

The scale to which the pulse effect will grow during the animation.

initialScale

The starting scale of the pulse effect.

brush

The brush used to fill the pulse effect.

shape

The shape of the pulse effect.

animationSpec

The animation specification.