set Navigation Bar Color
abstract fun setNavigationBarColor(color: Color, darkIcons: Boolean = color.luminance() > 0.5f, navigationBarContrastEnforced: Boolean = true, transformColorForLightContent: (Color) -> Color = BlackScrimmed)
Content copied to clipboard
Set the navigation bar color.
See also
Parameters
color
The desiredColor to set. This may require modification if running on an API level that only supports white navigation bar icons. Additionally this will be ignored and Color.Transparent will be used on API 29+ where gesture navigation is preferred or the system UI automatically applies background protection in other navigation modes.
darkIcons
Whether dark navigation bar icons would be preferable.
navigationBarContrastEnforced
Whether the system should ensure that the navigation bar has enough contrast when a fully transparent background is requested. Only supported on API 29+.
transformColorForLightContent
A lambda which will be invoked to transform color if dark icons were requested but are not available. Defaults to applying a black scrim.