title: Convert HTML hex colour to TColor in Inno Setup Pascal Script
body: <p>I want to convert a HTML Hex colour to a <code>TColor</code> in Inno Setup Pascal Script.</p>
  <p>I tried reversing the function <code>ColorToWebColorStr</code> from <a href="https://stackoverflow.com/q/39009484/850848">Convert Inno Setup Pascal Script TColor to HTML hex colour</a>, but I might need a function like <code>RGBToColor</code> to get result as the <code>TColor</code>.</p>
  <p>Example: <em>Conversion of <code>#497AC2</code> HTML Hex Colour should be returned as <code>TColor</code> <code>$C27A49</code>.</em>
  <em>Input should be a HTML colour string representation and output should be a <code>TColor</code>.</em></p>
  <p>When I use the following function from VCL <code>Windows</code> unit in Inno Setup, <code>TForm.Color</code> shows as red.</p>
  <pre class="lang-pascal prettyprint-override"><code>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);
  </code></pre>
  <p><em>The colour I expected in <code>TForm.Color</code> is:</em></p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;html&gt;
  &lt;body bgcolor="#497AC2"&gt;
  &lt;h2&gt;This Background Colour is the Colour I expected instead of Red.&lt;/h2&gt;
  &lt;/body&gt;
  &lt;/html&gt; </code></pre>
  </div>
  </div>
  </p>
  <p><em>Additionally, I also like to know why red colour is returning here (form showing red) instead of expected semi light blue.........</em></p>
  <hr />
  <p><em>I want to use the conversion as:</em></p>
  <pre class="lang-pascal prettyprint-override"><code>#define BackgroundColour &quot;#497AC2&quot;
  
  procedure InitializeDataChecker;
  ...
  begin
  ...
    repeat
      ShellExec('Open', ExpandConstant('{pf64}\ImageMagick-7.0.2-Q16\Convert.exe'),
        ExpandConstant('-size ' + ScreenResolution + ' xc:' '{#BackgroundColour}' + ' -quality 100% &quot;{tmp}\'+IntToStr(ImageNumber)+'-X.jpg&quot;'), '', 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})
  </code></pre>
  <p>Thanks in advance.</p>