System.UITypes.TColor

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

type TColor = -2147483648..2147483647;

C++

enum DECLSPEC_DENUM TColor : int {clMin=-0x7fffffff-1, clMax=0x7fffffff};

Properties

Type Visibility Source Unit Parent
type
enum
public
System.UITypes.pas
System.UITypes.hpp
System.UITypes System.UITypes

Description

TColor is used to specify the color of a control.

TColor is used to specify the color of a control. It is used by the Color property of many components and by a number of other properties that specify color values.

The TColorRec type defines useful constants identifying different types of colors for TColor. Some of these constants map directly to the closest matching color in the system palette (for example, the Blue constant maps to the blue color). You can see the actual colors themselves in the Colors table in TColorRec.

You can specify TColor as a specific 4-byte hexadecimal number instead of using the constants defined in the TColorRec type:

  • If the highest-order byte is zero, then the low three bytes represent RGB color intensities for blue, green, and red, respectively. The value $00FF0000 (Delphi) or 0x00FF0000 (C++) represents full-intensity, pure blue, $0000FF00 (Delphi) or 0x0000FF00 (C++) is pure green, and $000000FF (Delphi) or 0x000000FF (C++) is pure red. $00000000 (Delphi) or 0x00000000 (C++) is black and $00FFFFFF (Delphi) or 0x00FFFFFF (C++) is white.
  • If the highest-order byte is $FF (the SystemColor constant), then the low three bytes represent Windows system colors like SysWindow or SysMenu. These constants for system colors work only under Windows platforms.

See Also

Code Examples