
Originally Posted by
Poppa Mintin
I had a bit of trouble detecting a miss-spelt or unknown colour, just converting the String to a Color doesn't automatically cause an error, it just gives 'Black'
vb.net Code:
Dim names = {"Red", "Rid"}
For Each s In names
If [Enum].IsDefined(GetType(KnownColor), s) Then
Console.WriteLine($"There is a known colour named '{s}'.")
Else
Console.WriteLine($"There is NOT a known colour named '{s}'.")
End If
Next