SwitchColors

class SwitchColors


Represents the colors used by a Switch in different states

Summary

Public constructors

SwitchColors(
    checkedThumbColor: Color,
    checkedTrackColor: Color,
    checkedBorderColor: Color,
    checkedIconColor: Color,
    uncheckedThumbColor: Color,
    uncheckedTrackColor: Color,
    uncheckedBorderColor: Color,
    uncheckedIconColor: Color,
    disabledCheckedThumbColor: Color,
    disabledCheckedTrackColor: Color,
    disabledCheckedBorderColor: Color,
    disabledCheckedIconColor: Color,
    disabledUncheckedThumbColor: Color,
    disabledUncheckedTrackColor: Color,
    disabledUncheckedBorderColor: Color,
    disabledUncheckedIconColor: Color
)

create an instance with arbitrary colors.

Public functions

SwitchColors
copy(
    checkedThumbColor: Color,
    checkedTrackColor: Color,
    checkedBorderColor: Color,
    checkedIconColor: Color,
    uncheckedThumbColor: Color,
    uncheckedTrackColor: Color,
    uncheckedBorderColor: Color,
    uncheckedIconColor: Color,
    disabledCheckedThumbColor: Color,
    disabledCheckedTrackColor: Color,
    disabledCheckedBorderColor: Color,
    disabledCheckedIconColor: Color,
    disabledUncheckedThumbColor: Color,
    disabledUncheckedTrackColor: Color,
    disabledUncheckedBorderColor: Color,
    disabledUncheckedIconColor: Color
)

Returns a copy of this SwitchColors, optionally overriding some of the values.

open operator Boolean
equals(other: Any?)
open Int

Public properties

Color

the color used for the border when enabled and checked

Color

the color used for the icon when enabled and checked

Color

the color used for the thumb when enabled and checked

Color

the color used for the track when enabled and checked

Color

the color used for the border when disabled and checked

Color

the color used for the icon when disabled and checked

Color

the color used for the thumb when disabled and checked

Color

the color used for the track when disabled and checked

Color

the color used for the border when disabled and unchecked

Color

the color used for the icon when disabled and unchecked

Color

the color used for the thumb when disabled and unchecked

Color

the color used for the track when disabled and unchecked

Color

the color used for the border when enabled and unchecked

Color

the color used for the icon when enabled and unchecked

Color

the color used for the thumb when enabled and unchecked

Color

the color used for the track when enabled and unchecked

Public constructors

SwitchColors

SwitchColors(
    checkedThumbColor: Color,
    checkedTrackColor: Color,
    checkedBorderColor: Color,
    checkedIconColor: Color,
    uncheckedThumbColor: Color,
    uncheckedTrackColor: Color,
    uncheckedBorderColor: Color,
    uncheckedIconColor: Color,
    disabledCheckedThumbColor: Color,
    disabledCheckedTrackColor: Color,
    disabledCheckedBorderColor: Color,
    disabledCheckedIconColor: Color,
    disabledUncheckedThumbColor: Color,
    disabledUncheckedTrackColor: Color,
    disabledUncheckedBorderColor: Color,
    disabledUncheckedIconColor: Color
)

create an instance with arbitrary colors. See SwitchDefaults.colors for the default implementation that follows Material specifications.

Parameters
checkedThumbColor: Color

the color used for the thumb when enabled and checked

checkedTrackColor: Color

the color used for the track when enabled and checked

checkedBorderColor: Color

the color used for the border when enabled and checked

checkedIconColor: Color

the color used for the icon when enabled and checked

uncheckedThumbColor: Color

the color used for the thumb when enabled and unchecked

uncheckedTrackColor: Color

the color used for the track when enabled and unchecked

uncheckedBorderColor: Color

the color used for the border when enabled and unchecked

uncheckedIconColor: Color

the color used for the icon when enabled and unchecked

disabledCheckedThumbColor: Color

the color used for the thumb when disabled and checked

disabledCheckedTrackColor: Color

the color used for the track when disabled and checked

