Re: Hex Conversion
- Posted by Chris Bensler <bensler at MAILOPS.COM> Jun 16, 2000
- 594 views
------=_NextPart_000_0017_01BFD78F.93DEA380 charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Thnx, It was the damndest thing. My comp was on the fritz. For some = reason, the prog worked just fine with the hex values, but if I used a = numerical value instead it would just be black. I had other strange = problems too. But I solved it all with a reboot. Chris This is a common misconception. Hex, binary, decimal, octal, and even = ASCII characters are all different *representations* of the same number. = When passing colors as atoms, it doesn't matter whether you use hex or = decimal. If I say 255 or #FF, it's the same. Many people are just more = comfortable with hex representation from programming HTML. On the other = hand, when passing as strings, it may be quite important which format = you use depending on how the routine parses the string. But as you = already mentioned, sprintf handles that situation quite nicely. HTH, Michael J. Sabal ------=_NextPart_000_0017_01BFD78F.93DEA380 charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META content=3D"text/html; charset=3Diso-8859-1" = http-equiv=3DContent-Type> <META content=3D"MSHTML 5.00.2314.1000" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=3D#ffffff> <DIV><FONT color=3D#0000ff face=3D"Comic Sans MS">Thnx,</FONT></DIV> <DIV><FONT color=3D#0000ff face=3D"Comic Sans MS"> It = was the=20 damndest thing. My comp was on the fritz. For some reason, the prog = worked just=20 fine with the hex values, but if I used a numerical value instead it = would just=20 be black. I had other strange problems too. But I solved it all with a=20 reboot.</FONT></DIV> <DIV> </DIV> <DIV><FONT color=3D#0000ff face=3D"Comic Sans MS">Chris</FONT></DIV> <BLOCKQUOTE=20 style=3D"BORDER-LEFT: #0000ff 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: = 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">This=20 is a common misconception. Hex, binary, decimal, octal, and even = ASCII=20 characters are all different *representations* of the same = number. When=20 passing colors as atoms, it doesn't matter whether you use hex or=20 decimal. If I say 255 or #FF, it's the same. Many people = are just=20 more comfortable with hex representation from programming HTML. = On the=20 other hand, when passing as strings, it may be quite important which = format=20 you use depending on how the routine parses the string. But as = you=20 already mentioned, sprintf handles that situation quite=20 ------=_NextPart_000_0017_01BFD78F.93DEA380--