Colors in the VCL
Go Up to Using the Properties of the Canvas Object
The Vcl.Graphics unit contains definitions of useful constants for TColor. These constants map either directly to the closest matching color in the system palette (for example, clBlue maps to blue) or to the corresponding system screen element color defined in the Color section of the Windows Control panel (for example, clBtnFace maps to the system color for button faces.)
If you specify TColor as a specific 4-byte hexadecimal number instead of using the constants defined in the Vcl.Graphics unit, 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 zero, the color obtained is the closest matching color in the system palette. If the highest-order byte is one ($01 or 0x01), the color obtained is the closest matching color in the currently realized palette. If the highest-order byte is two ($02 or 0x02), the value is matched with the nearest color in the logical palette of the current device context.
Normal Colors
The following table lists the colors that map to the closest matching color in the system palette. These color constants are listed in Graphics unit (section Constants).
Value | Meaning | Hex Value | Color |
---|---|---|---|
clNone | Represents no colors (black) | $1FFFFFFF | |
clAqua | Aqua | $FFFF00 | |
clBlack | Black | $000000 | |
clBlue | Blue | $FF0000 | |
clCream | Cream | $F0FBFF | |
clDkGray | Dark Grey | $808080 | |
clFuchsia | Fuchsia | $FF00FF | |
clGray | Gray | $808080 | |
clGreen | Green | $008000 | |
clLime | Lime Green | $00FF00 | |
clLtGray | Light Gray | $C0C0C0 | |
clMaroon | Maroon | $000080 | |
clMedGray | Medium Gray | $A4A0A0 | |
clMoneyGreen | Mint Green | $C0DCC0 | |
clNavy | Navy Blue | $800000 | |
clOlive | Olive Green | $008080 | |
clPurple | Purple | $800080 | |
clRed | Red | $0000FF | |
clSilver | Silver | $C0C0C0 | |
clSkyBlue | Sky Blue | $F0CAA6 | |
clTeal | Teal | $808000 | |
clWhite | White | $FFFFFF | |
clYellow | Yellow | $00FFFF |
System Colors
The following table lists the colors that are defined in the Windows Control panel.
Value | Meaning |
---|---|
clScrollBar | Current color of the scroll bar track |
clBackground | Current background color of the Windows desktop |
clActiveCaption | Current color of the active window's title bar |
clInactiveCaption | Current color of inactive windows' title bar |
clMenu | Current background color of menus |
clWindow | Current background color of windows |
clWindowFrame | Current color of window frames |
clMenuText | Current color of text on menus |
clWindowText | Current color of text in windows |
clCaptionText | Current color of the text on the active window's title bar |
clActiveBorder | Current border color of the active window |
clInactiveBorder | Current border color of inactive windows |
clAppWorkSpace | Current color of the application workspace |
clHighlight | Current background color of selected text |
clHighlightText | Current color of selected text |
clBtnFace | Current color of a button face |
clBtnShadow | Current color of a shadow cast by a button |
clGrayText | Current color of dimmed text |
clBtnText | Current color of text on a button |
clInactiveCaptionText | Current color of the text on an inactive window's title bar |
clBtnHighlight | Current color of the highlighting on a button |
cl3DDkShadow | Windows 95 or NT 4.0 only: Dark shadow for three-dimensional display elements |
cl3DLight | Windows 95 or NT 4.0 only: Light color for three-dimensional display elements (for edges facing the light source) |
clInfoText | Windows 95 or NT 4.0 only: Text color for tool tip controls |
clInfoBk | Windows 95 or NT 4.0 only: Background color for tool tip controls |
clGradientActiveCaption | Windows 98 or Windows 2000: Right-side color in the color gradient of an active window's title bar. clActiveCaption specifies the left side color. |
clGradientInactiveCaption | Windows 98 or Windows 2000: Right-side color in the color gradient of an inactive window's title bar. clInactiveCaption specifies the left side color. |
clDefault | The default color for the control to which the color is assigned |
clMenuHighlight | Current color of the highlighting on a menu |
clMenuBar | Current color of the menu bar |
Web Colors
The following table contains the "cl" values from the Web Named Color palette. The values are stored in the Windows COLORREF byte-order $00BBGGRR (Delphi) or 0x00BBGGRR (C++).
Value | Hex Value | Color |
---|---|---|
clWebSnow | $FAFAFF | |
clWebFloralWhite | $F0FAFF | |
clWebLavenderBlush | $F5F0FF | |
clWebOldLace | $E6F5FD | |
clWebIvory | $F0FFFF | |
clWebCornSilk | $DCF8FF | |
clWebBeige | $DCF5F5 | |
clWebAntiqueWhite | $D7EBFA | |
clWebWheat | $B3DEF5 | |
clWebAliceBlue | $FFF8F0 | |
clWebGhostWhite | $FFF8F8 | |
clWebLavender | $FAE6E6 | |
clWebSeashell | $EEF5FF | |
clWebLightYellow | $E0FFFF | |
clWebPapayaWhip | $D5EFFF | |
clWebNavajoWhite | $ADDEFF | |
clWebMoccasin | $B5E4FF | |
clWebBurlywood | $87B8DE | |
clWebAzure | $FFFFF0 | |
clWebMintcream | $FAFFF5 | |
clWebHoneydew | $F0FFF0 | |
clWebLinen | $E6F0FA | |
clWebLemonChiffon | $CDFAFF | |
clWebBlanchedAlmond | $CDEBFF | |
clWebBisque | $C4E4FF | |
clWebPeachPuff | $B9DAFF | |
clWebTan | $8CB4D2 | |
clWebYellow | $00FFFF | |
clWebDarkOrange | $008CFF | |
clWebRed | $0000FF | |
clWebDarkRed | $00008B | |
clWebMaroon | $000080 | |
clWebIndianRed | $5C5CCD | |
clWebSalmon | $7280FA | |
clWebCoral | $507FFF | |
clWebGold | $00D7FF | |
clWebTomato | $4763FF | |
clWebCrimson | $3C14DC | |
clWebBrown | $2A2AA5 | |
clWebChocolate | $1E69D2 | |
clWebSandyBrown | $60A4F4 | |
clWebLightSalmon | $7AA0FF | |
clWebLightCoral | $8080F0 | |
clWebOrange | $00A5FF | |
clWebOrangeRed | $0045FF | |
clWebFirebrick | $2222B2 | |
clWebSaddleBrown | $13458B | |
clWebSienna | $2D52A0 | |
clWebPeru | $3F85CD | |
clWebDarkSalmon | $7A96E9 | |
clWebRosyBrown | $8F8FBC | |
clWebPaleGoldenrod | $AAE8EE | |
clWebLightGoldenrodYellow | $D2FAFA | |
clWebOlive | $008080 | |
clWebForestGreen | $228B22 | |
clWebGreenYellow | $2FFFAD | |
clWebChartreuse | $00FF7F | |
clWebLightGreen | $90EE90 | |
clWebAquamarine | $D4FF7F | |
clWebSeaGreen | $578B2E | |
clWebGoldenRod | $20A5DA | |
clWebKhaki | $8CE6F0 | |
clWebOliveDrab | $238E6B | |
clWebGreen | $008000 | |
clWebYellowGreen | $32CD9A | |
clWebLawnGreen | $00FC7C | |
clWebPaleGreen | $98FB98 | |
clWebMediumAquamarine | $AACD66 | |
clWebMediumSeaGreen | $71B33C | |
clWebDarkGoldenRod | $0B86B8 | |
clWebDarkKhaki | $6BB7BD | |
clWebDarkOliveGreen | $2F6B55 | |
clWebDarkgreen | $006400 | |
clWebLimeGreen | $32CD32 | |
clWebLime | $00FF00 | |
clWebSpringGreen | $7FFF00 | |
clWebMediumSpringGreen | $9AFA00 | |
clWebDarkSeaGreen | $8FBC8F | |
clWebLightSeaGreen | $AAB220 | |
clWebPaleTurquoise | $EEEEAF | |
clWebLightCyan | $FFFFE0 | |
clWebLightBlue | $E6D8AD | |
clWebLightSkyBlue | $FACE87 | |
clWebCornFlowerBlue | $ED9564 | |
clWebDarkBlue | $8B0000 | |
clWebIndigo | $82004B | |
clWebMediumTurquoise | $CCD148 | |
clWebTurquoise | $D0E040 | |
clWebCyan | $FFFF00 | |
clWebAqua | $FFFF00 | |
clWebPowderBlue | $E6E0B0 | |
clWebSkyBlue | $EBCE87 | |
clWebRoyalBlue | $E16941 | |
clWebMediumBlue | $CD0000 | |
clWebMidnightBlue | $701919 | |
clWebDarkTurquoise | $D1CE00 | |
clWebCadetBlue | $A09E5F | |
clWebDarkCyan | $8B8B00 | |
clWebTeal | $808000 | |
clWebDeepskyBlue | $FFBF00 | |
clWebDodgerBlue | $FF901E | |
clWebBlue | $FF0000 | |
clWebNavy | $800000 | |
clWebDarkViolet | $D30094 | |
clWebDarkOrchid | $CC3299 | |
clWebMagenta | $FF00FF | |
clWebFuchsia | $FF00FF | |
clWebDarkMagenta | $8B008B | |
clWebMediumVioletRed | $8515C7 | |
clWebPaleVioletRed | $9370DB | |
clWebBlueViolet | $E22B8A | |
clWebMediumOrchid | $D355BA | |
clWebMediumPurple | $DB7093 | |
clWebPurple | $800080 | |
clWebDeepPink | $9314FF | |
clWebLightPink | $C1B6FF | |
clWebViolet | $EE82EE | |
clWebOrchid | $D670DA | |
clWebPlum | $DDA0DD | |
clWebThistle | $D8BFD8 | |
clWebHotPink | $B469FF | |
clWebPink | $CBC0FF | |
clWebLightSteelBlue | $DEC4B0 | |
clWebMediumSlateBlue | $EE687B | |
clWebLightSlateGray | $998877 | |
clWebWhite | $FFFFFF | |
clWebLightgrey | $D3D3D3 | |
clWebGray | $808080 | |
clWebSteelBlue | $B48246 | |
clWebSlateBlue | $CD5A6A | |
clWebSlateGray | $908070 | |
clWebWhiteSmoke | $F5F5F5 | |
clWebSilver | $C0C0C0 | |
clWebDimGray | $696969 | |
clWebMistyRose | $E1E4FF | |
clWebDarkSlateBlue | $8B3D48 | |
clWebDarkSlategray | $4F4F2F | |
clWebGainsboro | $DCDCDC | |
clWebDarkGray | $A9A9A9 | |
clWebBlack | $000000 |