getColorId

fun Context.getColorId(resource: String): Int

Resolves the given into color string into resource identifier returns the id if found else 0