getColor
open fun getColor(@NonNull res: Resources, @ColorRes id: Int, @Nullable theme: Resources.Theme): Int(source)
Returns a themed color integer associated with a particular resource ID. If the resource holds a complex ColorStateList, then the default color from the set is returned.
Prior to API level 23, the theme will not be applied and this method calls through to getColor.
Return
A single color value in the form 0xAARRGGBB
.
Parameters
res
resources to use for getting the color.
id
The desired resource identifier, as generated by the aapt tool. This integer encodes the package, type, and resource entry. The value 0 is an invalid identifier.
theme
The theme used to style the color attributes, may be null
.
Throws
Throws NotFoundException if the given ID does not exist.