Inconsistency when working with hardcoded TFPColor values
Original Reporter info from Mantis: luizamerico
-
Reporter name: Luiz Americo
Original Reporter info from Mantis: luizamerico
- Reporter name: Luiz Americo
Description:
Using the hardcoded TFPColor values (colTeal, colGray...), defined in unit FPImage, with TLazIntfImage or when converting from TColor leads to inconsistent values.
As an example in colTeal only the high bytes values are set, but if clTeal(TColor) is converted to a TFPColor both low and high bytes are set.
Another example: setting the Colors property of a TLazIntfImage with colGray and getting back the set color will result in a different value with low bytes set. Since TLazIntfImage only considers the high bytes values the drawing effect will be the same.
TLazIntfImage sets both low and high bytes with the RGBA byte value. Initially setting only the high byte with the RGBA byte o in the low byte would fix it. But not all FPColor definitions are consistent, e.g., colFuchsia sets both low and high bytes.
The attached example shows the issue.
Lazarus 0.9.29 r23678 FPC 2.4.0 i386-win32-win32/win64
Mantis conversion info:
- Mantis ID: 15793