作者:admin 来源: 日期:2021/1/21 22:49:57 人气: 标签:
判断一个颜色是否是亮色
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;