{由 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;

相关文章:

  • 2022-12-23
  • 2022-02-10
  • 2022-12-23
  • 2021-05-17
  • 2021-05-06
  • 2021-10-31
猜你喜欢
  • 2022-12-23
  • 2021-07-25
  • 2021-08-09
  • 2022-12-23
  • 2021-12-21
  • 2022-12-23
  • 2021-10-20
相关资源
相似解决方案