本文整理自网络,侵删。
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;
来源:http://www.xuexidashi.vip/h-nd-1757.html#_np=157_1996
相关阅读 >>
Delphi win32,win64用于单/多线程计数素数的整数性能比较
Delphi kbmmemtable的简单应用(增删改查示例)
Delphi idhttp组件+idhttpserver组件实现文件下载服务
Delphi dbnavigator1 删除时弹出确认对话框
更多相关阅读请进入《Delphi》频道 >>