我想在Inno Setup Pascal脚本中将HTML十六进制颜色转换为TColor
。将十六进制颜色转换为Inno Setup中的TColor Pascal脚本
我试图从Convert Inno Setup Pascal Script TColor to HTML hex colour倒车功能ColorToWebColorStr
,但我可能需要一个像RGBToColor
一个函数来获取结果作为TColor
。 #497AC2
HTML十六进制颜色转换
例子应该返回为TColor
$C27A49
。 输入应该是HTML颜色字符串表示形式,输出应该是TColor
。
UPDATE
当我使用从VCL Windows
单元下面的函数在创新安装,TForm.Color
显示为红色。
const
COLORREF: TColor;
function RGB(R, G, B: Byte): COLORREF;
begin
Result := (R or (G shl 8) or (B shl 16));
end;
DataChecker.Color := RGB(73, 122, 194);
颜色我预计在TForm.Color
是:
<html>
<body bgcolor="#497AC2">
<h2>This Background Colour is the Colour I expected instead of Red.</h2>
</body>
</html>
另外,我也想知道为什么红色将返回此处(表格显示红色),而不是预计半浅蓝.........
我想使用的转换为:提前
#define BackgroundColour "#497AC2"
procedure InitializeDataChecker;
...
begin
...
repeat
ShellExec('Open', ExpandConstant('{pf64}\ImageMagick-7.0.2-Q16\Convert.exe'),
ExpandConstant('-size ' + ScreenResolution + ' xc:' '{#BackgroundColour}' + ' -quality 100% "{tmp}\'+IntToStr(ImageNumber)+'-X.jpg"'), '', SW_HIDEX, ewWaitUntilTerminated, ErrorCode);
...
until FileExists(ExpandConstant('{tmp}\'+IntToStr(ImageNumber)+'.jpg')) = False;
...
end;
...
DataChecker := TForm.Create(nil);
{ ---HERE IT SHOULD BE RETURNED AS `$C27A49`--- }
DataChecker.Color := NewFunction({#BackgroundColour})
感谢。
你会用什么样的功能? –
什么是DataChecker? –
这是一个'TForm',用于处理在安装过程中显示的一些图像。看到我更新的问题........... – Blueeyes789