System.Drawing.Color c = System.Drawing.Color.FromArgb( /* R */ 0xFF, /* G
*/ 0xFF, /* B */ 0xFF);
You can convert a HTML style color string to System.Drawing.Color like this:
System.Drawing.Color c = System.Drawing.ColorTranslator.FromHtml("#FFFFFF");
Yes, you can, but the thing is, what are you trying to do? Do you want
a Color structure, or do you want a string?
If you want a color structure, then you could convert each string into
an int (using an overload of the static Parse method on the Int32 structure)
and then pass those into the static FromArgb method of the Color structure.
I want to make a little program for myself to help me get colors right
when I am designing a website. Put the R, the G, and the B on slides
and see what happens to the color. Display the value as composed.
Actually, I believe Denis, who also responded, has answered my question
rather well.
System.Drawing.Color c = System.Drawing.Color.FromArgb( /* R */ 0xFF, /* G
*/ 0xFF, /* B */ 0xFF);
You can convert a HTML style color string to System.Drawing.Color like this:
System.Drawing.Color c = System.Drawing.ColorTranslator.FromHtml("#FFFFFF");
Thank you very much. This is the sort of thing I was looking for.
Regards,
Adrian.
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.