# ToggleButtonColors

# ToggleButtonColors

Artifact:[androidx.wear.compose:compose-material](https://developer.android.com/jetpack/androidx/releases/wear-compose)  
[View Source](https://cs.android.com/search?q=file:androidx/wear/compose/material/ToggleButton.kt+class:androidx.wear.compose.material.ToggleButtonColors)  
Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.0.0)

<br />

```
interface ToggleButtonColors
```

<br />

*** ** * ** ***

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

See[ToggleButtonDefaults.toggleButtonColors](https://developer.android.com/reference/kotlin/androidx/wear/compose/material/ToggleButtonDefaults#toggleButtonColors(androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color))for the default colors used, which are primary-styled for a checked toggle button and surface-styled for unchecked.

## Summary

|                                                                                  ### Public functions                                                                                  |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [State](https://developer.android.com/reference/kotlin/androidx/compose/runtime/State)`<`[Color](https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color)`>` | `@`[Composable](https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable) [backgroundColor](https://developer.android.com/reference/kotlin/androidx/wear/compose/material/ToggleButtonColors#backgroundColor(kotlin.Boolean,kotlin.Boolean))`(enabled: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`, checked: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`)` Represents the background color for this toggle button, depending on[enabled](https://developer.android.com/reference/kotlin/androidx/wear/compose/material/ToggleButtonColors#backgroundColor(kotlin.Boolean,kotlin.Boolean))and[checked](https://developer.android.com/reference/kotlin/androidx/wear/compose/material/ToggleButtonColors#backgroundColor(kotlin.Boolean,kotlin.Boolean)). |
| [State](https://developer.android.com/reference/kotlin/androidx/compose/runtime/State)`<`[Color](https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color)`>` | `@`[Composable](https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable) [contentColor](https://developer.android.com/reference/kotlin/androidx/wear/compose/material/ToggleButtonColors#contentColor(kotlin.Boolean,kotlin.Boolean))`(enabled: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`, checked: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`)` Represents the content color for this toggle button, depending on[enabled](https://developer.android.com/reference/kotlin/androidx/wear/compose/material/ToggleButtonColors#contentColor(kotlin.Boolean,kotlin.Boolean))and[checked](https://developer.android.com/reference/kotlin/androidx/wear/compose/material/ToggleButtonColors#contentColor(kotlin.Boolean,kotlin.Boolean)).                |

## Public functions

### backgroundColor

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.0.0)  

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

Represents the background color for this toggle button, depending on[enabled](https://developer.android.com/reference/kotlin/androidx/wear/compose/material/ToggleButtonColors#backgroundColor(kotlin.Boolean,kotlin.Boolean))and[checked](https://developer.android.com/reference/kotlin/androidx/wear/compose/material/ToggleButtonColors#backgroundColor(kotlin.Boolean,kotlin.Boolean)).  

|                                           Parameters                                           |
|------------------------------------------------------------------------------------------------|--------------------------------------|
| `enabled: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | whether the toggle button is enabled |
| `checked: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | whether the toggle button is checked |

### contentColor

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.0.0)  

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

Represents the content color for this toggle button, depending on[enabled](https://developer.android.com/reference/kotlin/androidx/wear/compose/material/ToggleButtonColors#contentColor(kotlin.Boolean,kotlin.Boolean))and[checked](https://developer.android.com/reference/kotlin/androidx/wear/compose/material/ToggleButtonColors#contentColor(kotlin.Boolean,kotlin.Boolean)).  

|                                           Parameters                                           |
|------------------------------------------------------------------------------------------------|--------------------------------------|
| `enabled: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | whether the toggle button is enabled |
| `checked: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | whether the toggle button is checked |