Color => string ?

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

    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....


  • Lloyd Dupont

    #2
    Re: Color => string ?

    merveilleux dirais-je meme !

    "Andrew de la Harpe" <andrew_dela@ho tmail.com> a écrit dans le message de
    news:%23tn6o9iX DHA.1640@TK2MSF TNGP10.phx.gbl. ..[color=blue]
    > 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=green]
    > > 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=green]
    > > is nice, output a color name when it's a unique color, etc ....
    > > how could I do that ?
    > >
    > > please....
    > >
    > >[/color]
    >
    >[/color]


    Comment

    • Andrew de la Harpe

      #3
      Re: Color =&gt; 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

      • Lloyd Dupont

        #4
        Re: Color =&gt; string ?

        merveilleux dirais-je meme !

        "Andrew de la Harpe" <andrew_dela@ho tmail.com> a écrit dans le message de
        news:%23tn6o9iX DHA.1640@TK2MSF TNGP10.phx.gbl. ..[color=blue]
        > 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=green]
        > > 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=green]
        > > is nice, output a color name when it's a unique color, etc ....
        > > how could I do that ?
        > >
        > > please....
        > >
        > >[/color]
        >
        >[/color]


        Comment

        Working...