color names

Discussion in 'ASP .Net' started by Nalaka, Jun 20, 2006.

  1. Nalaka

    Nalaka Guest

    Hi....
    When I pick colors using the design mode.... it puts c"color names" into the
    markup.
    Then in the "HTML mode"... shows a lot of color related errors.

    How do I get the gui editor to put colors numbers instead (of names)?

    any help is appreatiated
    Nalaka
    Nalaka, Jun 20, 2006
    #1
    1. Advertising

  2. I had similar problems. Depending on what you're doing exactly you may be able to use this function I patched together that converts colors to their hex values so they'll be more browser friendly.

    Public Function Color2Hex(ByVal clr As Color) As String

    Dim HexR, HexB, HexG As String



    Try

    'Get Red Hex

    HexR = Hex(clr.R)

    If Len(HexR) < 2 Then HexR = "0" & HexR



    'Get Green Hex

    HexG = Hex(clr.G)

    If Len(HexG) < 2 Then HexG = "0" & HexG



    'Get Blue Hex

    HexB = Hex(clr.B)

    If Len(HexB) < 2 Then HexB = "0" & HexB



    Catch ex As Exception

    Return ""

    End Try



    Return "#" & HexR & HexG & HexB 'Output complete hex

    End Function




    --
    I hope this helps,
    Steve C. Orr, MCSD, MVP
    http://SteveOrr.net





    "Nalaka" <> wrote in message news:...
    > Hi....
    > When I pick colors using the design mode.... it puts c"color names" into the
    > markup.
    > Then in the "HTML mode"... shows a lot of color related errors.
    >
    > How do I get the gui editor to put colors numbers instead (of names)?
    >
    > any help is appreatiated
    > Nalaka
    >
    >
    Steve C. Orr [MVP, MCSD], Jun 21, 2006
    #2
    1. Advertising

  3. Nalaka

    Nalaka Guest

    Thanks a bunch Steve.....
    "Steve C. Orr [MVP, MCSD]" <> wrote in message news:%...
    I had similar problems. Depending on what you're doing exactly you may be able to use this function I patched together that converts colors to their hex values so they'll be more browser friendly.

    Public Function Color2Hex(ByVal clr As Color) As String

    Dim HexR, HexB, HexG As String



    Try

    'Get Red Hex

    HexR = Hex(clr.R)

    If Len(HexR) < 2 Then HexR = "0" & HexR



    'Get Green Hex

    HexG = Hex(clr.G)

    If Len(HexG) < 2 Then HexG = "0" & HexG



    'Get Blue Hex

    HexB = Hex(clr.B)

    If Len(HexB) < 2 Then HexB = "0" & HexB



    Catch ex As Exception

    Return ""

    End Try



    Return "#" & HexR & HexG & HexB 'Output complete hex

    End Function




    --
    I hope this helps,
    Steve C. Orr, MCSD, MVP
    http://SteveOrr.net





    "Nalaka" <> wrote in message news:...
    > Hi....
    > When I pick colors using the design mode.... it puts c"color names" into the
    > markup.
    > Then in the "HTML mode"... shows a lot of color related errors.
    >
    > How do I get the gui editor to put colors numbers instead (of names)?
    >
    > any help is appreatiated
    > Nalaka
    >
    >
    Nalaka, Jun 21, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Paddy McCarthy
    Replies:
    3
    Views:
    707
    Anthony J Bybell
    Sep 24, 2004
  2. Bob
    Replies:
    1
    Views:
    381
    Lucas Tam
    Jul 30, 2004
  3. Lewis G. Pringle, Jr.
    Replies:
    0
    Views:
    599
    Lewis G. Pringle, Jr.
    Sep 30, 2003
  4. ChrisC
    Replies:
    2
    Views:
    456
    Roedy Green
    Aug 23, 2007
  5. Kamaljeet Saini
    Replies:
    0
    Views:
    406
    Kamaljeet Saini
    Feb 13, 2009
Loading...

Share This Page