haze

fun Modifier.haze(state: HazeState, style: HazeStyle = HazeDefaults.style()): Modifier

Draw content within the provided HazeState.areas blurred in a 'glassmorphism' style.

When running on Android 12 devices (and newer), usage of this API renders the corresponding composable into a separate graphics layer. On older Android platforms, a translucent scrim will be drawn instead.

Parameters

style

Default style to use for areas calculated from hazeChilds. Typically you want to use HazeDefaults.style to define the default style. Can be overridden by each hazeChild via its style parameter.


fun Modifier.haze(state: HazeState, backgroundColor: Color, tint: Color = HazeDefaults.tint(backgroundColor), blurRadius: Dp = HazeDefaults.blurRadius, noiseFactor: Float = HazeDefaults.noiseFactor): Modifier

Deprecated

Deprecated. Replaced with new HazeStyle object

Replace with

haze(state, HazeStyle(tint, blurRadius, noiseFactor))