-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathColorSamples.txt
More file actions
58 lines (45 loc) · 2.25 KB
/
Copy pathColorSamples.txt
File metadata and controls
58 lines (45 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// Open this in the RAD Studio code editor to test DelphiColorPreview.
// A color swatch should appear next to each literal below.
FBackground := clBtnFace;
FHighlight := clYellow;
FBorder := clGray;
FError := clRed;
PenColor := $00FF8040; // TColor hex (BGR): light blue-ish
BrushColor := $0000FF00; // pure green
ShadowColor := $00202020;
MarkerHigh := RGB(255, 0, 0);
MarkerMid := RGB(255, 165, 0);
MarkerLow := RGB(0, 128, 255);
// FMX TAlphaColor named constants (always recognized, any mode):
FmxAccent := claRed;
FmxPanel := TAlphaColorRec.Blue;
FmxText := TAlphaColors.Green;
// FMX TAlphaColor 8-digit hex: auto-detected by the high byte, no switch needed
// (a non-zero high byte means ARGB):
FmxOpaque := $FF3366CC; // opaque steel blue
FmxHalf := $80FF0000; // 50% red - swatch shows a checkerboard
// 6-digit hex is ambiguous: BGR by default in a VCL unit; in an FMX unit (or with
// the picker's Byte order set to RGB) it is read as web RGB:
WebColor := $C0FFEE; // 6-digit web RGB
// Not colors (should NOT get a swatch):
Flags := $80; // too short
Count := RGB(a, b, c); // non-literal args
// --- New in this release ---
// Web-hex inside string literals (always read as RGB/web):
WebShort := '#F80'; // expands to #FF8800
WebFull := '#FF8800'; // orange
// VCL TColorRec named colors:
RecColor := TColorRec.Crimson;
RecBlue := TColorRec.Blue;
// Decimal TColor assigned to a *Color target (BGR):
Cell.Color := 16708849; // $FEF4F1
TextColor := 15988209; // $F3F5F1
// Decimal ARGB assigned to a *Color target (alpha auto-detected from the high
// byte - no FMX unit or byte-order switch needed):
Fill.Color := 4278190080; // $FF000000 opaque black
// Counter-examples (should NOT get a swatch):
ColorIndex := 5; // does not end in "Color"
Width := 16708849; // not a color target
Pen.Color := SomeFunc(16708849); // decimal is inside a call, not a direct operand
Base.Color := TColor(16708849); // cast excluded (target IS *Color, but RHS is a cast, not a bare number)
const Fixed : TColor = 16708849; // const declaration excluded