https://blog.csdn.net/sxc1414749109/article/details/79260543
其数值,即为全透明的TAlphaColor数值,即透明度为0,我们可以在其六位数值前两位(00-99)透明度值,99即代表 完全不透明。
//:16进制用"$"表示,每两位表示一种颜色,从左往右,HTML中颜色表示为"RGB"即:红绿蓝,而delphi中的颜色表示为"BGR"即:蓝绿红,HTML中蓝色#0000FF,DELPHI中的蓝色$FF0000 rgb(红,绿,蓝),三个的取值范围:0~255.如:rgb(255,0,0)红色.
TColorRec = record
const
SystemColor = $FF000000;
// System Colors (仅针对Windows:)
cSCROLLBAR = 0;
cBACKGROUND = 1;
cACTIVECAPTION = 2;
cINACTIVECAPTION = 3;
cMENU = 4;
cWINDOW = 5;
cWINDOWFRAME = 6;
cMENUTEXT = 7;
cWINDOWTEXT = 8;
cCAPTIONTEXT = 9;
cACTIVEBORDER = 10;
cINACTIVEBORDER = 11;
cAPPWORKSPACE = 12;
cHIGHLIGHT = 13;
cHIGHLIGHTTEXT = 14;
cBTNFACE = 15;
cBTNSHADOW = $10;
cGRAYTEXT = 17;
cBTNTEXT = 18;
cINACTIVECAPTIONTEXT = 19;
cBTNHIGHLIGHT = 20;
c3DDKSHADOW = 21;
c3DLIGHT = 22;
cINFOTEXT = 23;
cINFOBK = 24;
cHOTLIGHT = 26;
cGRADIENTACTIVECAPTION = 27;
cGRADIENTINACTIVECAPTION = 28;
cMENUHILIGHT = 29;
cMENUBAR = 30;
cENDCOLORS = cMENUBAR;
cDESKTOP = cBACKGROUND;
c3DFACE = cBTNFACE;
c3DSHADOW = cBTNSHADOW;
c3DHIGHLIGHT = cBTNHIGHLIGHT;
c3DHILIGHT = cBTNHIGHLIGHT;
cBTNHILIGHT = cBTNHIGHLIGHT;
SysScrollBar = TColor(SystemColor or cSCROLLBAR);
SysBackground = TColor(SystemColor or cBACKGROUND);
SysActiveCaption = TColor(SystemColor or cACTIVECAPTION);
SysInactiveCaption = TColor(SystemColor or cINACTIVECAPTION);
SysMenu = TColor(SystemColor or cMENU);
SysWindow = TColor(SystemColor or cWINDOW);
SysWindowFrame = TColor(SystemColor or cWINDOWFRAME);
SysMenuText = TColor(SystemColor or cMENUTEXT);
SysWindowText = TColor(SystemColor or cWINDOWTEXT);
SysCaptionText = TColor(SystemColor or cCAPTIONTEXT);
SysActiveBorder = TColor(SystemColor or cACTIVEBORDER);
SysInactiveBorder = TColor(SystemColor or cINACTIVEBORDER);
SysAppWorkSpace = TColor(SystemColor or cAPPWORKSPACE);
SysHighlight = TColor(SystemColor or cHIGHLIGHT);
SysHighlightText = TColor(SystemColor or cHIGHLIGHTTEXT);
SysBtnFace = TColor(SystemColor or cBTNFACE);
SysBtnShadow = TColor(SystemColor or cBTNSHADOW);
SysGrayText = TColor(SystemColor or cGRAYTEXT);
SysBtnText = TColor(SystemColor or cBTNTEXT);
SysInactiveCaptionText = TColor(SystemColor or cINACTIVECAPTIONTEXT);
SysBtnHighlight = TColor(SystemColor or cBTNHIGHLIGHT);
Sys3DDkShadow = TColor(SystemColor or c3DDKSHADOW);
Sys3DLight = TColor(SystemColor or c3DLIGHT);
SysInfoText = TColor(SystemColor or cINFOTEXT);
SysInfoBk = TColor(SystemColor or cINFOBK);
SysHotLight = TColor(SystemColor or cHOTLIGHT);
SysGradientActiveCaption = TColor(SystemColor or cGRADIENTACTIVECAPTION);
SysGradientInactiveCaption = TColor(SystemColor or cGRADIENTINACTIVECAPTION);
SysMenuHighlight = TColor(SystemColor or cMENUHILIGHT);
SysMenuBar = TColor(SystemColor or cMENUBAR);
SysNone = TColor($1FFFFFFF);
SysDefault = TColor($20000000);
// 实际的颜色表:
Aliceblue = TColor($FFF8F0);
Antiquewhite = TColor($D7EBFA);
Aqua = TColor($FFFF00);
Aquamarine = TColor($D4FF7F);
Azure = TColor($FFFFF0);
Beige = TColor($DCF5F5);
Bisque = TColor($C4E4FF);
Black = TColor($000000);
Blanchedalmond = TColor($CDEBFF);
Blue = TColor($FF0000);
Blueviolet = TColor($E22B8A);
Brown = TColor($2A2AA5);
Burlywood = TColor($87B8DE);
Cadetblue = TColor($A09E5F);
Chartreuse = TColor($00FF7F);
Chocolate = TColor($1E69D2);
Coral = TColor($507FFF);
Cornflowerblue = TColor($ED9564);
Cornsilk = TColor($DCF8FF);
Crimson = TColor($3C14DC);
Cyan = TColor($FFFF00);
Darkblue = TColor($8B0000);
Darkcyan = TColor($8B8B00);
Darkgoldenrod = TColor($0B86B8);
Darkgray = TColor($A9A9A9);
Darkgreen = TColor($006400);
Darkgrey = TColor($A9A9A9);
Darkkhaki = TColor($6BB7BD);
Darkmagenta = TColor($8B008B);
Darkolivegreen = TColor($2F6B55);
Darkorange = TColor($008CFF);
Darkorchid = TColor($CC3299);
Darkred = TColor($00008B);
Darksalmon = TColor($7A96E9);
Darkseagreen = TColor($8FBC8F);
Darkslateblue = TColor($8B3D48);
Darkslategray = TColor($4F4F2F);
Darkslategrey = TColor($4F4F2F);
Darkturquoise = TColor($D1CE00);
Darkviolet = TColor($D30094);
Deeppink = TColor($9314FF);
Deepskyblue = TColor($FFBF00);
Dimgray = TColor($696969);
Dimgrey = TColor($696969);
Dodgerblue = TColor($FF901E);
Firebrick = TColor($2222B2);
Floralwhite = TColor($F0FAFF);
Forestgreen = TColor($228B22);
Fuchsia = TColor($FF00FF);
Gainsboro = TColor($DCDCDC);
Ghostwhite = TColor($FFF8F8);
Gold = TColor($00D7FF);
Goldenrod = TColor($20A5DA);
Gray = TColor($808080);
Green = TColor($008000);
Greenyellow = TColor($2FFFAD);
Grey = TColor($808080);
Honeydew = TColor($F0FFF0);
Hotpink = TColor($B469FF);
Indianred = TColor($5C5CCD);
Indigo = TColor($82004B);
Ivory = TColor($F0FFFF);
Khaki = TColor($8CE6F0);
Lavender = TColor($FAE6E6);
Lavenderblush = TColor($F5F0FF);
Lawngreen = TColor($00FC7C);
Lemonchiffon = TColor($CDFAFF);
Lightblue = TColor($E6D8AD);
Lightcoral = TColor($8080F0);
Lightcyan = TColor($FFFFE0);
Lightgoldenrodyellow = TColor($D2FAFA);
Lightgray = TColor($D3D3D3);
Lightgreen = TColor($90EE90);
Lightgrey = TColor($D3D3D3);
Lightpink = TColor($C1B6FF);
Lightsalmon = TColor($7AA0FF);
Lightseagreen = TColor($AAB220);
Lightskyblue = TColor($FACE87);
Lightslategray = TColor($998877);
Lightslategrey = TColor($998877);
Lightsteelblue = TColor($DEC4B0);
Lightyellow = TColor($E0FFFF);
LtGray = TColor($C0C0C0);
MedGray = TColor($A4A0A0);
DkGray = TColor($808080);
MoneyGreen = TColor($C0DCC0);
LegacySkyBlue = TColor($F0CAA6);
Cream = TColor($F0FBFF);
Lime = TColor($00FF00);
Limegreen = TColor($32CD32);
Linen = TColor($E6F0FA);
Magenta = TColor($FF00FF);
Maroon = TColor($000080);
Mediumaquamarine = TColor($AACD66);
Mediumblue = TColor($CD0000);
Mediumorchid = TColor($D355BA);
Mediumpurple = TColor($DB7093);
Mediumseagreen = TColor($71B33C);
Mediumslateblue = TColor($EE687B);
Mediumspringgreen = TColor($9AFA00);
Mediumturquoise = TColor($CCD148);
Mediumvioletred = TColor($8515C7);
Midnightblue = TColor($701919);
Mintcream = TColor($FAFFF5);
Mistyrose = TColor($E1E4FF);
Moccasin = TColor($B5E4FF);
Navajowhite = TColor($ADDEFF);
Navy = TColor($800000);
Oldlace = TColor($E6F5FD);
Olive = TColor($008080);
Olivedrab = TColor($238E6B);
Orange = TColor($00A5FF);
Orangered = TColor($0045FF);
Orchid = TColor($D670DA);
Palegoldenrod = TColor($AAE8EE);
Palegreen = TColor($98FB98);
Paleturquoise = TColor($EEEEAF);
Palevioletred = TColor($9370DB);
Papayawhip = TColor($D5EFFF);
Peachpuff = TColor($B9DAFF);
Peru = TColor($3F85CD);
Pink = TColor($CBC0FF);
Plum = TColor($DDA0DD);
Powderblue = TColor($E6E0B0);
Purple = TColor($800080);
Red = TColor($0000FF);
Rosybrown = TColor($8F8FBC);
Royalblue = TColor($E16941);
Saddlebrown = TColor($13458B);
Salmon = TColor($7280FA);
Sandybrown = TColor($60A4F4);
Seagreen = TColor($578B2E);
Seashell = TColor($EEF5FF);
Sienna = TColor($2D52A0);
Silver = TColor($C0C0C0);
Skyblue = TColor($EBCE87);
Slateblue = TColor($CD5A6A);
Slategray = TColor($908070);
Slategrey = TColor($908070);
Snow = TColor($FAFAFF);
Springgreen = TColor($7FFF00);
Steelblue = TColor($B48246);
Tan = TColor($8CB4D2);
Teal = TColor($808000);
Thistle = TColor($D8BFD8);
Tomato = TColor($4763FF);
Turquoise = TColor($D0E040);
Violet = TColor($EE82EE);
Wheat = TColor($B3DEF5);
White = TColor($FFFFFF);
Whitesmoke = TColor($F5F5F5);
Yellow = TColor($00FFFF);
Yellowgreen = TColor($32CD9A);
Null = TColor($00000000);
class var ColorToRGB: function (Color: TColor): Longint;
{ class operator Implicit(const C: TColor): TColorRec; inline;
class operator Implicit(const C: TColorRec): TColor; inline;
class operator Implicit(const C: TColorRec): Longint; inline;
class operator Explicit(const C: TColorRec): Longint; inline;}
case Cardinal of
0:
(Color: TColor);
2:
(HiWord, LoWord: Word);
3:
{$IFDEF BIGENDIAN}
(A, B, G, R: System.Byte);
{$ELSE}
(R, G, B, A: System.Byte);
{$ENDIF}
end;
TColor = -$7FFFFFFF-1..$7FFFFFFF;
TAlphaColor的表达(TAlphaColor和TColor之间的关系):
方式1:上述TColor的常量数值,比如:Yellow,即Yellow=TColor($00FFFF);
方式2:上述TColor函数的参数部分的反转加前缀‘#透明度’,比如:$00FFFF,反转后为:#FFFF00,同样是代表了颜色Yellow,
但此时代表全透明,透明度为0,不透明的表达为:#99FFFF00。即:前缀‘#透明度’,00<透明度<99
TAlphaColorRec = record
const
Alpha = TAlphaColor($FF000000);
Aliceblue = Alpha or TAlphaColor($F0F8FF);
Antiquewhite = Alpha or TAlphaColor($FAEBD7);
Aqua = Alpha or TAlphaColor($00FFFF);
Aquamarine = Alpha or TAlphaColor($7FFFD4);
Azure = Alpha or TAlphaColor($F0FFFF);
Beige = Alpha or TAlphaColor($F5F5DC);
Bisque = Alpha or TAlphaColor($FFE4C4);
Black = Alpha or TAlphaColor($000000);
Blanchedalmond = Alpha or TAlphaColor($FFEBCD);
Blue = Alpha or TAlphaColor($0000FF);
Blueviolet = Alpha or TAlphaColor($8A2BE2);
Brown = Alpha or TAlphaColor($A52A2A);
Burlywood = Alpha or TAlphaColor($DEB887);
Cadetblue = Alpha or TAlphaColor($5F9EA0);
Chartreuse = Alpha or TAlphaColor($7FFF00);
Chocolate = Alpha or TAlphaColor($D2691E);
Coral = Alpha or TAlphaColor($FF7F50);
Cornflowerblue = Alpha or TAlphaColor($6495ED);
Cornsilk = Alpha or TAlphaColor($FFF8DC);
Crimson = Alpha or TAlphaColor($DC143C);
Cyan = Alpha or TAlphaColor($00FFFF);
Darkblue = Alpha or TAlphaColor($00008B);
Darkcyan = Alpha or TAlphaColor($008B8B);
Darkgoldenrod = Alpha or TAlphaColor($B8860B);
Darkgray = Alpha or TAlphaColor($A9A9A9);
Darkgreen = Alpha or TAlphaColor($006400);
Darkgrey = Alpha or TAlphaColor($A9A9A9);
Darkkhaki = Alpha or TAlphaColor($BDB76B);
Darkmagenta = Alpha or TAlphaColor($8B008B);
Darkolivegreen = Alpha or TAlphaColor($556B2F);
Darkorange = Alpha or TAlphaColor($FF8C00);
Darkorchid = Alpha or TAlphaColor($9932CC);
Darkred = Alpha or TAlphaColor($8B0000);
Darksalmon = Alpha or TAlphaColor($E9967A);
Darkseagreen = Alpha or TAlphaColor($8FBC8F);
Darkslateblue = Alpha or TAlphaColor($483D8B);
Darkslategray = Alpha or TAlphaColor($2F4F4F);
Darkslategrey = Alpha or TAlphaColor($2F4F4F);
Darkturquoise = Alpha or TAlphaColor($00CED1);
Darkviolet = Alpha or TAlphaColor($9400D3);
Deeppink = Alpha or TAlphaColor($FF1493);
Deepskyblue = Alpha or TAlphaColor($00BFFF);
Dimgray = Alpha or TAlphaColor($696969);
Dimgrey = Alpha or TAlphaColor($696969);
Dodgerblue = Alpha or TAlphaColor($1E90FF);
Firebrick = Alpha or TAlphaColor($B22222);
Floralwhite = Alpha or TAlphaColor($FFFAF0);
Forestgreen = Alpha or TAlphaColor($228B22);
Fuchsia = Alpha or TAlphaColor($FF00FF);
Gainsboro = Alpha or TAlphaColor($DCDCDC);
Ghostwhite = Alpha or TAlphaColor($F8F8FF);
Gold = Alpha or TAlphaColor($FFD700);
Goldenrod = Alpha or TAlphaColor($DAA520);
Gray = Alpha or TAlphaColor($808080);
Green = Alpha or TAlphaColor($008000);
Greenyellow = Alpha or TAlphaColor($ADFF2F);
Grey = Alpha or TAlphaColor($808080);
Honeydew = Alpha or TAlphaColor($F0FFF0);
Hotpink = Alpha or TAlphaColor($FF69B4);
Indianred = Alpha or TAlphaColor($CD5C5C);
Indigo = Alpha or TAlphaColor($4B0082);
Ivory = Alpha or TAlphaColor($FFFFF0);
Khaki = Alpha or TAlphaColor($F0E68C);
Lavender = Alpha or TAlphaColor($E6E6FA);
Lavenderblush = Alpha or TAlphaColor($FFF0F5);
Lawngreen = Alpha or TAlphaColor($7CFC00);
Lemonchiffon = Alpha or TAlphaColor($FFFACD);
Lightblue = Alpha or TAlphaColor($ADD8E6);
Lightcoral = Alpha or TAlphaColor($F08080);
Lightcyan = Alpha or TAlphaColor($E0FFFF);
Lightgoldenrodyellow = Alpha or TAlphaColor($FAFAD2);
Lightgray = Alpha or TAlphaColor($D3D3D3);
Lightgreen = Alpha or TAlphaColor($90EE90);
Lightgrey = Alpha or TAlphaColor($D3D3D3);
Lightpink = Alpha or TAlphaColor($FFB6C1);
Lightsalmon = Alpha or TAlphaColor($FFA07A);
Lightseagreen = Alpha or TAlphaColor($20B2AA);
Lightskyblue = Alpha or TAlphaColor($87CEFA);
Lightslategray = Alpha or TAlphaColor($778899);
Lightslategrey = Alpha or TAlphaColor($778899);
Lightsteelblue = Alpha or TAlphaColor($B0C4DE);
Lightyellow = Alpha or TAlphaColor($FFFFE0);
LtGray = Alpha or TAlphaColor($C0C0C0);
MedGray = Alpha or TAlphaColor($A0A0A0);
DkGray = Alpha or TAlphaColor($808080);
MoneyGreen = Alpha or TAlphaColor($C0DCC0);
LegacySkyBlue = Alpha or TAlphaColor($F0CAA6);
Cream = Alpha or TAlphaColor($F0FBFF);
Lime = Alpha or TAlphaColor($00FF00);
Limegreen = Alpha or TAlphaColor($32CD32);
Linen = Alpha or TAlphaColor($FAF0E6);
Magenta = Alpha or TAlphaColor($FF00FF);
Maroon = Alpha or TAlphaColor($800000);
Mediumaquamarine = Alpha or TAlphaColor($66CDAA);
Mediumblue = Alpha or TAlphaColor($0000CD);
Mediumorchid = Alpha or TAlphaColor($BA55D3);
Mediumpurple = Alpha or TAlphaColor($9370DB);
Mediumseagreen = Alpha or TAlphaColor($3CB371);
Mediumslateblue = Alpha or TAlphaColor($7B68EE);
Mediumspringgreen = Alpha or TAlphaColor($00FA9A);
Mediumturquoise = Alpha or TAlphaColor($48D1CC);
Mediumvioletred = Alpha or TAlphaColor($C71585);
Midnightblue = Alpha or TAlphaColor($191970);
Mintcream = Alpha or TAlphaColor($F5FFFA);
Mistyrose = Alpha or TAlphaColor($FFE4E1);
Moccasin = Alpha or TAlphaColor($FFE4B5);
Navajowhite = Alpha or TAlphaColor($FFDEAD);
Navy = Alpha or TAlphaColor($000080);
Oldlace = Alpha or TAlphaColor($FDF5E6);
Olive = Alpha or TAlphaColor($808000);
Olivedrab = Alpha or TAlphaColor($6B8E23);
Orange = Alpha or TAlphaColor($FFA500);
Orangered = Alpha or TAlphaColor($FF4500);
Orchid = Alpha or TAlphaColor($DA70D6);
Palegoldenrod = Alpha or TAlphaColor($EEE8AA);
Palegreen = Alpha or TAlphaColor($98FB98);
Paleturquoise = Alpha or TAlphaColor($AFEEEE);
Palevioletred = Alpha or TAlphaColor($DB7093);
Papayawhip = Alpha or TAlphaColor($FFEFD5);
Peachpuff = Alpha or TAlphaColor($FFDAB9);
Peru = Alpha or TAlphaColor($CD853F);
Pink = Alpha or TAlphaColor($FFC0CB);
Plum = Alpha or TAlphaColor($DDA0DD);
Powderblue = Alpha or TAlphaColor($B0E0E6);
Purple = Alpha or TAlphaColor($800080);
Red = Alpha or TAlphaColor($FF0000);
Rosybrown = Alpha or TAlphaColor($BC8F8F);
Royalblue = Alpha or TAlphaColor($4169E1);
Saddlebrown = Alpha or TAlphaColor($8B4513);
Salmon = Alpha or TAlphaColor($FA8072);
Sandybrown = Alpha or TAlphaColor($F4A460);
Seagreen = Alpha or TAlphaColor($2E8B57);
Seashell = Alpha or TAlphaColor($FFF5EE);
Sienna = Alpha or TAlphaColor($A0522D);
Silver = Alpha or TAlphaColor($C0C0C0);
Skyblue = Alpha or TAlphaColor($87CEEB);
Slateblue = Alpha or TAlphaColor($6A5ACD);
Slategray = Alpha or TAlphaColor($708090);
Slategrey = Alpha or TAlphaColor($708090);
Snow = Alpha or TAlphaColor($FFFAFA);
Springgreen = Alpha or TAlphaColor($00FF7F);
Steelblue = Alpha or TAlphaColor($4682B4);
Tan = Alpha or TAlphaColor($D2B48C);
Teal = Alpha or TAlphaColor($008080);
Thistle = Alpha or TAlphaColor($D8BFD8);
Tomato = Alpha or TAlphaColor($FF6347);
Turquoise = Alpha or TAlphaColor($40E0D0);
Violet = Alpha or TAlphaColor($EE82EE);
Wheat = Alpha or TAlphaColor($F5DEB3);
White = Alpha or TAlphaColor($FFFFFF);
Whitesmoke = Alpha or TAlphaColor($F5F5F5);
Yellow = Alpha or TAlphaColor($FFFF00);
Yellowgreen = Alpha or TAlphaColor($9ACD32);
Null = TAlphaColor($00000000);
constructor Create(const Color: TAlphaColor);
class var ColorToRGB: function (Color: TAlphaColor): Longint;
case Cardinal of
0:
(Color: TAlphaColor);
2:
(HiWord, LoWord: Word);
3:
{$IFDEF BIGENDIAN}
(A, R, G, B: System.Byte);
{$ELSE}
(B, G, R, A: System.Byte);
{$ENDIF}
end;
1、html颜色代码大全
https://blog.csdn.net/sxc1414749109/article/details/79260543
其数值,即为全透明的TAlphaColor数值,即透明度为0,我们可以在其六位数值前两位(00-99)透明度值,99即代表 完全不透明。
2、组件的Fill.Color属性:即TAlphaColor
根据:html颜色代码大全,将6位16进制前加两位透明度数值,即可
#1A1A1A:代表纯色黄"Yellow"
#851A1A1A:85%透明度的黄"Yellow",即黄"Yellow"的TAlphaColor数值
首先要弄清楚是否需要一个额外的类型限定符.
TAlphaColors在“System.UITypes”单元中声明:
Type
TAlphaColors = TAlphaColorRec;
一旦你清楚的知道这一点,那就OK了.
当然,还有一个技巧可以绕过这个限定符的使用。直接引用“System.UIConsts”单
元,然后您可以使用颜色值,如“claRed”,“claBlack”。
Uses
System.UIConsts;
//...
memo1.FontColor := claRed; // Alternative:
Rectangle6.Fill.Color := claRed;
ARect.Stroke.Color:=claNull;//:也可://TAlphaColors.Null;//:也可:TAlphaColorRec.Null;//:也可:TAlphaColor($00000000);