NavigationItemColors

Class

Common
class NavigationItemColors
constructor(
    val selectedIconColor: Color,
    val selectedTextColor: Color,
    val selectedIndicatorColor: Color,
    val unselectedIconColor: Color,
    val unselectedTextColor: Color,
    val disabledIconColor: Color,
    val disabledTextColor: Color,
)

Represents the colors of the various elements of a navigation item.

Parameters

selectedIconColorthe color to use for the icon when the item is selected.
selectedTextColorthe color to use for the text label when the item is selected.
selectedIndicatorColorthe color to use for the indicator when the item is selected.
unselectedIconColorthe color to use for the icon when the item is unselected.
unselectedTextColorthe color to use for the text label when the item is unselected.
disabledIconColorthe color to use for the icon when the item is disabled.
disabledTextColorthe color to use for the text label when the item is disabled.

Functions

fun copy(
        selectedIconColor: Color = this.selectedIconColor,
        selectedTextColor: Color = this.selectedTextColor,
        selectedIndicatorColor: Color = this.selectedIndicatorColor,
        unselectedIconColor: Color = this.unselectedIconColor,
        unselectedTextColor: Color = this.unselectedTextColor,
        disabledIconColor: Color = this.disabledIconColor,
        disabledTextColor: Color = this.disabledTextColor,
    ) =
        NavigationItemColors(
            selectedIconColor.takeOrElse { this.selectedIconColor },
            selectedTextColor.takeOrElse { this.selectedTextColor },
            selectedIndicatorColor.takeOrElse { this.selectedIndicatorColor },
            unselectedIconColor.takeOrElse { this.unselectedIconColor },
            unselectedTextColor.takeOrElse { this.unselectedTextColor },
            disabledIconColor.takeOrElse { this.disabledIconColor },
            disabledTextColor.takeOrElse { this.disabledTextColor },
        )

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

fun iconColor(selected: Boolean, enabled: Boolean): Color

Represents the icon color for this item, depending on whether it is selected.

Parameters

selectedwhether the item is selected
enabledwhether the item is enabled
fun textColor(selected: Boolean, enabled: Boolean): Color

Represents the text color for this item, depending on whether it is selected.

Parameters

selectedwhether the item is selected
enabledwhether the item is enabled