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,
    val disabledCheckmarkColor: Color,
)

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

Parameters

checkedCheckmarkColor color that will be used for the checkmark when checked
uncheckedCheckmarkColor color that will be used for the checkmark when unchecked
checkedBoxColor the color that will be used for the box when checked
uncheckedBoxColor color that will be used for the box when unchecked
disabledCheckedBoxColor color that will be used for the box when disabled and checked
disabledUncheckedBoxColor color that will be used for the box when disabled and unchecked
disabledIndeterminateBoxColor color that will be used for the box and border in a TriStateCheckbox when disabled AND in an ToggleableState.Indeterminate state.
checkedBorderColor color that will be used for the border when checked
uncheckedBorderColor color that will be used for the border when unchecked
disabledBorderColor color that will be used for the border when disabled and checked
disabledUncheckedBorderColor color that will be used for the border when disabled and unchecked
disabledIndeterminateBorderColor color that will be used for the border when disabled and in an ToggleableState.Indeterminate state.
disabledCheckmarkColor color that will be used for the checkmark when disabled

Secondary Constructors

constructor(
    checkedCheckmarkColor: Color,
    uncheckedCheckmarkColor: Color,
    checkedBoxColor: Color,
    uncheckedBoxColor: Color,
    disabledCheckedBoxColor: Color,
    disabledUncheckedBoxColor: Color,
    disabledIndeterminateBoxColor: Color,
    checkedBorderColor: Color,
    uncheckedBorderColor: Color,
    disabledBorderColor: Color,
    disabledUncheckedBorderColor: Color,
    disabledIndeterminateBorderColor: Color,
) : this(
    checkedCheckmarkColor = checkedCheckmarkColor,
    uncheckedCheckmarkColor = uncheckedCheckmarkColor,
    checkedBoxColor = checkedBoxColor,
    uncheckedBoxColor = uncheckedBoxColor,
    disabledCheckedBoxColor = disabledCheckedBoxColor,
    disabledUncheckedBoxColor = disabledUncheckedBoxColor,
    disabledIndeterminateBoxColor = disabledIndeterminateBoxColor,
    checkedBorderColor = checkedBorderColor,
    uncheckedBorderColor = uncheckedBorderColor,
    disabledBorderColor = disabledBorderColor,
    disabledUncheckedBorderColor = disabledUncheckedBorderColor,
    disabledIndeterminateBorderColor = disabledIndeterminateBorderColor,
    disabledCheckmarkColor = checkedCheckmarkColor,
)

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 = checkedCheckmarkColor.takeOrElse { this.checkedCheckmarkColor },
            uncheckedCheckmarkColor =
                uncheckedCheckmarkColor.takeOrElse { this.uncheckedCheckmarkColor },
            checkedBoxColor = checkedBoxColor.takeOrElse { this.checkedBoxColor },
            uncheckedBoxColor = uncheckedBoxColor.takeOrElse { this.uncheckedBoxColor },
            disabledCheckedBoxColor =
                disabledCheckedBoxColor.takeOrElse { this.disabledCheckedBoxColor },
            disabledUncheckedBoxColor =
                disabledUncheckedBoxColor.takeOrElse { this.disabledUncheckedBoxColor },
            disabledIndeterminateBoxColor =
                disabledIndeterminateBoxColor.takeOrElse { this.disabledIndeterminateBoxColor },
            checkedBorderColor = checkedBorderColor.takeOrElse { this.checkedBorderColor },
            uncheckedBorderColor = uncheckedBorderColor.takeOrElse { this.uncheckedBorderColor },
            disabledBorderColor = disabledBorderColor.takeOrElse { this.disabledBorderColor },
            disabledUncheckedBorderColor =
                disabledUncheckedBorderColor.takeOrElse { this.disabledUncheckedBorderColor },
            disabledIndeterminateBorderColor =
                disabledIndeterminateBorderColor.takeOrElse {
                    this.disabledIndeterminateBorderColor
                },
            disabledCheckmarkColor = checkedCheckmarkColor.takeOrElse { this.checkedCheckmarkColor },
        )

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”

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,
        disabledCheckmarkColor: Color = this.disabledCheckmarkColor,
    ) =
        CheckboxColors(
            checkedCheckmarkColor = checkedCheckmarkColor.takeOrElse { this.checkedCheckmarkColor },
            uncheckedCheckmarkColor =
                uncheckedCheckmarkColor.takeOrElse { this.uncheckedCheckmarkColor },
            checkedBoxColor = checkedBoxColor.takeOrElse { this.checkedBoxColor },
            uncheckedBoxColor = uncheckedBoxColor.takeOrElse { this.uncheckedBoxColor },
            disabledCheckedBoxColor =
                disabledCheckedBoxColor.takeOrElse { this.disabledCheckedBoxColor },
            disabledUncheckedBoxColor =
                disabledUncheckedBoxColor.takeOrElse { this.disabledUncheckedBoxColor },
            disabledIndeterminateBoxColor =
                disabledIndeterminateBoxColor.takeOrElse { this.disabledIndeterminateBoxColor },
            checkedBorderColor = checkedBorderColor.takeOrElse { this.checkedBorderColor },
            uncheckedBorderColor = uncheckedBorderColor.takeOrElse { this.uncheckedBorderColor },
            disabledBorderColor = disabledBorderColor.takeOrElse { this.disabledBorderColor },
            disabledUncheckedBorderColor =
                disabledUncheckedBorderColor.takeOrElse { this.disabledUncheckedBorderColor },
            disabledIndeterminateBorderColor =
                disabledIndeterminateBorderColor.takeOrElse {
                    this.disabledIndeterminateBorderColor
                },
            disabledCheckmarkColor =
                disabledCheckmarkColor.takeOrElse { this.disabledCheckmarkColor },
        )

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”