readableTextColor

fun readableTextColor(backgroundColor: Color, lightColor: Color = Color.White, darkColor: Color = Color.Black): Color

Returns an appropriate contrast color (light or dark) based on background color. Similar to iOS UIColor.readableTextColor()

Return

Either lightColor or darkColor based on the background

Parameters

backgroundColor

The background color to check against

lightColor

Light color to use if background is dark (default: white)

darkColor

Dark color to use if background is light (default: black)