Show: Delphi C++
Display Preferences


From XE2 API Documentation
Jump to: navigation, search


type TAlphaColor = 0..-1;


typedef unsigned TAlphaColor;



Type Visibility Source Unit Parent
System.UITypes System.UITypes


TAlphaColor is used to specify alpha colors.

TAlphaColor is used to specify the alpha color to be displayed for a visual component. It is used by the Color property of many components and by a number of other properties that specify color values.

Alpha colors constants are defined by the TAlphaColorRec record. The FMX.Types unit also contains definitions of useful constants for TAlphaColor. The names of the constants from FMX.Types are composed of the 'cla' prefix and the color names defined by the TAlphaColorRec record. These constants map directly to the closest matching color in the system palette (for example, claBlue maps to blue).

TAlphaColor is formed of four channels (ARGB) specified as 4-byte hexadecimal number. The low three bytes represent RGB color channels, intensities for blue, green, and red, respectively, and the highest-order byte is the transparency coefficient (Alpha channel). The value $FFFF0000 (Delphi) or 0xFFFF0000 (C++) represents full-intensity, pure blue, $FF00FF00 (Delphi) or 0xFF00FF00 (C++) is pure green, and $FF0000FF (Delphi) or 0xFF0000FF (C++) is pure red. $FF000000 (Delphi) or 0xFF000000 (C++) is black and $FFFFFFFF (Delphi) or 0xFFFFFFFF (C++) is white.

To set the color of an object, you can also use TColorAnimation or TColorKeyAnimation.

For a list of the predefined colors, see TAlphaColorRec.

There are three ways to set a color:

  • Using the predefined constants from FMX.Types:
Color := claGreen;
Color := TAlphaColorRec.Green;
  • Using the 4-byte hexadecimal number representation:
Color := $FF008000;

See Also

Code Examples

Personal tools
Previous Versions