TimePickerColors

Class

Common
@ExperimentalMaterial3Api
class TimePickerColors
constructor(
    val clockDialColor: Color,
    val selectorColor: Color,
    val containerColor: Color,
    val periodSelectorBorderColor: Color,
    val clockDialSelectedContentColor: Color,
    val clockDialUnselectedContentColor: Color,
    val periodSelectorSelectedContainerColor: Color,
    val periodSelectorUnselectedContainerColor: Color,
    val periodSelectorSelectedContentColor: Color,
    val periodSelectorUnselectedContentColor: Color,
    val timeSelectorSelectedContainerColor: Color,
    val timeSelectorUnselectedContainerColor: Color,
    val timeSelectorSelectedContentColor: Color,
    val timeSelectorUnselectedContentColor: Color,
)

Represents the colors used by a TimePicker in different states

Parameters

clockDialColorThe color of the clock dial.
clockDialSelectedContentColorthe color of the numbers of the clock dial when they are selected or overlapping with the selector
clockDialUnselectedContentColorthe color of the numbers of the clock dial when they are unselected
selectorColorThe color of the clock dial selector.
containerColorThe container color of the time picker.
periodSelectorBorderColorthe color used for the border of the AM/PM toggle.
periodSelectorSelectedContainerColorthe color used for the selected container of the AM/PM toggle
periodSelectorUnselectedContainerColorthe color used for the unselected container of the AM/PM toggle
periodSelectorSelectedContentColorcolor used for the selected content of the AM/PM toggle
periodSelectorUnselectedContentColorcolor used for the unselected content of the AM/PM toggle
timeSelectorSelectedContainerColorcolor used for the selected container of the display buttons to switch between hour and minutes
timeSelectorUnselectedContainerColorcolor used for the unselected container of the display buttons to switch between hour and minutes
timeSelectorSelectedContentColorcolor used for the selected content of the display buttons to switch between hour and minutes
timeSelectorUnselectedContentColorcolor used for the unselected content of the display buttons to switch between hour and minutes

Functions

fun copy(
        clockDialColor: Color = this.containerColor,
        selectorColor: Color = this.selectorColor,
        containerColor: Color = this.containerColor,
        periodSelectorBorderColor: Color = this.periodSelectorBorderColor,
        clockDialSelectedContentColor: Color = this.clockDialSelectedContentColor,
        clockDialUnselectedContentColor: Color = this.clockDialUnselectedContentColor,
        periodSelectorSelectedContainerColor: Color = this.periodSelectorSelectedContainerColor,
        periodSelectorUnselectedContainerColor: Color = this.periodSelectorUnselectedContainerColor,
        periodSelectorSelectedContentColor: Color = this.periodSelectorSelectedContentColor,
        periodSelectorUnselectedContentColor: Color = this.periodSelectorUnselectedContentColor,
        timeSelectorSelectedContainerColor: Color = this.timeSelectorSelectedContainerColor,
        timeSelectorUnselectedContainerColor: Color = this.timeSelectorUnselectedContainerColor,
        timeSelectorSelectedContentColor: Color = this.timeSelectorSelectedContentColor,
        timeSelectorUnselectedContentColor: Color = this.timeSelectorUnselectedContentColor,
    ) =
        TimePickerColors(
            clockDialColor.takeOrElse { this.clockDialColor },
            selectorColor.takeOrElse { this.selectorColor },
            containerColor.takeOrElse { this.containerColor },
            periodSelectorBorderColor.takeOrElse { this.periodSelectorBorderColor },
            clockDialSelectedContentColor.takeOrElse { this.clockDialSelectedContentColor },
            clockDialUnselectedContentColor.takeOrElse { this.clockDialUnselectedContentColor },
            periodSelectorSelectedContainerColor.takeOrElse {
                this.periodSelectorSelectedContainerColor
            },
            periodSelectorUnselectedContainerColor.takeOrElse {
                this.periodSelectorUnselectedContainerColor
            },
            periodSelectorSelectedContentColor.takeOrElse {
                this.periodSelectorSelectedContentColor
            },
            periodSelectorUnselectedContentColor.takeOrElse {
                this.periodSelectorUnselectedContentColor
            },
            timeSelectorSelectedContainerColor.takeOrElse {
                this.timeSelectorSelectedContainerColor
            },
            timeSelectorUnselectedContainerColor.takeOrElse {
                this.timeSelectorUnselectedContainerColor
            },
            timeSelectorSelectedContentColor.takeOrElse { this.timeSelectorSelectedContentColor },
            timeSelectorUnselectedContentColor.takeOrElse {
                this.timeSelectorUnselectedContentColor
            },
        )

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