CheckboxColors

Class

Common
class CheckboxColors
constructor(
    val checkedCheckmarkColor: Color,
    val uncheckedCheckmarkColor: Color,
    val checkedBoxColor: Color,
    val uncheckedBoxColor: Color,
    val disabledCheckedBoxColor: Color,
    val disabledUncheckedBoxColor: Color,
    val disabledIndeterminateBoxColor: Color,
    val checkedBorderColor: Color,
    val uncheckedBorderColor: Color,
    val disabledBorderColor: Color,
    val disabledUncheckedBorderColor: Color,
    val disabledIndeterminateBorderColor: Color,
)

Represents the colors used by the three different sections (checkmark, box, and border) of a Checkbox or TriStateCheckbox in different states.

Parameters

checkedCheckmarkColorcolor that will be used for the checkmark when checked
uncheckedCheckmarkColorcolor that will be used for the checkmark when unchecked
checkedBoxColorthe color that will be used for the box when checked
uncheckedBoxColorcolor that will be used for the box when unchecked
disabledCheckedBoxColorcolor that will be used for the box when disabled and checked
disabledUncheckedBoxColorcolor that will be used for the box when disabled and unchecked
disabledIndeterminateBoxColorcolor that will be used for the box and border in a TriStateCheckbox when disabled AND in an ToggleableState.Indeterminate state.
checkedBorderColorcolor that will be used for the border when checked
uncheckedBorderColorcolor that will be used for the border when unchecked
disabledBorderColorcolor that will be used for the border when disabled and checked
disabledUncheckedBorderColorcolor that will be used for the border when disabled and unchecked
disabledIndeterminateBorderColorcolor that will be used for the border when disabled and in an ToggleableState.Indeterminate state.

Functions

fun copy(
        checkedCheckmarkColor: Color = this.checkedCheckmarkColor,
        uncheckedCheckmarkColor: Color = this.uncheckedCheckmarkColor,
        checkedBoxColor: Color = this.checkedBoxColor,
        uncheckedBoxColor: Color = this.uncheckedBoxColor,
        disabledCheckedBoxColor: Color = this.disabledCheckedBoxColor,
        disabledUncheckedBoxColor: Color = this.disabledUncheckedBoxColor,
        disabledIndeterminateBoxColor: Color = this.disabledIndeterminateBoxColor,
        checkedBorderColor: Color = this.checkedBorderColor,
        uncheckedBorderColor: Color = this.uncheckedBorderColor,
        disabledBorderColor: Color = this.disabledBorderColor,
        disabledUncheckedBorderColor: Color = this.disabledUncheckedBorderColor,
        disabledIndeterminateBorderColor: Color = this.disabledIndeterminateBorderColor,
    ) =
        CheckboxColors(
            checkedCheckmarkColor.takeOrElse { this.checkedCheckmarkColor },
            uncheckedCheckmarkColor.takeOrElse { this.uncheckedCheckmarkColor },
            checkedBoxColor.takeOrElse { this.checkedBoxColor },
            uncheckedBoxColor.takeOrElse { this.uncheckedBoxColor },
            disabledCheckedBoxColor.takeOrElse { this.disabledCheckedBoxColor },
            disabledUncheckedBoxColor.takeOrElse { this.disabledUncheckedBoxColor },
            disabledIndeterminateBoxColor.takeOrElse { this.disabledIndeterminateBoxColor },
            checkedBorderColor.takeOrElse { this.checkedBorderColor },
            uncheckedBorderColor.takeOrElse { this.uncheckedBorderColor },
            disabledBorderColor.takeOrElse { this.disabledBorderColor },
            disabledUncheckedBorderColor.takeOrElse { this.disabledUncheckedBorderColor },
            disabledIndeterminateBorderColor.takeOrElse { this.disabledIndeterminateBorderColor },
        )

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