RippleTheme


Defines the appearance for Ripples. You can define a new theme and apply it using LocalRippleTheme. See defaultRippleColor and defaultRippleAlpha for default values that can be used when creating your own RippleTheme.

See also
rememberRipple

Summary

Public companion functions

RippleAlpha
defaultRippleAlpha(contentColor: Color, lightTheme: Boolean)

This function is deprecated. The default ripple alpha varies between design system versions: this function technically implements the default used by the material library, but is not used by the material3 library.

Cmn
Color
defaultRippleColor(contentColor: Color, lightTheme: Boolean)

This function is deprecated. The default ripple color varies between design system versions: this function technically implements the default used by the material library, but is not used by the material3 library.

Cmn

Public functions

Color

This function is deprecated. RippleTheme and LocalRippleTheme have been deprecated - they are not compatible with the new ripple implementation using the new Indication APIs that provide notable performance improvements.

Cmn
RippleAlpha

This function is deprecated. RippleTheme and LocalRippleTheme have been deprecated - they are not compatible with the new ripple implementation using the new Indication APIs that provide notable performance improvements.

Cmn

Public companion functions

defaultRippleAlpha

fun defaultRippleAlpha(contentColor: Color, lightTheme: Boolean): RippleAlpha

Represents the default RippleAlpha that will be used for a ripple to indicate different states.

Parameters
contentColor: Color

the color of content (text or iconography) in the component that contains the ripple.

lightTheme: Boolean

whether the theme is light or not

defaultRippleColor

fun defaultRippleColor(contentColor: Color, lightTheme: Boolean): Color

Represents the default color that will be used for a ripple if a color has not been explicitly set on the ripple instance.

Parameters
contentColor: Color

the color of content (text or iconography) in the component that contains the ripple.

lightTheme: Boolean

whether the theme is light or not

Public functions

defaultColor

@Composable
fun defaultColor(): Color
Returns
Color

the default ripple color at the call site's position in the hierarchy. This color will be used when a color is not explicitly set in the ripple itself.

rippleAlpha

@Composable
fun rippleAlpha(): RippleAlpha
Returns
RippleAlpha

the RippleAlpha used to calculate the alpha for the ripple depending on the Interaction for a given component. This will be set as the alpha channel for defaultColor or the color explicitly provided to the ripple.