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 纯window系统api实现的ssl客户端

Delphi 跟随鼠标位置点击弹出菜单

unigui js操作Delphi控件赋值

Delphi实现自我删除

Delphi 系统对话框(如浏览目录)被隐藏到主窗体后面造成程序无法操作的临时处理方式

Delphi winapi: loadstring - 从资源中载入字符串

Delphi dos编程

Delphi leftstr 返回字符串左边指定个数的新字符(串)

Delphi中从dll,exe,icl中提取图标

Delphi获得webbrowser中的html文本

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



打赏

取消

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

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

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

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

评论

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