ToggleButtonColors

interface ToggleButtonColors


Represents the background and content colors used in a toggle button in different states.

See ToggleButtonDefaults.toggleButtonColors for the default colors used, which are primary-styled for a checked toggle button and surface-styled for unchecked.

Summary

Public functions

State<Color>
@Composable
backgroundColor(enabled: Boolean, checked: Boolean)

Represents the background color for this toggle button, depending on enabled and checked.

State<Color>
@Composable
contentColor(enabled: Boolean, checked: Boolean)

Represents the content color for this toggle button, depending on enabled and checked.

Public functions

backgroundColor

Added in 1.0.0
@Composable
fun backgroundColor(enabled: Boolean, checked: Boolean): State<Color>

Represents the background color for this toggle button, depending on enabled and checked.

Parameters
enabled: Boolean

whether the toggle button is enabled

checked: Boolean

whether the toggle button is checked

contentColor

Added in 1.0.0
@Composable
fun contentColor(enabled: Boolean, checked: Boolean): State<Color>

Represents the content color for this toggle button, depending on enabled and checked.

Parameters
enabled: Boolean

whether the toggle button is enabled

checked: Boolean

whether the toggle button is checked