getColorOrNull

open fun getColorOrNull(@NonNull context: Context, @AttrRes colorAttributeResId: Int): Integer

Returns the color int for the provided theme color attribute, or null if the attribute is not set in the current theme.