MenuItemColors

Class

Common
class MenuItemColors(
    val textColor: Color,
    val leadingIconColor: Color,
    val trailingIconColor: Color,
    val disabledTextColor: Color,
    val disabledLeadingIconColor: Color,
    val disabledTrailingIconColor: Color,
)

Represents the text and icon colors used in a menu item at different states.

Parameters

textColorthe text color of this DropdownMenuItemContent when enabled
leadingIconColorthe leading icon color of this DropdownMenuItemContent when enabled
trailingIconColorthe trailing icon color of this DropdownMenuItemContent when enabled
disabledTextColorthe text color of this DropdownMenuItemContent when not enabled
disabledLeadingIconColorthe leading icon color of this DropdownMenuItemContent when not enabled
disabledTrailingIconColorthe trailing icon color of this DropdownMenuItemContent when not enabled

Functions

fun copy(
        textColor: Color = this.textColor,
        leadingIconColor: Color = this.leadingIconColor,
        trailingIconColor: Color = this.trailingIconColor,
        disabledTextColor: Color = this.disabledTextColor,
        disabledLeadingIconColor: Color = this.disabledLeadingIconColor,
        disabledTrailingIconColor: Color = this.disabledTrailingIconColor,
    ) =
        MenuItemColors(
            textColor.takeOrElse { this.textColor },
            leadingIconColor.takeOrElse { this.leadingIconColor },
            trailingIconColor.takeOrElse { this.trailingIconColor },
            disabledTextColor.takeOrElse { this.disabledTextColor },
            disabledLeadingIconColor.takeOrElse { this.disabledLeadingIconColor },
            disabledTrailingIconColor.takeOrElse { this.disabledTrailingIconColor },
        )

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