Convert TColor to COLORREF

Has delphi an RTL function to convert TColor to COLORREF , if not, how can I convert TColor to COLORREF?

+7
source share
3 answers

Check out the Graphics.ColorToRGB function.

Converts a TColor value to an RGB color representation.

Call ColorToRGB to get the RGB color representation for use with Windows API calls. ColorToRGB deletes information that is stored in bits of the highest order, which palette to use for colors that are not always available.

+12
source
+4
source

Both TColor and COLORREF are 32-bit integers, so no conversion is required.

-one
source

All Articles