forked from jrsoftware/issrc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathModernColors.pas
128 lines (109 loc) · 4.59 KB
/
ModernColors.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
unit ModernColors;
{
Inno Setup
Copyright (C) 1997-2024 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 }
DToolBack = $413E40; { Monokai Pro }
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 = $716F71; { Monokai Pro }
LMarginBack = $F9FBFB; { Monokai Pro }
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.