Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

System.Drawing.Color NameSpace question....

Status
Not open for further replies.

Sheffield

Programmer
Jun 1, 2001
180
US
Question: Is it possible to implement colors in Hex (ex: "#fafad2") with the System.Drawing.Color NameSpace OR are the system-defined colors the only ones available?

I appreciate your help:)

 
yep,

int red = Convert.ToInt32("FF", 16);
int blue = Convert.ToInt32("FF", 16);
int green = Convert.ToInt32("FF", 16);
System.Drawing.Color.FromArgb(red, blue, green);

I think. The 16 value is the base from which to convert the string value. In this case, obv 16 == hex.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top