Blob

fun Blob(layers: List<BlobLayer>, modifier: Modifier = Modifier, shape: Shape = CircleShape, intensity: () -> Float = { 1f }, speed: () -> Float = { 1f }, animate: Boolean = true)(source)

Draws layers as morphing outlines of shape, the first layer at the bottom.

The shape fills this composable's bounds. Layers that move outward draw outside those bounds, like a shadow does, so give the blob padding or a smaller size than its container when the outer layers must stay visible.

Both lambdas are read every frame without recomposing, so they can follow fast-changing state such as a microphone level.

Parameters

layers

The layers to draw, bottom first.

shape

Base outline. Any Shape works: CircleShape, rounded corners, a GenericShape, or a Material 3 shape. Only the first contour of the shape's outline is used.

intensity

Multiplier of every layer's swing around the middle of its amplitude range. 0 holds each layer still at the midpoint, 1 uses the full range, above 1 overshoots it.

speed

Multiplier of every layer's tempo and spin. Changes take effect smoothly, because the wobble advances by speed each frame instead of being scaled after the fact.

animate

False stops the motion where it is, for example for reduced motion.