Color => string ?

  • Thread starter Thread starter Lloyd Dupont
  • Start date Start date
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....
 
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....
 
Back
Top