Sub ParseColor(Name As String) As Int
'Will return an illegal argument exception if the color is not valid so
'put in a Try block and log the result if in error
'From Android developers Documentation:
'Parse the color string, and return the corresponding color-int.
'If the String cannot be parsed, throws an IllegalArgumentException Exception.
'Supported formats are: #RRGGBB #AARRGGBB 'red', 'blue', 'green', 'black', 'white',
''gray', 'cyan', 'magenta', 'yellow', 'lightgray', 'darkgray'
Try
Dim R As Reflector
Return R.RunStaticMethod("android.graphics.Color","parseColor",Array As Object(Name),Array As String("java.lang.String"))
Catch
Log(LastException)
End Try
End Sub