delphi 颜色转换函数: 从 Delphi 到 Html


本文整理自网络,侵删。

 颜色转换函数: 从 Delphi 到 Html
{由 Delphi 的颜色常数转换到 Html 颜色}
function HexColorToHtmlColor(c: Integer): string;
var
R,G,B: Byte;
begin
R := c and $FF;
G := (c shr 8) and $FF;
B := (c shr 16) and $FF;
Result := #35 + Format('%.2x%.2x%.2x',[R,G,B]);
end;
--------------------------------------------------------------------------------

{从十六进制字符串转换到 Html 颜色}
function HexColorToHtmlColor(s: string): string;
var
i: Integer;
R,G,B: Byte;
begin
i := StrToInt(s);
R := i and $FF;
G := (i shr 8) and $FF;
B := (i shr 16) and $FF;
Result := #35 + Format('%.2x%.2x%.2x',[R,G,B]);
end;

相关阅读 >>

Delphi xe7实现获取程序是否已管理员模式运行以及运行的windows用户名

Delphi实现url编码解码函数

Delphi 隐藏进程代码

Delphi 拼接文件路径

Delphi异常信息捕捉

Delphi 中文大写日期转换函数

Delphi的listview自动排序

Delphi里实现彩色图片转为黑白图像的功能

Delphi中的布尔类型

Delphi twebbrowser 响应回车键(ewb响应正常,无需额外代码)

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



打赏

取消

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

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

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

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

评论

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