forked from jrsoftware/issrc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathModernColors.pas
110 lines (91 loc) · 3.52 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
unit ModernColors;
{
Inno Setup
Copyright (C) 1997-2019 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, tcSelBack, tcMarginFore, tcMarginBack, tcSplitterBack, tcBraceBack, tcIdentGuideFore,
tcRed, tcGreen, tcBlue, tcOrange, 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 = clWhite;
DBack = $2E2A2D; { Monokai Pro }
DSelBack = $413E40; { Monokai Pro }
DMarginFore = $716F71; { Monokai Pro }
DMarginBack = $413E40; { Monokai Pro }
DSplitterBack = $413E40; { Monokai Pro }
DBraceBack = $716F71; { Monokai Pro }
DIdentGuideFore = $716F71; { Monokai Pro }
//Monokai Pro's dark control color: $221F22
LFore = clBlack;
LBack = clWhite;
LSelBack = $C0C0C0; { Scintilla }
LMarginFore = $716F71; { Monokai Pro }
LMarginBack = $F9FBFB; { Monokai Pro }
LSplitterBack = clBtnFace;
LBraceBack = $E0E0E0; { Inno Setup 5 }
LIdentGuideFore = clSilver;
CFore = clBlack;
CBack = clWhite;
CSelBack = $C0C0C0; { Scintilla }
CMarginFore = clWindowText;
CMarginBack = clBtnFace;
CSplitterBack = clBtnFace;
CBraceBack = $E0E0E0; { Inno Setup 5 }
CIdentGuideFore = 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 = $3D29CC; { Azure DevOps }
MGreen = $339933; { Azure DevOps }
MBlue = $D47800; { Azure DevOps }
MOrange = $5E88E5; { Azure DevOps }
MPurple = $933B77; { Azure DevOps }
MYellow = $1DCBF2; { Azure DevOps }
MTeal = $B0C94E; { Visual Studio 2017 }
MGray = $707070; { Inno Setup 5 }
CRed = clRed;
CGreen = clGreen;
CBlue = clBlue;
COrange = clOlive;
CPurple = $C00080; { Inno Setup 5 }
CYellow = clYellow;
CTeal = clTeal;
CGray = $707070; { Inno Setup 5 }
Colors: array [TThemeType, TThemeColor] of TColor = (
(LFore, LBack, LSelBack, LMarginFore, LMarginBack, LSplitterBack, LBraceBack, LIdentGuideFore, MRed, MGreen, MBlue, MOrange, MPurple, MYellow, MTeal, MGray),
(DFore, DBack, DSelBack, DMarginFore, DMarginBack, DSplitterBack, DBraceBack, DIdentGuideFore, MRed, MGreen, MBlue, MOrange, MPurple, MYellow, MTeal, MGray),
(CFore, CBack, CSelBack, CMarginFore, CMarginBack, CSplitterBack, CBraceBack, CIdentGuideFore, CRed, CGreen, CBlue, COrange, 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.