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;

 

来源:http://www.xuexidashi.vip/h-nd-1757.html#_np=157_1996

相关阅读 >>

Delphi带进度条复制文件函数

Delphi tarray<tarray<string>> 用法

Delphi源码获取网络图片缓存的地址

Delphi获取操作系统已运行的所有窗口程序

Delphi 不管什么日期格式转换都不会错了

Delphi dbnavigator1 删除时弹出确认对话框

Delphi comparedatetime、comparedate、comparetime、samedatetime、samedate、sametime �c 对比时间的函数

Delphi 按字符串长度对tstringlist的元素进行排序

Delphi createprocesswithlogonw用法

Delphi for 循环 downto用法

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



打赏

取消

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

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

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

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

评论

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