Projects AndroidUtils Docs ColorUtils

Int.isColorDark

Type: fun

Determine if a color is readable on a light background, using some magic numbers.

Returned Value: True if the color should be considered "dark".

Int.isColorLight

Type: fun

Negation of Int.isColorDark()

Returned Value: True if the color should be considered "light".

getColorDarkness

Type: private fun

Determine the darkness of a color, using some magic numbers.

Parameter Name Description
color A color int to determine the luminance of.

Returned Value: The darkness of the color; a double between 0 and 1.

Window.autoSystemUiColors

Type: fun

Set light status/navigation bar window flags automatically. Falls back to Color.BLACK on lower SDK versions.