ModernColors.pas 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. unit ModernColors;
  2. {
  3. Inno Setup
  4. Copyright (C) 1997-2025 Jordan Russell
  5. Portions by Martijn Laan
  6. For conditions of distribution and use, see LICENSE.TXT.
  7. Colors for modern dark and light themes, with classic theme support
  8. }
  9. interface
  10. uses
  11. Graphics;
  12. type
  13. TThemeType = (ttModernLight, ttModernDark, ttClassic);
  14. TThemeColor = (tcFore, tcBack, tcToolBack, tcSelBack, tcIntelliBack,
  15. tcWordAtCursorOccurrenceBack, tcSelTextOccurrenceBack,
  16. tcMarginFore, tcMarginBack, tcSplitterBack, tcBraceBack, tcIndentGuideFore,
  17. tcRed, tcGreen, tcBlue, tcOrange, tcReallyOrange, tcPurple,
  18. tcYellow, tcTeal, tcGray);
  19. TTheme = class
  20. private
  21. FType: TThemeType;
  22. function FGetDark: Boolean;
  23. function FGetModern: Boolean;
  24. function FGetColor(Color: TThemeColor): TColor;
  25. public
  26. property Colors[Color: TThemeColor]: TCOlor read FGetColor;
  27. property Dark: Boolean read FGetDark;
  28. property Modern: Boolean read FGetModern;
  29. property Typ: TThemeType read FType write FType;
  30. end;
  31. implementation
  32. function TTheme.FGetColor(Color: TThemeColor): TColor;
  33. const
  34. { D = Dark, L = Light, M = Modern, C = Classic }
  35. DFore = $D6D6D6; { VSCode Modern Dark, 2 tints lightened using color-hex.com }
  36. DBack = $1F1F1F; { VSCode Modern Dark }
  37. { If you combine this unit with a dark VCL Style then the following color should match the style's
  38. window background color. Value can be found using BitmapStyleDesigner.exe from BDS\Bin. Open the
  39. style .vsf file, go to the Colors section and then to the Window color. }
  40. DToolBack = $2B2B2B; { VCL Style 'Windows11 Dark 1.0' }
  41. DSelBack = $764F1D; { VSCode Modern Dark }
  42. //DSelInactiveBack = $51504F;{ VSCode Modern Dark }
  43. DIntelliBack = $202020; { VSCode Modern Dark }
  44. DWACOBack = $4A4A4A; { VSCode Modern Dark }
  45. DSTOBACK = $403A33; { VSCode Modern Dark }
  46. DMarginFore = $716F71; { Monokai Pro }
  47. DMarginBack = DToolBack;
  48. DSplitterBack = DToolBack;
  49. DBraceBack = DWACOBack;
  50. DIndentGuideFore = $716F71;{ Monokai Pro }
  51. //Monokai Pro's dark control color: $221F22
  52. LFore = $3B3B3B; { VSCode Modern Light }
  53. LBack = clWhite;
  54. LToolBack = clBtnFace;
  55. LSelBack = $FDD6A7; { VSCode Modern Light }
  56. //LSelInactiveBack = $F1EBE4;{ VSCode Modern Light }
  57. LIntelliBack = $F8F8F8; { VSCode Modern Light }
  58. LWACOBack = $ECECEC; { Inno Setup 5, 4 tints lightened using color-hex.com }
  59. LSTOBACK = $FEEAD3; { VSCode Modern Light }
  60. LMarginFore = $868686; { VSCode Modern Light, tabset }
  61. LMarginBack = $F8F8F8; { VSCode Modern Light, tabset }
  62. LSplitterBack = LToolBack;
  63. LBraceBack = LWACOBack;
  64. LIndentGuideFore = clSilver;
  65. CFore = clBlack;
  66. CBack = clWhite;
  67. CToolBack = clBtnFace;
  68. CSelBack = LSelBack;
  69. CIntelliBack = LIntelliBack;
  70. CWACOBack = LWACOBack;
  71. CSTOBACK = LSTOBack;
  72. CMarginFore = clWindowText;
  73. CMarginBack = CToolBack;
  74. CSplitterBack = CToolBack;
  75. CBraceBack = CWACOBack;
  76. CIndentGuideFore = clSilver;
  77. { The Microsoft Azure DevOps work well as foreground colors on both dark and light backgrounds.
  78. Its red and blue also fit well with the colors used by Microsoft's VS Image Library. }
  79. MRed = $6353D6; { Azure DevOps, 2 tints lightened using color-hex.com }
  80. MGreen = $339933; { Azure DevOps }
  81. MBlue = $D47800; { Azure DevOps }
  82. MOrange = $5E88E5; { Azure DevOps }
  83. MPurple = $A86292; { Azure DevOps, 2 tints lightened using color-hex.com }
  84. MYellow = $1DCBF2; { Azure DevOps }
  85. MTeal = $B0C94E; { Visual Studio 2017 }
  86. MGray = $707070; { Inno Setup 5 }
  87. CRed = clRed;
  88. CGreen = clGreen;
  89. CBlue = clBlue;
  90. COrange = clOlive;
  91. CReallyOrange = $00A5FF;
  92. CPurple = $C00080; { Inno Setup 5 }
  93. CYellow = clYellow;
  94. CTeal = clTeal;
  95. CGray = $707070; { Inno Setup 5 }
  96. Colors: array [TThemeType, TThemeColor] of TColor = (
  97. (LFore, LBack, LToolBack, LSelBack, LIntelliBack, LWACOBack, LSTOBack, LMarginFore, LMarginBack, LSplitterBack, LBraceBack, LIndentGuideFore, MRed, MGreen, MBlue, MOrange, MOrange, MPurple, MYellow, MTeal, MGray),
  98. (DFore, DBack, DToolBack, DSelBack, DIntelliBack, DWACOBack, DSTOBack, DMarginFore, DMarginBack, DSplitterBack, DBraceBack, DIndentGuideFore, MRed, MGreen, MBlue, MOrange, MOrange, MPurple, MYellow, MTeal, MGray),
  99. (CFore, CBack, CToolBack, CSelBack, CIntelliBack, CWACOBack, CSTOBack, CMarginFore, CMarginBack, CSplitterBack, CBraceBack, CIndentGuideFore, CRed, CGreen, CBlue, COrange, CReallyOrange, CPurple, CYellow, CTeal, CGray)
  100. );
  101. begin
  102. Result := Colors[FType, Color];
  103. end;
  104. function TTheme.FGetDark: Boolean;
  105. begin
  106. Result := FType = ttModernDark;
  107. end;
  108. function TTheme.FGetModern: Boolean;
  109. begin
  110. Result := FType <> ttClassic;
  111. end;
  112. end.