Color => string ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Lloyd Dupont

    #1

    Color => string ?

    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(HtmlTextW riter 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....


  • Andrew de la Harpe

    #2
    Re: Color => string ?

    checkout the WebColorConvert er class.


    "Lloyd Dupont" <lloyd@RemoveIf NotSpamming.gal ador.net> wrote in message
    news:uNuIMuiXDH A.1580@tk2msftn gp13.phx.gbl...[color=blue]
    > 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(HtmlTextW riter 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[/color]
    behavior[color=blue]
    > is nice, output a color name when it's a unique color, etc ....
    > how could I do that ?
    >
    > please....
    >
    >[/color]


    Comment

    Working...