Share via


ColorObject.ParseColor(String) Method

Definition

</p>Parse the color string, and return the corresponding color-int.

[Android.Runtime.Register("parseColor", "(Ljava/lang/String;)I", "")]
public static int ParseColor (string? colorString);
[<Android.Runtime.Register("parseColor", "(Ljava/lang/String;)I", "")>]
static member ParseColor : string -> int

Parameters

colorString
String

Returns

Attributes

Remarks

</p>Parse the color string, and return the corresponding color-int. If the string cannot be parsed, throws an IllegalArgumentException exception. Supported formats are:</p>

<ul> <li>#RRGGBB</li> <li>#AARRGGBB</li> </ul>

The following names are also accepted: red, blue, green, black, white, gray, cyan, magenta, yellow, lightgray, darkgray, grey, lightgrey, darkgrey, aqua, fuchsia, lime, maroon, navy, olive, purple, silver, and teal.

Java documentation for android.graphics.Color.parseColor(java.lang.String).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to