resolveColorId

fun Context.resolveColorId(resource: String?): Int?

Resolves the given color string into resource identifier returns the id on success else null