android-components / mozilla.components.support.utils / ColorUtils

ColorUtils

object ColorUtils (source)

Functions

Name Summary
getReadableTextColor fun getReadableTextColor(backgroundColor: Int): Int
Get text color (white or black) that is readable on top of the provided background color.
isDark fun isDark(color: Int): Boolean
Returns true if the color is dark enough that white text should be used on top of it.

Extension Functions

Name Summary
loadResourceAsString fun Any.loadResourceAsString(path: String): String
Loads a file from the resources folder and returns its content as a string object.