Board index » delphi » Delphi TColor RGB is Really BGR

Delphi TColor RGB is Really BGR

Has anyone else noticed this?  Right from their help files they state:

    If you specify TColor as a specific 4-byte hexadecimal number
    instead of using the constants defined in the Graphics unit,
    the low three bytes represent RGB color intensities for
    *blue*, *green*, and *red*, respectively.

Wow, anyone know of a particular reason for this.  I'm working on an HTML
Table Editor and I had to swap the upper and lower byte to get the colors I
recognized.  Threw me for a loop temporarilly.  It wasn't until I read this
part of the help file the millionth time when their usage of the term
"respectively" hit me in the face.  Doh.

Just wondering.  Thanks,

-- Jim Burns
   Consultant
   Technology Dynamics
   Pearland, Texas
   (713) 485-0410

 

Re:Delphi TColor RGB is Really BGR


Quote
jimbu...@nol.net (Jim Burns) wrote:
>Has anyone else noticed this?  Right from their help files they state:
>    If you specify TColor as a specific 4-byte hexadecimal number
>    instead of using the constants defined in the Graphics unit,
>    the low three bytes represent RGB color intensities for
>    *blue*, *green*, and *red*, respectively.

Noticed it already a long time ago (about a year ago), but it also
took me some time to find out when programming a unit to read TARGA
files...

Wilko van der Ploeg
ATDT Consultancy
The Netherlands
homepage : http://www.xs4all.nl/~atdt

Other Threads