<div class='sourceset sourceset-common'>Common</div>

```kotlin
object SwitchDefaults
```

Contains the default values used by [Switch](/jetpack-compose/androidx.compose.material/material/components/Switch)

## Functions

<h2 id="colors-checkedthumbcolor-checkedtrackcolor-checkedtrackalpha-uncheckedthumbcolor-uncheckedtrackcolor-uncheckedtrackalpha-disabledcheckedthumbcolor-disabledcheckedtrackcolor-disableduncheckedthumbcolor-disableduncheckedtrackcolor">colors</h2>

```kotlin
@Composable
    fun colors(
        checkedThumbColor: Color = MaterialTheme.colors.secondaryVariant,
        checkedTrackColor: Color = checkedThumbColor,
        checkedTrackAlpha: Float = 0.54f,
        uncheckedThumbColor: Color = MaterialTheme.colors.surface,
        uncheckedTrackColor: Color = MaterialTheme.colors.onSurface,
        uncheckedTrackAlpha: Float = 0.38f,
        disabledCheckedThumbColor: Color =
            checkedThumbColor
                .copy(alpha = ContentAlpha.disabled)
                .compositeOver(MaterialTheme.colors.surface),
        disabledCheckedTrackColor: Color =
            checkedTrackColor
                .copy(alpha = ContentAlpha.disabled)
                .compositeOver(MaterialTheme.colors.surface),
        disabledUncheckedThumbColor: Color =
            uncheckedThumbColor
                .copy(alpha = ContentAlpha.disabled)
                .compositeOver(MaterialTheme.colors.surface),
        disabledUncheckedTrackColor: Color =
            uncheckedTrackColor
                .copy(alpha = ContentAlpha.disabled)
                .compositeOver(MaterialTheme.colors.surface),
    ): SwitchColors
```

Creates a [SwitchColors](/jetpack-compose/androidx.compose.material/material/interfaces/SwitchColors) that represents the different colors used in a [Switch](/jetpack-compose/androidx.compose.material/material/components/Switch) in different
states.

#### Parameters

| | |
| --- | --- |
| checkedThumbColor | the color used for the thumb when enabled and checked |
| checkedTrackColor | the color used for the track when enabled and checked |
| checkedTrackAlpha | the alpha applied to `checkedTrackColor` and `disabledCheckedTrackColor` |
| uncheckedThumbColor | the color used for the thumb when enabled and unchecked |
| uncheckedTrackColor | the color used for the track when enabled and unchecked |
| uncheckedTrackAlpha | the alpha applied to `uncheckedTrackColor` and `disabledUncheckedTrackColor` |
| disabledCheckedThumbColor | the color used for the thumb when disabled and checked |
| disabledCheckedTrackColor | the color used for the track when disabled and checked |
| disabledUncheckedThumbColor | the color used for the thumb when disabled and unchecked |
| disabledUncheckedTrackColor | the color used for the track when disabled and unchecked |