# SwitchDefaults

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/ToggleControl.kt+class:androidx.wear.compose.material.SwitchDefaults) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.1.0)


```
object SwitchDefaults
```

<br />

*** ** * ** ***

Contains the default values used by `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/Switch.composable#Switch(kotlin.Boolean,androidx.compose.ui.Modifier,androidx.wear.compose.material.SwitchColors,kotlin.Boolean,kotlin.Function1,androidx.compose.foundation.interaction.MutableInteractionSource)`.

## Summary

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/SwitchColors` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/wear/compose/material/SwitchDefaults#colors(androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color)( checkedThumbColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, checkedTrackColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, uncheckedThumbColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, uncheckedTrackColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color )` Creates a `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/SwitchColors` for use in a `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/Switch.composable#Switch(kotlin.Boolean,androidx.compose.ui.Modifier,androidx.wear.compose.material.SwitchColors,kotlin.Boolean,kotlin.Function1,androidx.compose.foundation.interaction.MutableInteractionSource)`. |

## Public functions

### colors

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

```
@Composable
fun colors(
    checkedThumbColor: Color = MaterialTheme.colors.secondary,
    checkedTrackColor: Color = checkedThumbColor.copy(alpha = ContentAlpha.disabled),
    uncheckedThumbColor: Color = MaterialTheme.colors.onSurface.copy(alpha = 0.6f),
    uncheckedTrackColor: Color = uncheckedThumbColor.copy(alpha = uncheckedThumbColor.alpha * ContentAlpha.disabled)
): SwitchColors
```

Creates a `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/SwitchColors` for use in a `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/Switch.composable#Switch(kotlin.Boolean,androidx.compose.ui.Modifier,androidx.wear.compose.material.SwitchColors,kotlin.Boolean,kotlin.Function1,androidx.compose.foundation.interaction.MutableInteractionSource)`.

| Parameters |
|---|---|
| `checkedThumbColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = MaterialTheme.colors.secondary` | The thumb color of this `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/Switch.composable#Switch(kotlin.Boolean,androidx.compose.ui.Modifier,androidx.wear.compose.material.SwitchColors,kotlin.Boolean,kotlin.Function1,androidx.compose.foundation.interaction.MutableInteractionSource)` when enabled and checked. |
| `checkedTrackColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = checkedThumbColor.copy(alpha = ContentAlpha.disabled)` | The track color of this `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/Switch.composable#Switch(kotlin.Boolean,androidx.compose.ui.Modifier,androidx.wear.compose.material.SwitchColors,kotlin.Boolean,kotlin.Function1,androidx.compose.foundation.interaction.MutableInteractionSource)` when enabled and checked. |
| `uncheckedThumbColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = MaterialTheme.colors.onSurface.copy(alpha = 0.6f)` | The thumb color of this `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/Switch.composable#Switch(kotlin.Boolean,androidx.compose.ui.Modifier,androidx.wear.compose.material.SwitchColors,kotlin.Boolean,kotlin.Function1,androidx.compose.foundation.interaction.MutableInteractionSource)` when enabled and unchecked. |
| `uncheckedTrackColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = uncheckedThumbColor.copy(alpha = uncheckedThumbColor.alpha * ContentAlpha.disabled)` | The track color of this `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/Switch.composable#Switch(kotlin.Boolean,androidx.compose.ui.Modifier,androidx.wear.compose.material.SwitchColors,kotlin.Boolean,kotlin.Function1,androidx.compose.foundation.interaction.MutableInteractionSource)` when enabled and unchecked. |