Skip to content
Member Filters
Show Inherited
Show Protected
Show abstract
GR32_LowLevel🞂ColorSwapFunction

ColorSwap

Swaps the R and B color channel and sets alpha to 255.

Declaration ​

pascal
function ColorSwap(WinColor: TColor): TColor32;

Parameters ​

ParameterTypeDescription
WinColorTColorColor value to convert.

Returns ​

TypeDescription
TColor32The color value with red and blue channels swapped and alpha channel set to $FF.

Description ​

ColorSwap exchanges the red and blue color components and forces the alpha channel component to $FF (fully opaque). It is typically used to convert between ARGB and ABGR.

WARNING

ColorSwap does not take the platform ARGB layout into account but simply swaps R and B, regardless on layout. It can therefore only be used to convert between a Windows/VCL color and a Graphics32 TColor32, on the platforms where the ARGB layout of these two differs. For example on Windows.

See also ​