Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > color names

Reply
Thread Tools

color names

 
 
Nalaka
Guest
Posts: n/a
 
      06-20-2006
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


 
Reply With Quote
 
 
 
 
Steve C. Orr [MVP, MCSD]
Guest
Posts: n/a
 
      06-21-2006
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
>
>

 
Reply With Quote
 
 
 
 
Nalaka
Guest
Posts: n/a
 
      06-21-2006
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
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing font color from current font color to black color Kamaljeet Saini Ruby 0 02-13-2009 04:58 PM
upper and lower case static color names in Color ChrisC Java 2 08-23-2007 02:30 AM
Converting 'flat' gate level names to hierarchical names Paddy McCarthy VHDL 3 09-24-2004 05:34 PM
table field names vs. display names Bob ASP .Net 1 07-30-2004 05:06 PM
XSL rules applying to XSD (XML schema) defined type names (as opposed to node names) Lewis G. Pringle, Jr. XML 0 09-30-2003 10:34 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57