Sign in Join
Wiki copytemporary

Colors: what changed

Revision 2 to 3. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11## Overview
22
3-Since FPC 3.2.0, Free Pascal defines TColor and TColorRec as well as the 140 standard Color names in the Delphi compatible System.UItypes unit, to allow non visual code to use the same type as visual code. Lazarus hasn't caught on yet, because the current Lazarus versions still support 3.0.x.
3+Since FPC 3.2.0, Free Pascal defines TColor and TColorRec as well as the 140 standard Color names in the Delphi compatible System.UItypes unit, to allow non visual code to use the same type as visual code. Lazarus hasn't caught on yet, because the current Lazarus versions still support 3.0.x.
44
5-In the [[LCL]] TColor is the standard color type. It is compatible with [[Delphi]]'s TColor. TColor can represent *either* an RGB (3x8bit) value, *or* a **system** color like **clDefault**. The LCL can also work with the fpImage system which uses the TFPColor type (which is RGBA (4x16bit), not RGB (3x8bit) like TColor).
5+In the [[LCL]] TColor is the standard color type. It is compatible with [[Delphi]]'s TColor. TColor can represent _either_ an RGB (3x8bit) value, _or_ a **system** color like **clDefault**. The LCL can also work with the fpImage system which uses the TFPColor type (which is RGBA (4x16bit), not RGB (3x8bit) like TColor).
66
77### Conversions between TColor and RGB values
88
9-The **Graphics** [[Unit|unit]] provides the following [[Function|functions]]:
10-
11-``` pascal
12-function Blue(rgb: TColor): BYTE; // does not work on system color
13-function Green(rgb: TColor): BYTE; // does not work on system color
14-function Red(rgb: TColor): BYTE; // does not work on system color
15-function RGBToColor(R, G, B: Byte): TColor;
16-procedure RedGreenBlue(rgb: TColor; out Red, Green, Blue: Byte); // does not work on system color
17-function FPColorToTColor(const FPColor: TFPColor): TColor;
18-function TColorToFPColor(const c: TColor): TFPColor; // does not work on system color
19-function IsSysColor(AColor: TColorRef): Boolean;
9+The **Graphics** [[Unit|unit]] provides the following [[Function|functions]]:
2010```
11+function ColorToRGB(Color: TColor): Longint;
12+ function Blue(rgb: TColor): BYTE; // does not work on system color
13+ function Green(rgb: TColor): BYTE; // does not work on system color
14+ function Red(rgb: TColor): BYTE; // does not work on system color
15+ function RGBToColor(R, G, B: Byte): TColor;
16+ procedure RedGreenBlue(rgb: TColor; out Red, Green, Blue: Byte); // does not work on system color
17+ function FPColorToTColor(const FPColor: TFPColor): TColor;
18+ function TColorToFPColor(const c: TColor): TFPColor; // does not work on system color
19+ function IsSysColor(AColor: TColorRef): Boolean;
20+```
2121
2222### Convert TColor to/from string
2323
24-Functions to convert strings like "25500" or "[[Dollar sign|$AA]]0088" or "clNavy" to TColor:
24+Functions to convert strings like "25500" or "[[Dollar sign|$]]AA0088" or "clNavy" to TColor:
2525
26-- StringToColor
27-- StringToColorDef
26+ * StringToColor
27+ * StringToColorDef
2828
29-To convert TColor to a nice string like "clNavy" or "\$AA0002":
29+To convert TColor to a nice string like "clNavy" or "$AA0002":
3030
31-- ColorToString
31+ * ColorToString
3232
33-### Convert TColor to/from HTML string \#rrggbb
33+### Convert TColor to/from HTML string #rrggbb
3434
35-See code in [[Convert color to/from HTML]].
35+See code in [[Convert color to/from HTML]].
3636
3737## Table of standard colors
3838
39-About 20 predefined color [[Constant|constants]] are provided, which are Delphi-compatible:
40-
41-| Colour constant | Meaning | [[Hexadecimal]] value for use with TColor | Example |
42-|----|----|----|----|
43-| clBlack | Black | TColor(\$000000); | |
44-| clMaroon | Maroon | TColor(\$000080); | |
45-| clGreen | Green | TColor(\$008000); | |
46-| clOlive | Olive Green | TColor(\$008080); | |
47-| clNavy | Navy Blue | TColor(\$800000); | |
48-| clPurple | Purple | TColor(\$800080); | |
49-| clTeal | Teal | TColor(\$808000); | |
50-| clGray | Grey | TColor(\$808080); | |
51-| clSilver | Silver | TColor(\$C0C0C0); | |
52-| clRed | Red | TColor(\$0000FF); | |
53-| clLime | Lime Green | TColor(\$00FF00); | |
54-| clYellow | Yellow | TColor(\$00FFFF); | |
55-| clBlue | Blue | TColor(\$FF0000); | |
56-| clFuchsia | Fuchsia | TColor(\$FF00FF); | |
57-| clAqua | Aqua | TColor(\$FFFF00); | |
58-| clLtGray | Light Grey | TColor(\$C0C0C0); | clSilver alias |
59-| clDkGray | Dark Grey | TColor(\$808080); | clGray alias |
60-| clWhite | White | TColor(\$FFFFFF); | |
61-| clCream | Cream | TColor(\$F0FBFF); | Lazarus 1.2 and newer |
62-| clMedGray | Medium Grey | TColor(\$A4A0A0); | Lazarus 1.2 and newer |
63-| clMoneyGreen | Mint Green | TColor(\$C0DCC0); | Lazarus 1.2 and newer |
64-| clSkyBlue | Sky Blue | TColor(\$F0CAA6); | Lazarus 1.2 and newer |
65-
66-In FPC 3.2.0+ defines some other constants for w3c colors in System.Uitypes:
39+About 20 predefined color [[Constant|constants]] are provided, which are Delphi-compatible:
6740
68-| Colour constant | Meaning | [[Hexadecimal]] value for use with TColor | Example |
69-|----|----|----|----|
70-| | | | |
71-| AntiqueWhite | AntiqueWhite | TColor(\$FAEBD7); | FPC 3.2.0 and newer |
72-| Aqua | Aqua | TColor(\$00FFFF); | FPC 3.2.0 and newer |
73-| Aquamarine | Aquamarine | TColor(\$7FFFD4); | FPC 3.2.0 and newer |
74-| Azure | Azure | TColor(\$F0FFFF); | FPC 3.2.0 and newer |
75-| Beige | Beige | TColor(\$F5F5DC); | FPC 3.2.0 and newer |
76-| Bisque | Bisque | TColor(\$FFE4C4); | FPC 3.2.0 and newer |
77-| Black | Black | TColor(\$000000); | FPC 3.2.0 and newer |
78-| BlanchedAlmond | BlanchedAlmond | TColor(\$FFEBCD); | FPC 3.2.0 and newer |
79-| Blue | Blue | TColor(\$0000FF); | FPC 3.2.0 and newer |
80-| BlueViolet | BlueViolet | TColor(\$8A2BE2); | FPC 3.2.0 and newer |
81-| Brown | Brown | TColor(\$A52A2A); | FPC 3.2.0 and newer |
82-| BurlyWood | BurlyWood | TColor(\$DEB887); | FPC 3.2.0 and newer |
83-| CadetBlue | CadetBlue | TColor(\$5F9EA0); | FPC 3.2.0 and newer |
84-| Chartreuse | Chartreuse | TColor(\$7FFF00); | FPC 3.2.0 and newer |
85-| Chocolate | Chocolate | TColor(\$D2691E); | FPC 3.2.0 and newer |
86-| Coral | Coral | TColor(\$FF7F50); | FPC 3.2.0 and newer |
87-| CornflowerBlue | CornflowerBlue | TColor(\$6495ED); | FPC 3.2.0 and newer |
88-| Cornsilk | Cornsilk | TColor(\$FFF8DC); | FPC 3.2.0 and newer |
89-| Crimson | Crimson | TColor(\$DC143C); | FPC 3.2.0 and newer |
90-| Cyan | Cyan | TColor(\$00FFFF); | FPC 3.2.0 and newer |
91-| DarkBlue | DarkBlue | TColor(\$00008B); | FPC 3.2.0 and newer |
92-| DarkCyan | DarkCyan | TColor(\$008B8B); | FPC 3.2.0 and newer |
93-| DarkGoldenRod | DarkGoldenRod | TColor(\$B8860B); | FPC 3.2.0 and newer |
94-| DarkGray | DarkGray | TColor(\$A9A9A9); | FPC 3.2.0 and newer |
95-| DarkGreen | DarkGreen | TColor(\$006400); | FPC 3.2.0 and newer |
96-| DarkGrey | DarkGrey | TColor(\$A9A9A9); | FPC 3.2.0 and newer |
97-| DarkKhaki | DarkKhaki | TColor(\$BDB76B); | FPC 3.2.0 and newer |
98-| DarkMagenta | DarkMagenta | TColor(\$8B008B); | FPC 3.2.0 and newer |
99-| DarkOliveGreen | DarkOliveGreen | TColor(\$556B2F); | FPC 3.2.0 and newer |
100-| DarkOrange | DarkOrange | TColor(\$FF8C00); | FPC 3.2.0 and newer |
101-| DarkOrchid | DarkOrchid | TColor(\$9932CC); | FPC 3.2.0 and newer |
102-| DarkRed | DarkRed | TColor(\$8B0000); | FPC 3.2.0 and newer |
103-| DarkSalmon | DarkSalmon | TColor(\$E9967A); | FPC 3.2.0 and newer |
104-| DarkSeaGreen | DarkSeaGreen | TColor(\$8FBC8F); | FPC 3.2.0 and newer |
105-| DarkSlateBlue | DarkSlateBlue | TColor(\$483D8B); | FPC 3.2.0 and newer |
106-| DarkSlateGray | DarkSlateGray | TColor(\$2F4F4F); | FPC 3.2.0 and newer |
107-| DarkSlateGrey | DarkSlateGrey | TColor(\$2F4F4F); | FPC 3.2.0 and newer |
108-| DarkTurquoise | DarkTurquoise | TColor(\$00CED1); | FPC 3.2.0 and newer |
109-| DarkViolet | DarkViolet | TColor(\$9400D3); | FPC 3.2.0 and newer |
110-| DeepPink | DeepPink | TColor(\$FF1493); | FPC 3.2.0 and newer |
111-| DeepSkyBlue | DeepSkyBlue | TColor(\$00BFFF); | FPC 3.2.0 and newer |
112-| DimGray | DimGray | TColor(\$696969); | FPC 3.2.0 and newer |
113-| DimGrey | DimGrey | TColor(\$696969); | FPC 3.2.0 and newer |
114-| DodgerBlue | DodgerBlue | TColor(\$1E90FF); | FPC 3.2.0 and newer |
115-| FireBrick | FireBrick | TColor(\$B22222); | FPC 3.2.0 and newer |
116-| FloralWhite | FloralWhite | TColor(\$FFFAF0); | FPC 3.2.0 and newer |
117-| ForestGreen | ForestGreen | TColor(\$228B22); | FPC 3.2.0 and newer |
118-| Fuchsia | Fuchsia | TColor(\$FF00FF); | FPC 3.2.0 and newer |
119-| Gainsboro | Gainsboro | TColor(\$DCDCDC); | FPC 3.2.0 and newer |
120-| GhostWhite | GhostWhite | TColor(\$F8F8FF); | FPC 3.2.0 and newer |
121-| Gold | Gold | TColor(\$FFD700); | FPC 3.2.0 and newer |
122-| GoldenRod | GoldenRod | TColor(\$DAA520); | FPC 3.2.0 and newer |
123-| Gray | Gray | TColor(\$808080); | FPC 3.2.0 and newer |
124-| Green | Green | TColor(\$008000); | FPC 3.2.0 and newer |
125-| GreenYellow | GreenYellow | TColor(\$ADFF2F); | FPC 3.2.0 and newer |
126-| Grey | Grey | TColor(\$808080); | FPC 3.2.0 and newer |
127-| HoneyDew | HoneyDew | TColor(\$F0FFF0); | FPC 3.2.0 and newer |
128-| HotPink | HotPink | TColor(\$FF69B4); | FPC 3.2.0 and newer |
129-| IndianRed | IndianRed | TColor(\$CD5C5C); | FPC 3.2.0 and newer |
130-| Indigo | Indigo | TColor(\$4B0082); | FPC 3.2.0 and newer |
131-| Ivory | Ivory | TColor(\$FFFFF0); | FPC 3.2.0 and newer |
132-| Khaki | Khaki | TColor(\$F0E68C); | FPC 3.2.0 and newer |
133-| Lavender | Lavender | TColor(\$E6E6FA); | FPC 3.2.0 and newer |
134-| LavenderBlush | LavenderBlush | TColor(\$FFF0F5); | FPC 3.2.0 and newer |
135-| LawnGreen | LawnGreen | TColor(\$7CFC00); | FPC 3.2.0 and newer |
136-| LemonChiffon | LemonChiffon | TColor(\$FFFACD); | FPC 3.2.0 and newer |
137-| LightBlue | LightBlue | TColor(\$ADD8E6); | FPC 3.2.0 and newer |
138-| LightCoral | LightCoral | TColor(\$F08080); | FPC 3.2.0 and newer |
139-| LightCyan | LightCyan | TColor(\$E0FFFF); | FPC 3.2.0 and newer |
140-| LightGoldenRodYellow | LightGoldenRodYellow | TColor(\$FAFAD2); | FPC 3.2.0 and newer |
141-| LightGray | LightGray | TColor(\$D3D3D3); | FPC 3.2.0 and newer |
142-| LightGreen | LightGreen | TColor(\$90EE90); | FPC 3.2.0 and newer |
143-| LightGrey | LightGrey | TColor(\$D3D3D3); | FPC 3.2.0 and newer |
144-| LightPink | LightPink | TColor(\$FFB6C1); | FPC 3.2.0 and newer |
145-| LightSalmon | LightSalmon | TColor(\$FFA07A); | FPC 3.2.0 and newer |
146-| LightSeaGreen | LightSeaGreen | TColor(\$20B2AA); | FPC 3.2.0 and newer |
147-| LightSkyBlue | LightSkyBlue | TColor(\$87CEFA); | FPC 3.2.0 and newer |
148-| LightSlateGray | LightSlateGray | TColor(\$778899); | FPC 3.2.0 and newer |
149-| LightSlateGrey | LightSlateGrey | TColor(\$778899); | FPC 3.2.0 and newer |
150-| LightSteelBlue | LightSteelBlue | TColor(\$B0C4DE); | FPC 3.2.0 and newer |
151-| LightYellow | LightYellow | TColor(\$FFFFE0); | FPC 3.2.0 and newer |
152-| Lime | Lime | TColor(\$00FF00); | FPC 3.2.0 and newer |
153-| LimeGreen | LimeGreen | TColor(\$32CD32); | FPC 3.2.0 and newer |
154-| Linen | Linen | TColor(\$FAF0E6); | FPC 3.2.0 and newer |
155-| Magenta | Magenta | TColor(\$FF00FF); | FPC 3.2.0 and newer |
156-| Maroon | Maroon | TColor(\$800000); | FPC 3.2.0 and newer |
157-| MediumAquaMarine | MediumAquaMarine | TColor(\$66CDAA); | FPC 3.2.0 and newer |
158-| MediumBlue | MediumBlue | TColor(\$0000CD); | FPC 3.2.0 and newer |
159-| MediumOrchid | MediumOrchid | TColor(\$BA55D3); | FPC 3.2.0 and newer |
160-| MediumPurple | MediumPurple | TColor(\$9370DB); | FPC 3.2.0 and newer |
161-| MediumSeaGreen | MediumSeaGreen | TColor(\$3CB371); | FPC 3.2.0 and newer |
162-| MediumSlateBlue | MediumSlateBlue | TColor(\$7B68EE); | FPC 3.2.0 and newer |
163-| MediumSpringGreen | MediumSpringGreen | TColor(\$00FA9A); | FPC 3.2.0 and newer |
164-| MediumTurquoise | MediumTurquoise | TColor(\$48D1CC); | FPC 3.2.0 and newer |
165-| MediumVioletRed | MediumVioletRed | TColor(\$C71585); | FPC 3.2.0 and newer |
166-| MidnightBlue | MidnightBlue | TColor(\$191970); | FPC 3.2.0 and newer |
167-| MintCream | MintCream | TColor(\$F5FFFA); | FPC 3.2.0 and newer |
168-| MistyRose | MistyRose | TColor(\$FFE4E1); | FPC 3.2.0 and newer |
169-| Moccasin | Moccasin | TColor(\$FFE4B5); | FPC 3.2.0 and newer |
170-| NavajoWhite | NavajoWhite | TColor(\$FFDEAD); | FPC 3.2.0 and newer |
171-| Navy | Navy | TColor(\$000080); | FPC 3.2.0 and newer |
172-| OldLace | OldLace | TColor(\$FDF5E6); | FPC 3.2.0 and newer |
173-| Olive | Olive | TColor(\$808000); | FPC 3.2.0 and newer |
174-| OliveDrab | OliveDrab | TColor(\$6B8E23); | FPC 3.2.0 and newer |
175-| Orange | Orange | TColor(\$FFA500); | FPC 3.2.0 and newer |
176-| OrangeRed | OrangeRed | TColor(\$FF4500); | FPC 3.2.0 and newer |
177-| Orchid | Orchid | TColor(\$DA70D6); | FPC 3.2.0 and newer |
178-| PaleGoldenRod | PaleGoldenRod | TColor(\$EEE8AA); | FPC 3.2.0 and newer |
179-| PaleGreen | PaleGreen | TColor(\$98FB98); | FPC 3.2.0 and newer |
180-| PaleTurquoise | PaleTurquoise | TColor(\$AFEEEE); | FPC 3.2.0 and newer |
181-| PaleVioletRed | PaleVioletRed | TColor(\$DB7093); | FPC 3.2.0 and newer |
182-| PapayaWhip | PapayaWhip | TColor(\$FFEFD5); | FPC 3.2.0 and newer |
183-| PeachPuff | PeachPuff | TColor(\$FFDAB9); | FPC 3.2.0 and newer |
184-| Peru | Peru | TColor(\$CD853F); | FPC 3.2.0 and newer |
185-| Pink | Pink | TColor(\$FFC0CB); | FPC 3.2.0 and newer |
186-| Plum | Plum | TColor(\$DDA0DD); | FPC 3.2.0 and newer |
187-| PowderBlue | PowderBlue | TColor(\$B0E0E6); | FPC 3.2.0 and newer |
188-| Purple | Purple | TColor(\$800080); | FPC 3.2.0 and newer |
189-| RebeccaPurple | RebeccaPurple | TColor(\$663399); | FPC 3.2.0 and newer |
190-| Red | Red | TColor(\$FF0000); | FPC 3.2.0 and newer |
191-| RosyBrown | RosyBrown | TColor(\$BC8F8F); | FPC 3.2.0 and newer |
192-| RoyalBlue | RoyalBlue | TColor(\$4169E1); | FPC 3.2.0 and newer |
193-| SaddleBrown | SaddleBrown | TColor(\$8B4513); | FPC 3.2.0 and newer |
194-| Salmon | Salmon | TColor(\$FA8072); | FPC 3.2.0 and newer |
195-| SandyBrown | SandyBrown | TColor(\$F4A460); | FPC 3.2.0 and newer |
196-| SeaGreen | SeaGreen | TColor(\$2E8B57); | FPC 3.2.0 and newer |
197-| SeaShell | SeaShell | TColor(\$FFF5EE); | FPC 3.2.0 and newer |
198-| Sienna | Sienna | TColor(\$A0522D); | FPC 3.2.0 and newer |
199-| Silver | Silver | TColor(\$C0C0C0); | FPC 3.2.0 and newer |
200-| SkyBlue | SkyBlue | TColor(\$87CEEB); | FPC 3.2.0 and newer |
201-| SlateBlue | SlateBlue | TColor(\$6A5ACD); | FPC 3.2.0 and newer |
202-| SlateGray | SlateGray | TColor(\$708090); | FPC 3.2.0 and newer |
203-| SlateGrey | SlateGrey | TColor(\$708090); | FPC 3.2.0 and newer |
204-| Snow | Snow | TColor(\$FFFAFA); | FPC 3.2.0 and newer |
205-| SpringGreen | SpringGreen | TColor(\$00FF7F); | FPC 3.2.0 and newer |
206-| SteelBlue | SteelBlue | TColor(\$4682B4); | FPC 3.2.0 and newer |
207-| Tan | Tan | TColor(\$D2B48C); | FPC 3.2.0 and newer |
208-| Teal | Teal | TColor(\$008080); | FPC 3.2.0 and newer |
209-| Thistle | Thistle | TColor(\$D8BFD8); | FPC 3.2.0 and newer |
210-| Tomato | Tomato | TColor(\$FF6347); | FPC 3.2.0 and newer |
211-| Turquoise | Turquoise | TColor(\$40E0D0); | FPC 3.2.0 and newer |
212-| Violet | Violet | TColor(\$EE82EE); | FPC 3.2.0 and newer |
213-| Wheat | Wheat | TColor(\$F5DEB3); | FPC 3.2.0 and newer |
214-| White | White | TColor(\$FFFFFF); | FPC 3.2.0 and newer |
215-| WhiteSmoke | WhiteSmoke | TColor(\$F5F5F5); | FPC 3.2.0 and newer |
216-| Yellow | Yellow | TColor(\$FFFF00); | FPC 3.2.0 and newer |
217-| YellowGreen | YellowGreen | TColor(\$9ACD32); | FPC 3.2.0 and newer |
41+Colour constant | Meaning | [[Hexadecimal]] value for use with TColor | Example
42+---|---|---|---
43+clBlack | Black | TColor($000000); |
44+clMaroon | Maroon | TColor($000080); |
45+clGreen | Green | TColor($008000); |
46+clOlive | Olive Green | TColor($008080); |
47+clNavy | Navy Blue | TColor($800000); |
48+clPurple | Purple | TColor($800080); |
49+clTeal | Teal | TColor($808000); |
50+clGray | Grey | TColor($808080); |
51+clSilver | Silver | TColor($C0C0C0); |
52+clRed | Red | TColor($0000FF); |
53+clLime | Lime Green | TColor($00FF00); |
54+clYellow | Yellow | TColor($00FFFF); |
55+clBlue | Blue | TColor($FF0000); |
56+clFuchsia | Fuchsia | TColor($FF00FF); |
57+clAqua | Aqua | TColor($FFFF00); |
58+clLtGray | Light Grey | TColor($C0C0C0); | clSilver alias
59+clDkGray | Dark Grey | TColor($808080); | clGray alias
60+clWhite | White | TColor($FFFFFF); |
61+clCream | Cream | TColor($F0FBFF); | Lazarus 1.2 and newer
62+clMedGray | Medium Grey | TColor($A4A0A0); | Lazarus 1.2 and newer
63+clMoneyGreen | Mint Green | TColor($C0DCC0); | Lazarus 1.2 and newer
64+clSkyBlue | Sky Blue | TColor($F0CAA6); | Lazarus 1.2 and newer
65+
66+
67+In FPC 3.2.0+ defines some other constants for w3c colors in System.Uitypes. Note that in FPC 3.2.0 and 3.2.2 the red and blue bytes are exchanged. This has been corrected in FPC 3.2.4+. The following table shows the correct byte order:
21868
69+Colour constant | Meaning | [[Hexadecimal]] value for use with TColor | Example
70+---|---|---|---
71+AntiqueWhite | AntiqueWhite | TColor($D7EBFA); | FPC 3.2.0 and newer
72+Aqua | Aqua | TColor($FFFF00); | FPC 3.2.0 and newer
73+Aquamarine | Aquamarine | TColor($D4FF7F); | FPC 3.2.0 and newer
74+Azure | Azure | TColor($FFFFF0); | FPC 3.2.0 and newer
75+Beige | Beige | TColor($DCF5F5); | FPC 3.2.0 and newer
76+Bisque | Bisque | TColor($C4E4FF); | FPC 3.2.0 and newer
77+Black | Black | TColor($000000); | FPC 3.2.0 and newer
78+BlanchedAlmond | BlanchedAlmond | TColor($CDEBFF); | FPC 3.2.0 and newer
79+Blue | Blue | TColor($FF0000); | FPC 3.2.0 and newer
80+BlueViolet | BlueViolet | TColor($E22B8A); | FPC 3.2.0 and newer
81+Brown | Brown | TColor($2A2AA5); | FPC 3.2.0 and newer
82+BurlyWood | BurlyWood | TColor($87B8DE); | FPC 3.2.0 and newer
83+CadetBlue | CadetBlue | TColor($A09E5F); | FPC 3.2.0 and newer
84+Chartreuse | Chartreuse | TColor($00FF7F); | FPC 3.2.0 and newer
85+Chocolate | Chocolate | TColor($1E69D2); | FPC 3.2.0 and newer
86+Coral | Coral | TColor($FF7F50); | FPC 3.2.0 and newer
87+CornflowerBlue | CornflowerBlue | TColor($ED9564); | FPC 3.2.0 and newer
88+Cornsilk | Cornsilk | TColor($DCF8FF); | FPC 3.2.0 and newer
89+Crimson | Crimson | TColor($3C14DC); | FPC 3.2.0 and newer
90+Cyan | Cyan | TColor($FFFF00); | FPC 3.2.0 and newer
91+DarkBlue | DarkBlue | TColor($8B0000); | FPC 3.2.0 and newer
92+DarkCyan | DarkCyan | TColor($8B8B00); | FPC 3.2.0 and newer
93+DarkGoldenRod | DarkGoldenRod | TColor($0B86B8); | FPC 3.2.0 and newer
94+DarkGray | DarkGray | TColor($A9A9A9); | FPC 3.2.0 and newer
95+DarkGreen | DarkGreen | TColor($006400); | FPC 3.2.0 and newer
96+DarkGrey | DarkGrey | TColor($A9A9A9); | FPC 3.2.0 and newer
97+DarkKhaki | DarkKhaki | TColor($6BB7BD); | FPC 3.2.0 and newer
98+DarkMagenta | DarkMagenta | TColor($8B008B); | FPC 3.2.0 and newer
99+DarkOliveGreen | DarkOliveGreen | TColor($2F6B55); | FPC 3.2.0 and newer
100+DarkOrange | DarkOrange | TColor($008CFF); | FPC 3.2.0 and newer
101+DarkOrchid | DarkOrchid | TColor($CC3299); | FPC 3.2.0 and newer
102+DarkRed | DarkRed | TColor($00008B); | FPC 3.2.0 and newer
103+DarkSalmon | DarkSalmon | TColor($7A96E9); | FPC 3.2.0 and newer
104+DarkSeaGreen | DarkSeaGreen | TColor($8FBC8F); | FPC 3.2.0 and newer
105+DarkSlateBlue | DarkSlateBlue | TColor($8B3D48); | FPC 3.2.0 and newer
106+DarkSlateGray | DarkSlateGray | TColor($4F4F2F); | FPC 3.2.0 and newer
107+DarkSlateGrey | DarkSlateGrey | TColor($4F4F2F); | FPC 3.2.0 and newer
108+DarkTurquoise | DarkTurquoise | TColor($D1CE00); | FPC 3.2.0 and newer
109+DarkViolet | DarkViolet | TColor($D30094); | FPC 3.2.0 and newer
110+DeepPink | DeepPink | TColor($9314FF); | FPC 3.2.0 and newer
111+DeepSkyBlue | DeepSkyBlue | TColor($FFBF00); | FPC 3.2.0 and newer
112+DimGray | DimGray | TColor($696969); | FPC 3.2.0 and newer
113+DimGrey | DimGrey | TColor($696969); | FPC 3.2.0 and newer
114+DodgerBlue | DodgerBlue | TColor($FF901E); | FPC 3.2.0 and newer
115+FireBrick | FireBrick | TColor($2222B2); | FPC 3.2.0 and newer
116+FloralWhite | FloralWhite | TColor($F0FAFF); | FPC 3.2.0 and newer
117+ForestGreen | ForestGreen | TColor($228B22); | FPC 3.2.0 and newer
118+Fuchsia | Fuchsia | TColor($FF00FF); | FPC 3.2.0 and newer
119+Gainsboro | Gainsboro | TColor($DCDCDC); | FPC 3.2.0 and newer
120+GhostWhite | GhostWhite | TColor($FFF8F8); | FPC 3.2.0 and newer
121+Gold | Gold | TColor($00D7FF); | FPC 3.2.0 and newer
122+GoldenRod | GoldenRod | TColor($20A5DA); | FPC 3.2.0 and newer
123+Gray | Gray | TColor($808080); | FPC 3.2.0 and newer
124+Green | Green | TColor($008000); | FPC 3.2.0 and newer
125+GreenYellow | GreenYellow | TColor($2FFFAD); | FPC 3.2.0 and newer
126+Grey | Grey | TColor($808080); | FPC 3.2.0 and newer
127+HoneyDew | HoneyDew | TColor($F0FFF0); | FPC 3.2.0 and newer
128+HotPink | HotPink | TColor($B469FF); | FPC 3.2.0 and newer
129+IndianRed | IndianRed | TColor($5C5CCD); | FPC 3.2.0 and newer
130+Indigo | Indigo | TColor($82004B); | FPC 3.2.0 and newer
131+Ivory | Ivory | TColor($F0FFFF); | FPC 3.2.0 and newer
132+Khaki | Khaki | TColor($8CE6F0); | FPC 3.2.0 and newer
133+Lavender | Lavender | TColor($FAE6E6); | FPC 3.2.0 and newer
134+LavenderBlush | LavenderBlush | TColor($F5F0FF); | FPC 3.2.0 and newer
135+LawnGreen | LawnGreen | TColor($00FC7C); | FPC 3.2.0 and newer
136+LemonChiffon | LemonChiffon | TColor($CDFAFF); | FPC 3.2.0 and newer
137+LightBlue | LightBlue | TColor($E6D8AD); | FPC 3.2.0 and newer
138+LightCoral | LightCoral | TColor($8080F0); | FPC 3.2.0 and newer
139+LightCyan | LightCyan | TColor($FFFFE0); | FPC 3.2.0 and newer
140+LightGoldenRodYellow | LightGoldenRodYellow | TColor($D2FAFA); | FPC 3.2.0 and newer
141+LightGray | LightGray | TColor($D3D3D3); | FPC 3.2.0 and newer
142+LightGreen | LightGreen | TColor($90EE90); | FPC 3.2.0 and newer
143+LightGrey | LightGrey | TColor($D3D3D3); | FPC 3.2.0 and newer
144+LightPink | LightPink | TColor($C1B6FF); | FPC 3.2.0 and newer
145+LightSalmon | LightSalmon | TColor($7AA0FF); | FPC 3.2.0 and newer
146+LightSeaGreen | LightSeaGreen | TColor($AAB220); | FPC 3.2.0 and newer
147+LightSkyBlue | LightSkyBlue | TColor($FACE87); | FPC 3.2.0 and newer
148+LightSlateGray | LightSlateGray | TColor($998877); | FPC 3.2.0 and newer
149+LightSlateGrey | LightSlateGrey | TColor($998877); | FPC 3.2.0 and newer
150+LightSteelBlue | LightSteelBlue | TColor($B0C4DE); | FPC 3.2.0 and newer
151+LightYellow | LightYellow | TColor($E0FFFF); | FPC 3.2.0 and newer
152+Lime | Lime | TColor($00FF00); | FPC 3.2.0 and newer
153+LimeGreen | LimeGreen | TColor($32CD32); | FPC 3.2.0 and newer
154+Linen | Linen | TColor($E6F0FA); | FPC 3.2.0 and newer
155+Magenta | Magenta | TColor($FF00FF); | FPC 3.2.0 and newer
156+Maroon | Maroon | TColor($000080); | FPC 3.2.0 and newer
157+MediumAquaMarine | MediumAquaMarine | TColor($AACD66); | FPC 3.2.0 and newer
158+MediumBlue | MediumBlue | TColor($CD0000); | FPC 3.2.0 and newer
159+MediumOrchid | MediumOrchid | TColor($D355BA); | FPC 3.2.0 and newer
160+MediumPurple | MediumPurple | TColor($DB7093); | FPC 3.2.0 and newer
161+MediumSeaGreen | MediumSeaGreen | TColor($71B33C); | FPC 3.2.0 and newer
162+MediumSlateBlue | MediumSlateBlue | TColor($EE687B); | FPC 3.2.0 and newer
163+MediumSpringGreen | MediumSpringGreen | TColor($9AFA00); | FPC 3.2.0 and newer
164+MediumTurquoise | MediumTurquoise | TColor($CCD148); | FPC 3.2.0 and newer
165+MediumVioletRed | MediumVioletRed | TColor($8515C7); | FPC 3.2.0 and newer
166+MidnightBlue | MidnightBlue | TColor($701919); | FPC 3.2.0 and newer
167+MintCream | MintCream | TColor($FAFFF5); | FPC 3.2.0 and newer
168+MistyRose | MistyRose | TColor($E1E4FF); | FPC 3.2.0 and newer
169+Moccasin | Moccasin | TColor($B5E4FF); | FPC 3.2.0 and newer
170+NavajoWhite | NavajoWhite | TColor($ADDEFF); | FPC 3.2.0 and newer
171+Navy | Navy | TColor($800000); | FPC 3.2.0 and newer
172+OldLace | OldLace | TColor($E6F5FD); | FPC 3.2.0 and newer
173+Olive | Olive | TColor($008080); | FPC 3.2.0 and newer
174+OliveDrab | OliveDrab | TColor($238E6B); | FPC 3.2.0 and newer
175+Orange | Orange | TColor($00A5FF); | FPC 3.2.0 and newer
176+OrangeRed | OrangeRed | TColor($0045FF); | FPC 3.2.0 and newer
177+Orchid | Orchid | TColor($D670DA); | FPC 3.2.0 and newer
178+PaleGoldenRod | PaleGoldenRod | TColor($AAE8EE); | FPC 3.2.0 and newer
179+PaleGreen | PaleGreen | TColor($98FB98); | FPC 3.2.0 and newer
180+PaleTurquoise | PaleTurquoise | TColor($EEEEAF); | FPC 3.2.0 and newer
181+PaleVioletRed | PaleVioletRed | TColor($9370DB); | FPC 3.2.0 and newer
182+PapayaWhip | PapayaWhip | TColor($D5EFFF); | FPC 3.2.0 and newer
183+PeachPuff | PeachPuff | TColor($B9DAFF); | FPC 3.2.0 and newer
184+Peru | Peru | TColor($3F85CD); | FPC 3.2.0 and newer
185+Pink | Pink | TColor($CBC0FF); | FPC 3.2.0 and newer
186+Plum | Plum | TColor($DDA0DD); | FPC 3.2.0 and newer
187+PowderBlue | PowderBlue | TColor($E6E0B0); | FPC 3.2.0 and newer
188+Purple | Purple | TColor($800080); | FPC 3.2.0 and newer
189+RebeccaPurple | RebeccaPurple | TColor($993366); | FPC 3.2.0 and newer
190+Red | Red | TColor($0000FF); | FPC 3.2.0 and newer
191+RosyBrown | RosyBrown | TColor($8F8FBC); | FPC 3.2.0 and newer
192+RoyalBlue | RoyalBlue | TColor($E16941); | FPC 3.2.0 and newer
193+SaddleBrown | SaddleBrown | TColor($13458B); | FPC 3.2.0 and newer
194+Salmon | Salmon | TColor($7280FA); | FPC 3.2.0 and newer
195+SandyBrown | SandyBrown | TColor($60A4F4); | FPC 3.2.0 and newer
196+SeaGreen | SeaGreen | TColor($578B2E); | FPC 3.2.0 and newer
197+SeaShell | SeaShell | TColor($EEF5FF); | FPC 3.2.0 and newer
198+Sienna | Sienna | TColor($2D52A0); | FPC 3.2.0 and newer
199+Silver | Silver | TColor($C0C0C0); | FPC 3.2.0 and newer
200+SkyBlue | SkyBlue | TColor($EBCE87); | FPC 3.2.0 and newer
201+SlateBlue | SlateBlue | TColor($CD5A6A); | FPC 3.2.0 and newer
202+SlateGray | SlateGray | TColor($908070); | FPC 3.2.0 and newer
203+SlateGrey | SlateGrey | TColor($908070); | FPC 3.2.0 and newer
204+Snow | Snow | TColor($FAFAFF); | FPC 3.2.0 and newer
205+SpringGreen | SpringGreen | TColor($7FFF00); | FPC 3.2.0 and newer
206+SteelBlue | SteelBlue | TColor($B48246); | FPC 3.2.0 and newer
207+Tan | Tan | TColor($8CB4D2); | FPC 3.2.0 and newer
208+Teal | Teal | TColor($808000); | FPC 3.2.0 and newer
209+Thistle | Thistle | TColor($D8BFD8); | FPC 3.2.0 and newer
210+Tomato | Tomato | TColor($4763FF); | FPC 3.2.0 and newer
211+Turquoise | Turquoise | TColor($D0E040); | FPC 3.2.0 and newer
212+Violet | Violet | TColor($EE82EE); | FPC 3.2.0 and newer
213+Wheat | Wheat | TColor($B3DEF5); | FPC 3.2.0 and newer
214+White | White | TColor($FFFFFF); | FPC 3.2.0 and newer
215+WhiteSmoke | WhiteSmoke | TColor($F5F5F5); | FPC 3.2.0 and newer
216+Yellow | Yellow | TColor($00FFFF); | FPC 3.2.0 and newer
217+YellowGreen | YellowGreen | TColor($32CD9A); | FPC 3.2.0 and newer
218+
219219## System colors
220220
221221### Example: clInfoBk, clInfoText
222222
223-System colors are color constants with a special meaning. Their real value depends on the context and theme. They are not simple colors. For example **clInfoBk**:
224-
225-``` pascal
223+System colors are color constants with a special meaning. Their real value depends on the context and theme. They are not simple colors. For example **clInfoBk** :
224+```
226225Form1.Canvas.Brush.Color:=clInfoBk; // use the default background brush of a hint window
227-Form1.Canvas.FillRect(10,10,50,50);
226+ Form1.Canvas.FillRect(10,10,50,50);
228227```
229228
230-A hint window on MS Windows might have a white background so the above will draw white. On Linux/gtk2 it might be a metallic texture, so the above will draw the texture. If you want to put some text onto this you need a corresponding color like **clInfoText**, otherwise your text might be unreadable for the user. For example:
231-
232-``` pascal
229+A hint window on MS Windows might have a white background so the above will draw white. On Linux/gtk2 it might be a metallic texture, so the above will draw the texture. If you want to put some text onto this you need a corresponding color like **clInfoText** , otherwise your text might be unreadable for the user. For example:
230+```
233231Form1.Canvas.Brush.Color:=clInfoBk; // use the default background brush of a hint window
234-Form1.Canvas.FillRect(10,10,50,50);
235-Form1.Canvas.Font.Color:=clInfoText; // use the default text color of a hint window
236-Form1.Canvas.TextOut(10,10,'Hint');
232+ Form1.Canvas.FillRect(10,10,50,50);
233+ Form1.Canvas.Font.Color:=clInfoText; // use the default text color of a hint window
234+ Form1.Canvas.TextOut(10,10,'Hint');
237235```
238236
239-The system color **clInfoBk** can not be used for Pen.Color and not for Font.Color. If you do so the result is undefined and depends on the widgetset and user theme. The same for **clInfoText**: It can only be used as a Font.Color. Using it as Brush.Color may not work. At the moment all widgetsets allow to use it as Pen.Color too.
237+The system color **clInfoBk** can not be used for Pen.Color and not for Font.Color. If you do so the result is undefined and depends on the widgetset and user theme. The same for **clInfoText** : It can only be used as a Font.Color. Using it as Brush.Color may not work. At the moment all widgetsets allow to use it as Pen.Color too.
240238
241239### Theme changes
242240
243-When the user switches the theme the system colors changes. A **clInfoBk** might change from white to blue or from a color to a texture. This change will happen when you allocate a new Brush handle. Keep in mind that a simple assignment Brush.Color:=clInfoBk does not allocate a Brush Handle. The Brush Handle is allocated on use. For example:
244-
245-``` pascal
241+When the user switches the theme the system colors changes. A **clInfoBk** might change from white to blue or from a color to a texture. This change will happen when you allocate a new Brush handle. Keep in mind that a simple assignment Brush.Color:=clInfoBk does not allocate a Brush Handle. The Brush Handle is allocated on use. For example:
242+```
246243Form1.Canvas.Brush.Color:=clInfoBk; // this will not create a new brush handle
247-Form1.Canvas.FillRect(10,10,50,50); // this will create the brush handle with the currently active theme brush for hint windows
248-...
249-// if the theme changes in this moment the Brush.Handle is still allocated with the old values
250-...
251-Form1.Canvas.FillRect(10,10,50,50); // this will paint with the old theme brush
252-Form1.Canvas.Brush.Color:=clInfoBk; // assigning the old value will not create a new brush handle
253-Form1.Canvas.FillRect(10,10,50,50); // this will paint with the old theme brush
254-Form1.Canvas.Brush.Color:=clRed; // assigning a new color, old Handle invalid
255-Form1.Canvas.Brush.Color:=clInfoBk; // assigning a new color, old Handle invalid
256-Form1.Canvas.FillRect(10,10,50,50); // this will create a new handle and paint with the new theme
244+ Form1.Canvas.FillRect(10,10,50,50); // this will create the brush handle with the currently active theme brush for hint windows
245+ ...
246+ // if the theme changes in this moment the Brush.Handle is still allocated with the old values
247+ ...
248+ Form1.Canvas.FillRect(10,10,50,50); // this will paint with the old theme brush
249+ Form1.Canvas.Brush.Color:=clInfoBk; // assigning the old value will not create a new brush handle
250+ Form1.Canvas.FillRect(10,10,50,50); // this will paint with the old theme brush
251+ Form1.Canvas.Brush.Color:=clRed; // assigning a new color, old Handle invalid
252+ Form1.Canvas.Brush.Color:=clInfoBk; // assigning a new color, old Handle invalid
253+ Form1.Canvas.FillRect(10,10,50,50); // this will create a new handle and paint with the new theme
257254```
258255
259256### Table of system colors
260257
261-The following table lists the system colors and their meaning. Using them outside the scope of the definition is undefined and the result depends on the widgetset and theme. For example **clDefault** is the normal background brush of the used device context. If you want to paint button elements on your own custom controls use the drawing functions of the unit **Themes**.
262-
263-**Constant**
264-
265-**LCL definition**
266-
267-**Delphi notes**
268-
269-**Supported Widgetsets**
270-
271-clNone
272-
273-Indicates "do not paint". Using it as Control's color is undefined. The control will not get transparent.
274-
275-\-
276-
277-all
278-
279-clDefault
280-
281-Using it for Brush will use the normal background brush of the target DC (device context).
282-
283-- On a Form's canvas a *FillRect* will paint a rectangular area filled with the normal background of a standard window. This is whatever the widgetset and theme defines. This might be the color gray or a gradient or a picture.
284-- Using clDefault on the Canvas of a TListBox will paint with the normal background, which is normally white on Windows. So in a TListBox clDefault is the same as clWindow.
285-- Using it as Pen color will use the default line color for the device context.
286-- Using it as Font color will use the normal text color of the device context.
287-
288-\| -
289-
290-all
291-
292-clScrollBar
293-
294-Scrollbar body
295-
296-\-
297-
298-all
299-
300-clBackground
301-
302-Desktop background color
303-
304-\-
305-
306-all
307-
308-clActiveCaption
309-
310-Active window titlebar
311-
312-\-
313-
314-none
315-
316-clInactiveCaption
317-
318-Inactive window titlebar
319-
320-\-
321-
322-none
323-
324-clMenu
325-
326-Regular menu item background color
327-
328-\-
329-
330-none
331-
332-clWindow
333-
334-The normal background brush of unselected text. Defined for controls like TEdit, TComboBox, TMemo, TListBox, TTreeView.
335-
336-\-
337-
338-none
339-
340-clWindowFrame
341-
342-Color of frame around the window
343-
344-\-
345-
346-none
347-
348-clMenuText
349-
350-The font color to use together with clMenu
351-
352-\-
353-
354-none
355-
356-clWindowText
357-
358-Font color to use together with clWindow
359-
360-\-
361-
362-none
363-
364-clCaptionText
365-
366-Active window titlebar text color
367-
368-\-
369-
370-none
371-
372-clActiveBorder
373-
374-?
375-
376-\-
377-
378-none
379-
380-clInactiveBorder
381-
382-?
383-
384-\-
385-
386-none
387-
388-clAppWorkspace
389-
390-MDIMain form background
391-
392-\-
393-
394-none
395-
396-clHighlight
397-
398-The brush color of selected element
399-
400-\-
401-
402-none
403-
404-clHighlightText
405-
406-Font color of selected text (to use together with clHighligh).
407-
408-\-
409-
410-none
411-
412-clBtnFace
413-
414-Button background
415-
416-\-
417-
418-none
419-
420-clBtnShadow
421-
422-Button shadow color (bottom right) used to achieve 3D effect
423-
424-\-
425-
426-none
427-
428-clGrayText
429-
430-The font color of disabled element
431-
432-\-
433-
434-none
435-
436-clBtnText
437-
438-Button font color to use together with clBtnFace
439-
440-\-
441-
442-none
443-
444-clInactiveCaptionText
445-
446-Inactive window titlebar text color
447-
448-\-
449-
450-none
451-
452-clBtnHighlight
453-
454-Button highlight color (top left) used to achieve 3D effect
455-
456-\-
457-
458-none
459-
460-cl3DDkShadow
461-
462-?
463-
464-\-
465-
466-none
467-
468-cl3DLight
469-
470-?
471-
472-\-
473-
474-none
475-
476-clInfoText
477-
478-Font color for hints. Use together with clInfoBk
479-
480-\-
481-
482-all
483-
484-clInfoBk
485-
486-Brush color for hints. Use together with clInfoText
487-
488-\-
489-
490-all
491-
492-clHotLight
493-
494-?
495-
496-\-
497-
498-none
499-
500-clGradientActiveCaption
501-
502-The second color used to make gradient of active window titlebar
503-
504-\-
505-
506-none
507-
508-clGradientInactiveCaption
509-
510-The second color used to make gradient for inactive window titlebar
511-
512-\-
513-
514-none
515-
516-clMenuHighlight
517-
518-The background color of selected menu item
519-
520-\-
521-
522-none
523-
524-clMenuBar
525-
526-The Backround color of menu bar
527-
528-\-
529-
530-none
531-
532-clForm
533-
534-?
535-
536-\-
537-
538-none
539-
540-clColorDesktop
541-
542-?
543-
544-\-
545-
546-none
547-
548-cl3DFace
549-
550-?
551-
552-\-
553-
554-none
555-
556-cl3DShadow
557-
558-?
559-
560-\-
561-
562-none
563-
564-cl3DHiLight
565-
566-?
567-
568-\-
569-
570-none
571-
572-clBtnHiLight
573-
574-Same as clBtnHighlight
575-
576-\-
577-
578-none
258+The following table lists the system colors and their meaning. Using them outside the scope of the definition is undefined and the result depends on the widgetset and theme. For example **clDefault** is the normal background brush of the used device context. If you want to paint button elements on your own custom controls use the drawing functions of the unit **Themes**.
579259
260+Constant | LCL definition | Delphi notes | Supported Widgetsets
261+---|---|---|---
262+clNone | Indicates "do not paint". Using it as Control's color is undefined. The control will not get transparent. | - | all
263+clDefault | Using it for Brush will use the normal background brush of the target DC (device context). On a Form's canvas a _FillRect_ will paint a rectangular area filled with the normal background of a standard window. This is whatever the widgetset and theme defines. This might be the color gray or a gradient or a picture. · Using clDefault on the Canvas of a TListBox will paint with the normal background, which is normally white on Windows. So in a TListBox clDefault is the same as clWindow. · Using it as Pen color will use the default line color for the device context. · Using it as Font color will use the normal text color of the device context. | - | all
264+clScrollBar | Scrollbar body | - | all
265+clBackground | Desktop background color | - | all
266+clActiveCaption | Active window titlebar | - | none
267+clInactiveCaption | Inactive window titlebar | - | none
268+clMenu | Regular menu item background color | - | none
269+clWindow | The normal background brush of unselected text. Defined for controls like TEdit, TComboBox, TMemo, TListBox, TTreeView. | - | none
270+clWindowFrame | Color of frame around the window | - | none
271+clMenuText | The font color to use together with clMenu | - | none
272+clWindowText | Font color to use together with clWindow | - | none
273+clCaptionText | Active window titlebar text color | - | none
274+clActiveBorder | ? | - | none
275+clInactiveBorder | ? | - | none
276+clAppWorkspace | MDIMain form background | - | none
277+clHighlight | The brush color of selected element | - | none
278+clHighlightText | Font color of selected text (to use together with clHighligh). | - | none
279+clBtnFace | Button background | - | none
280+clBtnShadow | Button shadow color (bottom right) used to achieve 3D effect | - | none
281+clGrayText | The font color of disabled element | - | none
282+clBtnText | Button font color to use together with clBtnFace | - | none
283+clInactiveCaptionText | Inactive window titlebar text color | - | none
284+clBtnHighlight | Button highlight color (top left) used to achieve 3D effect | - | none
285+cl3DDkShadow | ? | - | none
286+cl3DLight | ? | - | none
287+clInfoText | Font color for hints. Use together with clInfoBk | - | all
288+clInfoBk | Brush color for hints. Use together with clInfoText | - | all
289+clHotLight | ? | - | none
290+clGradientActiveCaption | The second color used to make gradient of active window titlebar | - | none
291+clGradientInactiveCaption | The second color used to make gradient for inactive window titlebar | - | none
292+clMenuHighlight | The background color of selected menu item | - | none
293+clMenuBar | The Backround color of menu bar | - | none
294+clForm | ? | - | none
295+clColorDesktop | ? | - | none
296+cl3DFace | ? | - | none
297+cl3DShadow | ? | - | none
298+cl3DHiLight | ? | - | none
299+clBtnHiLight | Same as clBtnHighlight | - | none
300+
580301### Finding the rgb values of a system color
581302
582-Use the function `ColorToRGB` (in unit `Graphics` to determine the rgb components of a system color. This functions detects whether a color is a system color and, if this is true, looks up the system color in the themes color. The returned [[Longint]] can be understood as a normal color:
583-
584-``` pascal
303+Use the function `ColorToRGB` (in unit `Graphics` to determine the rgb components of a system color. This functions detects whether a color is a system color and, if this is true, looks up the system color in the themes color. The returned [[Longint]] can be understood as a normal color:
304+```
585305// This example has a TColorBox on a form and uses this OnChange handler for the TColorbox:
586-procedure TForm1.ColorBox1Change(Sender: TObject);
587-var
588- c: TColor;
589-begin
590- c := ColorToRGB(ColorBox1.Selected);
591- Caption := Format('R%d G%d B%d', [Red(c), Green(c), Blue(c)]);
592-end;
306+ procedure TForm1.ColorBox1Change(Sender: TObject);
307+ var
308+ c: TColor;
309+ begin
310+ c := ColorToRGB(ColorBox1.Selected);
311+ Caption := Format('R%d G%d B%d', [Red(c), Green(c), Blue(c)]);
312+ end;
593313```
594314
595315## Drawing theme elements on your custom controls
596316
597-The unit **Themes** provides functions to draw single elements of standard controls. For example to draw an expand sign like a [[TTreeView]] use the following code:
598-
599-``` pascal
317+The unit **Themes** provides functions to draw single elements of standard controls. For example to draw an expand sign like a [[TTreeView]] use the following code:
318+```
600319uses Themes;
601-
602-...
603-
604-procedure TYourCustomControl.Paint;
605-const
606- PlusMinusDetail: array[Boolean {Hot}, Boolean {Expanded}] of TThemedTreeview =
607- (
608- (ttGlyphClosed, ttGlyphOpened),
609- (ttHotGlyphClosed, ttHotGlyphOpened)
610- );
611-var
612- Details: TThemedElementDetails;
613- R: TRect;
614- Collapse: boolean;
615-begin
616- ...
617- //draw a themed expand sign.
618- Details := ThemeServices.GetElementDetails(PlusMinusDetail[False, Collapse]);
619- R := Rect(ALeft, ATop, ARight + 1, ABottom + 1);
620- ThemeServices.DrawElement(Canvas.Handle, Details, R, nil);
621- ...
622-end;
320+
321+ ...
322+
323+ procedure TYourCustomControl.Paint;
324+ const
325+ PlusMinusDetail: array[Boolean {Hot}, Boolean {Expanded}] of TThemedTreeview =
326+ (
327+ (ttGlyphClosed, ttGlyphOpened),
328+ (ttHotGlyphClosed, ttHotGlyphOpened)
329+ );
330+ var
331+ Details: TThemedElementDetails;
332+ R: TRect;
333+ Collapse: boolean;
334+ begin
335+ ...
336+ //draw a themed expand sign.
337+ Details := ThemeServices.GetElementDetails(PlusMinusDetail[False, Collapse]);
338+ R := Rect(ALeft, ATop, ARight + 1, ABottom + 1);
339+ ThemeServices.DrawElement(Canvas.Handle, Details, R, nil);
340+ ...
341+ end;
623342```
624343
625344---
626-*From the Free Pascal wiki, page "Colors", as it stood on 2021-04-18 after a change by Marcov, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
345+*From the Free Pascal wiki, page "Colors", as the Internet Archive kept it on 2025-06-09, last changed on 2024-11-14. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*

Back to history