[fpc-devel] Correlation between TFPColor and RGB values (possible inconsistencies)

Luiz Americo Pereira Camara luizmed at oi.com.br
Tue Feb 16 21:15:37 CET 2010


While trying to get the RGB values (bytes) of a TFPColor i got confused 
about the format of TFPColor

Some hardcoded colors (unit FPImage) like colGray, colTea sets the high 
byte value of Red, Green, Blue fields with the corresponding byte value 
of RGB and leaves the low byte with 0.

Other colors like colWhite or colFuchsia sets both low and high byte of 
the fields with the corresponding  RGB values.

So whats the correlation of RGB byte values and TFPColor?

Should colWhite be redefined as colWhite      : TFPColor = (Red: $ff00; 
Green: $ff00; Blue: $ff00; Alpha: alphaOpaque)

or

colGray be redefined as colGray       : TFPColor = (Red: $8080; Green: 
$8080; Blue: $8080; Alpha: alphaOpaque) ??

This info will help to fix http://bugs.freepascal.org/view.php?id=15793

Luiz



More information about the fpc-devel mailing list