473,325 Members | 2,816 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

color names

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
Jun 20 '06 #1
2 1056
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" <na******@nospam.nospam> wrote in message news:OU**************@TK2MSFTNGP04.phx.gbl...
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

Jun 21 '06 #2
Thanks a bunch Steve.....
"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message news:%2****************@TK2MSFTNGP03.phx.gbl...
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" <na******@nospam.nospam> wrote in message news:OU**************@TK2MSFTNGP04.phx.gbl...
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

Jun 21 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Jeff Seale | last post by:
I just happend to notice that there are very FEW colors that you have to generate using #hex codes. But I was wondering, how many colors have names assigned to them in Tkinter and what are their...
2
by: Kari Laitinen | last post by:
During the past 15 years I have been writing computer programs with so-called natural names, which means that the names (identifiers, symbols) in progarms are constructed of several natural words....
102
by: Xah Lee | last post by:
i had the pleasure to read the PHP's manual today. http://www.php.net/manual/en/ although Pretty Home Page is another criminal hack of the unix lineage, but if we are here to judge the quality...
0
by: Mythran | last post by:
I wrote some code that is supposed to enumerate through the specified file's win32 resources and return a string-array of all icon names. When it runs, it returns a string-array with a bunch of...
3
by: cybernerdsx2 | last post by:
Hi, I notice a function prototype being declared as following: FileStream.h ========= extern void openFile(char *__ident, int __option); But, in the function declaration part shown as...
38
by: John Salerno | last post by:
Here's my script: import sqlite3 con = sqlite3.connect('labdb') cur = con.cursor() cur.executescript(''' DROP TABLE IF EXISTS Researchers; CREATE TABLE Researchers ( researcherID...
11
by: andrew | last post by:
Hi, I understand that when writing a css and specifying color I can use the following color _names_: aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, purple, red, silver,...
16
by: per9000 | last post by:
Hi, I recently started working a lot more in python than I have done in the past. And I discovered something that totally removed the pretty pink clouds of beautifulness that had surrounded my...
4
by: Peter Waller | last post by:
Dear Pythoners, I know this will probably be perceived as 'evil voodoo', and fair enough: it probably is. I guess it is unpythonic. ... but I want to know how to do it anyway - mostly for my...
4
by: Steven Simpson | last post by:
Stefan Ram wrote (in "More than one language in a page"): Is this a new trend of user-agent writers (Microformats, and now Google) staking claims on the @class namespace? I'm surely not the only...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.