Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Colors: Hex to RGB

0 views
Skip to first unread message

Gene

unread,
Apr 19, 2004, 12:03:45 PM4/19/04
to
I've been reading the documentation on Colors in .NET (System.Drawing.Color,
System.Drawing.ColorConverter, System.Drawing.ColorTranslator), and so far
have found nothing that lets us use the hex value of a color (e.g.,
#FF00FF); rather, it appears to me that all Color members use or require
individual RGB decimal values. I'm happy to write something that converts
the hex values to the corresponding RGB values - but do I really have to
"roll my own" on this? Have I missed something - or can we really use hex
values or have some base class do the translation?

Thanks.


Paul E Collins

unread,
Apr 19, 2004, 1:31:48 PM4/19/04
to
"Gene" <MrWi...@jw.com> wrote in message:

> [using hex colour codes]

System.Web.UI.WebControls.WebColorConverter

From VS.NET Help:
"You can also specify a custom color by using a hexadecimal number, preceded
by the pound character (#), in the form #RRGGBB. RR, GG, and BB represent
hexadecimal values from 0 to 255 that indicate the red, green, and blue
components of a color, respectively."

P.


0 new messages