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

SwitchColors

@Stable interface SwitchColors
androidx.compose.material.SwitchColors

Represents the colors used by a Switch in different states

See SwitchConstants.defaultColors for the default implementation that follows Material specifications.

Summary

Public methods
abstract Color
thumbColor(enabled: Boolean, checked: Boolean)

Represents the color used for the switch's thumb, depending on enabled and checked.

abstract Color
trackColor(enabled: Boolean, checked: Boolean)

Represents the color used for the switch's track, depending on enabled and checked.

Public methods

thumbColor

abstract fun thumbColor(
    enabled: Boolean,
    checked: Boolean
): Color

Represents the color used for the switch's thumb, depending on enabled and checked.

Parameters
enabled: Boolean whether the Switch is enabled or not
checked: Boolean whether the Switch is checked or not

trackColor

abstract fun trackColor(
    enabled: Boolean,
    checked: Boolean
): Color

Represents the color used for the switch's track, depending on enabled and checked.

Parameters
enabled: Boolean whether the Switch is enabled or not
checked: Boolean whether the Switch is checked or not