Color => string ?

L

Lloyd Dupont

I'm designing a web user control
it has a color property and I want to output in the HTML something like:

bgcolor=#FFDEAD

for this in the C# code I write(HtmlTextWriter output)

output.Write(" bgcolor={0}", BackColor);

but this doesn't work at all, my output is
bgcolor=Color [A=255, R=231, G=253, B=100]

how could I format the color value ?
I could build myself a number like that #123456 but the the default behavior
is nice, output a color name when it's a unique color, etc ....
how could I do that ?

please....
 
L

Lloyd Dupont

merveilleux dirais-je meme !

Andrew de la Harpe said:
checkout the WebColorConverter class.


Lloyd Dupont said:
I'm designing a web user control
it has a color property and I want to output in the HTML something like:

bgcolor=#FFDEAD

for this in the C# code I write(HtmlTextWriter output)

output.Write(" bgcolor={0}", BackColor);

but this doesn't work at all, my output is
bgcolor=Color [A=255, R=231, G=253, B=100]

how could I format the color value ?
I could build myself a number like that #123456 but the the default behavior
is nice, output a color name when it's a unique color, etc ....
how could I do that ?

please....
 

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.

Ask a Question

Top