RGB problem?

Hi guys,

Tell me if I am wrong. The RGB system in Delphi has the R and B wrong placed. I mean, for delphi is really BGR. I made a simple test to prove it:

   Label1.Color := $ff99cc is $cc99ff in a web page.

have you ever seen this behaviour?

best regards,
Manuel Lopez (lopem)
LVL 3
lopemAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
EpsylonConnect With a Mentor Commented:
That is because the color value, e.g. $FF99CC is physically stored in memory in this order: $CC $99 $FF $00

Motorola processors (I think since the 68000) for instance would store it like this: $00 $FF $99 $CC

The first method is called big-endian, the second method little-endian.
0
 
MadshiCommented:
Epsylon is right. However, I feel the need to say this clearly: It has nothing to do with Delphi. It's the same in every other language...   :-)
0
 
lopemAuthor Commented:
Thanks buddies!

Now I know why this is Experts-Exchange!

best regards
Manuel Lopez (lopem)
0
 
l8knightCommented:
The type of TLabel.Color is actually TColor which is defined as $xxBBGGRR, if you want to specify it as an RGB value you should use the RGB function...

Label1.Color := RGB($ff, $99, $cc);

FYI -> TColor is equivilant to Microsoft defined COLORREF

hope this helps explain it

l8knight
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.