View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default Hexadecimal Woes

http://www.mvps.org/dmcritchie/excel/colors.htm

--
Regards,
Tom Ogilvy


"Bryan Loeper" wrote:

I'm working with coloring some reports and have been trying to define
colors (via enum) for them.

1) Why is it that RGB(a,b,c) ends up being in BGR order as HEX?
Example:
&H996633 = 10053171
RGB(153,102,51) = 3368601
RGB(51,102,153) = 10053171

2) Why is it that &HCCFF appears to be (what I think is) the two's
compliment to 0xCCFF?
&HCCFF = -13057
-13057 = -0x3301
0x3301 + 0xCCFF = 0x10000

I've got the color issues for my program figured out, I'm just curious
about why Excel behaves this way. I did a quick Google search that
didn't bring up any complaints about this, so I figure I must not be
understanding How Things Work correctly. Thanks for any insight you
can offer!

-Bryan