SegmentedButtonColors

Class

Common
class SegmentedButtonColors(
    val activeContainerColor: Color,
    val activeContentColor: Color,
    val activeBorderColor: Color,
    val inactiveContainerColor: Color,
    val inactiveContentColor: Color,
    val inactiveBorderColor: Color,
    val disabledActiveContainerColor: Color,
    val disabledActiveContentColor: Color,
    val disabledActiveBorderColor: Color,
    val disabledInactiveContainerColor: Color,
    val disabledInactiveContentColor: Color,
    val disabledInactiveBorderColor: Color,
)

The different colors used in parts of the SegmentedButton in different states

Parameters

activeContainerColorthe color used for the container when enabled and active
activeContentColorthe color used for the content when enabled and active
activeBorderColorthe color used for the border when enabled and active
inactiveContainerColorthe color used for the container when enabled and inactive
inactiveContentColorthe color used for the content when enabled and inactive
inactiveBorderColorthe color used for the border when enabled and active
disabledActiveContainerColorthe color used for the container when disabled and active
disabledActiveContentColorthe color used for the content when disabled and active
disabledActiveBorderColorthe color used for the border when disabled and active
disabledInactiveContainerColorthe color used for the container when disabled and inactive
disabledInactiveContentColorthe color used for the content when disabled and inactive
disabledInactiveBorderColorthe color used for the border when disabled and inactive

Functions

fun copy(
        activeContainerColor: Color = this.activeContainerColor,
        activeContentColor: Color = this.activeContentColor,
        activeBorderColor: Color = this.activeBorderColor,
        inactiveContainerColor: Color = this.inactiveContainerColor,
        inactiveContentColor: Color = this.inactiveContentColor,
        inactiveBorderColor: Color = this.inactiveBorderColor,
        disabledActiveContainerColor: Color = this.disabledActiveContainerColor,
        disabledActiveContentColor: Color = this.disabledActiveContentColor,
        disabledActiveBorderColor: Color = this.disabledActiveBorderColor,
        disabledInactiveContainerColor: Color = this.disabledInactiveContainerColor,
        disabledInactiveContentColor: Color = this.disabledInactiveContentColor,
        disabledInactiveBorderColor: Color = this.disabledInactiveBorderColor,
    ) =
        SegmentedButtonColors(
            activeContainerColor.takeOrElse { this.activeContainerColor },
            activeContentColor.takeOrElse { this.activeContentColor },
            activeBorderColor.takeOrElse { this.activeBorderColor },
            inactiveContainerColor.takeOrElse { this.inactiveContainerColor },
            inactiveContentColor.takeOrElse { this.inactiveContentColor },
            inactiveBorderColor.takeOrElse { this.inactiveBorderColor },
            disabledActiveContainerColor.takeOrElse { this.disabledActiveContainerColor },
            disabledActiveContentColor.takeOrElse { this.disabledActiveContentColor },
            disabledActiveBorderColor.takeOrElse { this.disabledActiveBorderColor },
            disabledInactiveContainerColor.takeOrElse { this.disabledInactiveContainerColor },
            disabledInactiveContentColor.takeOrElse { this.disabledInactiveContentColor },
            disabledInactiveBorderColor.takeOrElse { this.disabledInactiveBorderColor },
        )

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