本文整理自网络,侵删。
判断一个颜色是否是亮色
function IsLightColor(const AColor: TColor): Boolean;
var
r, g, b, yiq: integer;
begin
r := GetRValue(AColor);
g := GetGValue(AColor);
b := GetBValue(AColor);
yiq := ((r*299)+(g*587)+(b*114)) div 1000;
if (yiq >= 128) then
result := True
else
result := False;
end;
相关阅读 >>
Delphi extractfileext() 获取文件后缀的函数
Delphi 2009 之 tcategorypanelgroup[2]: headeralignment、gradientdirection
Delphi xe10 fdmemtable 数据保存本地和从本地加载
更多相关阅读请进入《Delphi》频道 >>