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
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. |
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”