Backdrop effects

Backdrop effects are RenderEffects radically. They only take effect with Android 12 and above. Some effects involving with RuntimeShader need Android 13 and above.

The order of effects matters. To create the right visual effects, you must apply them with the following order:

color filter ⇒ blur ⇒ lens

Color filter

Custom ColorFilter

colorFilter(colorFilter: (Android)ColorFilter)
colorFilter(colorFilter: (Compose)ColorFilter)

Opacity

opacity(alpha: Float)

Color controls (brightness, contrast, saturation)

colorControls(
    brightness: Float = 0f,
    contrast: Float = 1f,
    saturation: Float = 1f
)

Vibrancy

Multiply saturation with 1.5. It is equivalent to colorControls(saturation = 1.5f) .

Exposure adjustment

Gamma adjustment (Android 13+)

Blur

Blur effect

Lens (Android 13+)

⚠️ To use the lens effect, your shape must be CornerBasedShape .

Lens effect

  • height must be in [0, shape.minCornerRadius ]. If it exceeds, it will have discontinuities at some corners, but it's acceptable.

  • amount must be in [0, size.minDimension ].

RenderEffect

Custom RenderRffect

Last updated