Function

calculateContentColor

Calculates the preferred content color for backgroundColor.

calculateContentColor

Source set: Android
public fun calculateContentColor(backgroundColor: Color): Color

Calculates the preferred content color for backgroundColor. This will return either Color.White or Color.Black, depending on the luminance of the background color.

Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: