123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- unit ModernColors;
- {
- Inno Setup
- Copyright (C) 1997-2025 Jordan Russell
- Portions by Martijn Laan
- For conditions of distribution and use, see LICENSE.TXT.
- Colors for modern dark and light themes, with classic theme support
- }
- interface
- uses
- Graphics;
- type
- TThemeType = (ttModernLight, ttModernDark, ttClassic);
- TThemeColor = (tcFore, tcBack, tcToolBack, tcSelBack, tcIntelliBack,
- tcWordAtCursorOccurrenceBack, tcSelTextOccurrenceBack,
- tcMarginFore, tcMarginBack, tcSplitterBack, tcBraceBack, tcIndentGuideFore,
- tcRed, tcGreen, tcBlue, tcOrange, tcReallyOrange, tcPurple,
- tcYellow, tcTeal, tcGray);
- TTheme = class
- private
- FType: TThemeType;
- function FGetDark: Boolean;
- function FGetModern: Boolean;
- function FGetColor(Color: TThemeColor): TColor;
- public
- property Colors[Color: TThemeColor]: TCOlor read FGetColor;
- property Dark: Boolean read FGetDark;
- property Modern: Boolean read FGetModern;
- property Typ: TThemeType read FType write FType;
- end;
- implementation
- function TTheme.FGetColor(Color: TThemeColor): TColor;
- const
- { D = Dark, L = Light, M = Modern, C = Classic }
- DFore = $D6D6D6; { VSCode Modern Dark, 2 tints lightened using color-hex.com }
- DBack = $1F1F1F; { VSCode Modern Dark }
- { If you combine this unit with a dark VCL Style then the following color should match the style's
- window background color. Value can be found using BitmapStyleDesigner.exe from BDS\Bin. Open the
- style .vsf file, go to the Colors section and then to the Window color. }
- DToolBack = $2B2B2B; { VCL Style 'Windows11 Dark 1.0' }
- DSelBack = $764F1D; { VSCode Modern Dark }
- //DSelInactiveBack = $51504F;{ VSCode Modern Dark }
- DIntelliBack = $202020; { VSCode Modern Dark }
- DWACOBack = $4A4A4A; { VSCode Modern Dark }
- DSTOBACK = $403A33; { VSCode Modern Dark }
- DMarginFore = $716F71; { Monokai Pro }
- DMarginBack = DToolBack;
- DSplitterBack = DToolBack;
- DBraceBack = DWACOBack;
- DIndentGuideFore = $716F71;{ Monokai Pro }
- //Monokai Pro's dark control color: $221F22
- LFore = $3B3B3B; { VSCode Modern Light }
- LBack = clWhite;
- LToolBack = clBtnFace;
- LSelBack = $FDD6A7; { VSCode Modern Light }
- //LSelInactiveBack = $F1EBE4;{ VSCode Modern Light }
- LIntelliBack = $F8F8F8; { VSCode Modern Light }
- LWACOBack = $ECECEC; { Inno Setup 5, 4 tints lightened using color-hex.com }
- LSTOBACK = $FEEAD3; { VSCode Modern Light }
- LMarginFore = $868686; { VSCode Modern Light, tabset }
- LMarginBack = $F8F8F8; { VSCode Modern Light, tabset }
- LSplitterBack = LToolBack;
- LBraceBack = LWACOBack;
- LIndentGuideFore = clSilver;
- CFore = clBlack;
- CBack = clWhite;
- CToolBack = clBtnFace;
- CSelBack = LSelBack;
- CIntelliBack = LIntelliBack;
- CWACOBack = LWACOBack;
- CSTOBACK = LSTOBack;
- CMarginFore = clWindowText;
- CMarginBack = CToolBack;
- CSplitterBack = CToolBack;
- CBraceBack = CWACOBack;
- CIndentGuideFore = clSilver;
- { The Microsoft Azure DevOps work well as foreground colors on both dark and light backgrounds.
- Its red and blue also fit well with the colors used by Microsoft's VS Image Library. }
- MRed = $6353D6; { Azure DevOps, 2 tints lightened using color-hex.com }
- MGreen = $339933; { Azure DevOps }
- MBlue = $D47800; { Azure DevOps }
- MOrange = $5E88E5; { Azure DevOps }
- MPurple = $A86292; { Azure DevOps, 2 tints lightened using color-hex.com }
- MYellow = $1DCBF2; { Azure DevOps }
- MTeal = $B0C94E; { Visual Studio 2017 }
- MGray = $707070; { Inno Setup 5 }
- CRed = clRed;
- CGreen = clGreen;
- CBlue = clBlue;
- COrange = clOlive;
- CReallyOrange = $00A5FF;
- CPurple = $C00080; { Inno Setup 5 }
- CYellow = clYellow;
- CTeal = clTeal;
- CGray = $707070; { Inno Setup 5 }
- Colors: array [TThemeType, TThemeColor] of TColor = (
- (LFore, LBack, LToolBack, LSelBack, LIntelliBack, LWACOBack, LSTOBack, LMarginFore, LMarginBack, LSplitterBack, LBraceBack, LIndentGuideFore, MRed, MGreen, MBlue, MOrange, MOrange, MPurple, MYellow, MTeal, MGray),
- (DFore, DBack, DToolBack, DSelBack, DIntelliBack, DWACOBack, DSTOBack, DMarginFore, DMarginBack, DSplitterBack, DBraceBack, DIndentGuideFore, MRed, MGreen, MBlue, MOrange, MOrange, MPurple, MYellow, MTeal, MGray),
- (CFore, CBack, CToolBack, CSelBack, CIntelliBack, CWACOBack, CSTOBack, CMarginFore, CMarginBack, CSplitterBack, CBraceBack, CIndentGuideFore, CRed, CGreen, CBlue, COrange, CReallyOrange, CPurple, CYellow, CTeal, CGray)
- );
-
- begin
- Result := Colors[FType, Color];
- end;
- function TTheme.FGetDark: Boolean;
- begin
- Result := FType = ttModernDark;
- end;
- function TTheme.FGetModern: Boolean;
- begin
- Result := FType <> ttClassic;
- end;
- end.
|