WideNavigationRailColors

Class

Common
class WideNavigationRailColors
constructor(
    val containerColor: Color,
    val contentColor: Color,
    val modalContainerColor: Color,
    val modalScrimColor: Color,
    val modalContentColor: Color,
)

Represents the colors of the various elements of a wide navigation rail.

Parameters

containerColorthe color used for the background of a non-modal wide navigation rail. Use Color.Transparent to have no color
contentColorthe preferred color for content inside a wide navigation rail. Defaults to either the matching content color for containerColor, or to the current LocalContentColor if containerColor is not a color from the theme
modalContainerColorthe color used for the background of a modal wide navigation rail. Use Color.Transparent to have no color
modalScrimColorthe color used for the scrim overlay for background content of a modal wide navigation rail
modalContentColorthe preferred color for content inside a modal wide navigation rail. Defaults to either the matching content color for modalContainerColor, or to the current LocalContentColor

Secondary Constructors

constructor(
    containerColor: Color,
    contentColor: Color,
    modalContainerColor: Color,
    modalScrimColor: Color,
) : this(containerColor, contentColor, modalContainerColor, modalScrimColor, contentColor)

Functions

fun copy(
        containerColor: Color = this.containerColor,
        contentColor: Color = this.contentColor,
        modalContainerColor: Color = this.modalContainerColor,
        modalScrimColor: Color = this.modalScrimColor,
        modalContentColor: Color = this.modalContentColor,
    ) =
        WideNavigationRailColors(
            containerColor = containerColor.takeOrElse { this.containerColor },
            contentColor = contentColor.takeOrElse { this.contentColor },
            modalContainerColor = modalContainerColor.takeOrElse { this.modalContainerColor },
            modalScrimColor = modalScrimColor.takeOrElse { this.modalScrimColor },
            modalContentColor = modalContentColor.takeOrElse { this.modalContentColor },
        )

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

fun copy(
        containerColor: Color = this.containerColor,
        contentColor: Color = this.contentColor,
        modalContainerColor: Color = this.modalContainerColor,
        modalScrimColor: Color = this.modalScrimColor,
    ) =
        copy(
            containerColor = containerColor.takeOrElse { this.containerColor },
            contentColor = contentColor.takeOrElse { this.contentColor },
            modalContainerColor = modalContainerColor.takeOrElse { this.modalContainerColor },
            modalScrimColor = modalScrimColor.takeOrElse { this.modalScrimColor },
            modalContentColor = contentColor.takeOrElse { this.contentColor },
        )

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