Declaration ​
pascal
function ColorSwap(WinColor: TColor): TColor32;Parameters ​
| Parameter | Type | Description |
|---|---|---|
WinColor | TColor | Color value to convert. |
Returns ​
| Type | Description |
|---|---|
TColor32 | The 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.