ChipColors

Class

Common
class ChipColors
constructor(
    val containerColor: Color,
    val labelColor: Color,
    val leadingIconContentColor: Color,
    val trailingIconContentColor: Color,
    val disabledContainerColor: Color,
    val disabledLabelColor: Color,
    val disabledLeadingIconContentColor: Color,
    val disabledTrailingIconContentColor: Color,
)

Represents the container and content colors used in a clickable chip in different states.

Parameters

containerColorthe container color of this chip when enabled
labelColorthe label color of this chip when enabled
leadingIconContentColorthe color of this chip's start icon when enabled
trailingIconContentColorthe color of this chip's end icon when enabled
disabledContainerColorthe container color of this chip when not enabled
disabledLabelColorthe label color of this chip when not enabled
disabledLeadingIconContentColorthe color of this chip's start icon when not enabled
disabledTrailingIconContentColorthe color of this chip's end icon when not enabled

Functions

fun copy(
        containerColor: Color = this.containerColor,
        labelColor: Color = this.labelColor,
        leadingIconContentColor: Color = this.leadingIconContentColor,
        trailingIconContentColor: Color = this.trailingIconContentColor,
        disabledContainerColor: Color = this.disabledContainerColor,
        disabledLabelColor: Color = this.disabledLabelColor,
        disabledLeadingIconContentColor: Color = this.disabledLeadingIconContentColor,
        disabledTrailingIconContentColor: Color = this.disabledTrailingIconContentColor,
    ) =
        ChipColors(
            containerColor.takeOrElse { this.containerColor },
            labelColor.takeOrElse { this.labelColor },
            leadingIconContentColor.takeOrElse { this.leadingIconContentColor },
            trailingIconContentColor.takeOrElse { this.trailingIconContentColor },
            disabledContainerColor.takeOrElse { this.disabledContainerColor },
            disabledLabelColor.takeOrElse { this.disabledLabelColor },
            disabledLeadingIconContentColor.takeOrElse { this.disabledLeadingIconContentColor },
            disabledTrailingIconContentColor.takeOrElse { this.disabledTrailingIconContentColor },
        )

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