Converting Inno Setup WizardForm.Color to RGB

后端 未结 1 1948
名媛妹妹
名媛妹妹 2021-01-14 00:41

If I try this:

[Setup]
AppName=MyApp
AppVerName=MyApp
DefaultDirName={pf}\\MyApp
DefaultGroupName=MyApp
OutputDir=         


        
相关标签:
1条回答
  • 2021-01-14 01:33

    When the first byte is $FF, the last byte is an index in a system color palette.

    You can get RGB of the system color using GetSysColor function.

    function GetSysColor(nIndex: Integer): DWORD;
      external 'GetSysColor@User32.dll stdcall';
    
    function ColorToRGB(Color: TColor): Cardinal;
    begin
      if Color < 0 then
        Result := GetSysColor(Color and $000000FF) else
        Result := Color;
    end;
    

    The ColorToRGB code is copied from Delphi VCL (Vcl.Graphics unit).

    0 讨论(0)
提交回复
热议问题