disabledCheckedBorderColor: Color

the color used for the border when disabled and checked

disabledCheckedIconColor: Color

the color used for the icon when disabled and checked

disabledUncheckedThumbColor: Color

the color used for the thumb when disabled and unchecked

disabledUncheckedTrackColor: Color

the color used for the track when disabled and unchecked

disabledUncheckedBorderColor: Color

the color used for the border when disabled and unchecked

disabledUncheckedIconColor: Color

the color used for the icon when disabled and unchecked

Public functions

copy

fun copy(
    checkedThumbColor: Color = this.checkedThumbColor,
    checkedTrackColor: Color = this.checkedTrackColor,
    checkedBorderColor: Color = this.checkedBorderColor,
    checkedIconColor: Color = this.checkedIconColor,
    uncheckedThumbColor: Color = this.uncheckedThumbColor,
    uncheckedTrackColor: Color = this.uncheckedTrackColor,
    uncheckedBorderColor: Color = this.uncheckedBorderColor,
    uncheckedIconColor: Color = this.uncheckedIconColor,
    disabledCheckedThumbColor: Color = this.disabledCheckedThumbColor,
    disabledCheckedTrackColor: Color = this.disabledCheckedTrackColor,
    disabledCheckedBorderColor: Color = this.disabledCheckedBorderColor,
    disabledCheckedIconColor: Color = this.disabledCheckedIconColor,
    disabledUncheckedThumbColor: Color = this.disabledUncheckedThumbColor,
    disabledUncheckedTrackColor: Color = this.disabledUncheckedTrackColor,
    disabledUncheckedBorderColor: Color = this.disabledUncheckedBorderColor,
    disabledUncheckedIconColor: Color = this.disabledUncheckedIconColor
): SwitchColors

Returns a copy of this SwitchColors, optionally overriding some of the values. This uses the Color.Unspecified to mean “use the value from the source”

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

Public properties

checkedBorderColor

Added in 1.0.0
val checkedBorderColorColor

the color used for the border when enabled and checked

checkedIconColor

Added in 1.0.0
val checkedIconColorColor

the color used for the icon when enabled and checked

checkedThumbColor

Added in 1.0.0
val checkedThumbColorColor

the color used for the thumb when enabled and checked

checkedTrackColor

Added in 1.0.0
val checkedTrackColorColor

the color used for the track when enabled and checked

disabledCheckedBorderColor

Added in 1.0.0
val disabledCheckedBorderColorColor

the color used for the border when disabled and checked

disabledCheckedIconColor

Added in 1.0.0
val disabledCheckedIconColorColor

the color used for the icon when disabled and checked

disabledCheckedThumbColor

Added in 1.0.0
val disabledCheckedThumbColorColor

the color used for the thumb when disabled and checked

disabledCheckedTrackColor

Added in 1.0.0
val disabledCheckedTrackColorColor

the color used for the track when disabled and checked

disabledUncheckedBorderColor

Added in 1.0.0
val disabledUncheckedBorderColorColor

the color used for the border when disabled and unchecked

disabledUncheckedIconColor

Added in 1.0.0
val disabledUncheckedIconColorColor

the color used for the icon when disabled and unchecked

disabledUncheckedThumbColor

Added in 1.0.0
val disabledUncheckedThumbColorColor

the color used for the thumb when disabled and unchecked

disabledUncheckedTrackColor

Added in 1.0.0
val disabledUncheckedTrackColorColor

the color used for the track when disabled and unchecked

uncheckedBorderColor

Added in 1.0.0
val uncheckedBorderColorColor

the color used for the border when enabled and unchecked

uncheckedIconColor

Added in 1.0.0
val uncheckedIconColorColor

the color used for the icon when enabled and unchecked

uncheckedThumbColor

Added in 1.0.0
val uncheckedThumbColorColor

the color used for the thumb when enabled and unchecked

uncheckedTrackColor

Added in 1.0.0
val uncheckedTrackColorColor

the color used for the track when enabled and unchecked