Delphi 判断一个颜色是否是亮色


本文整理自网络,侵删。

 判断一个颜色是否是亮色
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 nethttpclient1 数据库查询

Delphi sender 的用法举例

Delphi getsessionusername通过会话id得到会话名称

Delphi取cpu利用率

Delphi 在windows平台下实现进程隐藏

Delphi实现抓屏压缩并保存桌面图片

Delphi下ado的多线程编程

print documents from Delphi - print pdf, doc, xls, html, rtf, docx, txt

Delphi web service 多表提交的事务管理

winapi 字符及字符串函数(14): chartooem、oemtochar

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...