Google is committed to advancing racial equity for Black communities. See how.

ElevationOverlay

interface ElevationOverlay
androidx.compose.material.ElevationOverlay

An ElevationOverlay is an overlay applied to the background color of Surface components, used to emphasize elevation in dark theme, where shadows are not as visible. An ElevationOverlay does not replace the shadows drawn by a Surface, but is used as an additional representation of elevation.

The default ElevationOverlay only applies in dark theme (!Colors.isLight), in accordance with the Material specification for Dark Theme.

See AmbientElevationOverlay to provide your own ElevationOverlay. You can provide null to have no ElevationOverlay applied.

Summary

Public methods
abstract Color
apply(color: Color, elevation: Dp)

Returns the new background Color to use, representing the original background color with an overlay corresponding to elevation applied.

Public methods

apply

@Composable abstract fun apply(
    color: Color,
    elevation: Dp
): Color

Returns the new background Color to use, representing the original background color with an overlay corresponding to elevation applied. Typically this should only be applied to Colors.surface.