Skip to content

Commit 22f0123

Browse files
-Added CSharp's number regex to Java.
-Improved DefaultDark StyleDictionary colours.
1 parent 84024e5 commit 22f0123

3 files changed

Lines changed: 41 additions & 27 deletions

File tree

ColorCode.Core/Compilation/Languages/Java.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ public IList<LanguageRule> Rules
6666
{
6767
{0, ScopeName.Keyword},
6868
}),
69+
new LanguageRule(
70+
@"\b[0-9]{1,}\b",
71+
new Dictionary<int, string>
72+
{
73+
{ 0, ScopeName.Number }
74+
}),
6975
};
7076
}
7177
}
@@ -80,4 +86,4 @@ public override string ToString()
8086
return Name;
8187
}
8288
}
83-
}
89+
}

ColorCode.Core/Styling/StyleDictionary.DefaultDark.cs

Lines changed: 34 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ namespace ColorCode.Styling
77
/// </summary>
88
public partial class StyleDictionary
99
{
10+
public const string VSDarkBackground = "#FF1E1E1E";
11+
public const string VSDarkComment = "#FF57A64A";
12+
public const string VSDarkXMLComment = "#FF608B4E";
13+
public const string VSDarkKeyword = "#FF569CD6";
14+
public const string VSDarkGray = "#FF9B9B9B";
15+
public const string VSDarkNumber = "#FFB5CEA8";
16+
public const string VSDarkPlainText = "#FFDADADA";
17+
public const string VSDarkClass = "#FF4EC9B0";
18+
public const string VSDarkString = "#FFD69D85";
19+
1020
/// <summary>
1121
/// A theme with Dark Colors.
1222
/// </summary>
@@ -18,7 +28,7 @@ public static StyleDictionary DefaultDark
1828
{
1929
new Style(ScopeName.PlainText)
2030
{
21-
Foreground = White,
31+
Foreground = VSDarkPlainText,
2232
Background = VSDarkBackground,
2333
ReferenceName = "plainText"
2434
},
@@ -29,12 +39,12 @@ public static StyleDictionary DefaultDark
2939
},
3040
new Style(ScopeName.HtmlComment)
3141
{
32-
Foreground = Green,
42+
Foreground = VSDarkComment,
3343
ReferenceName = "htmlComment"
3444
},
3545
new Style(ScopeName.HtmlTagDelimiter)
3646
{
37-
Foreground = Blue,
47+
Foreground = VSDarkKeyword,
3848
ReferenceName = "htmlTagDelimiter"
3949
},
4050
new Style(ScopeName.HtmlElementName)
@@ -49,47 +59,47 @@ public static StyleDictionary DefaultDark
4959
},
5060
new Style(ScopeName.HtmlAttributeValue)
5161
{
52-
Foreground = Blue,
62+
Foreground = VSDarkKeyword,
5363
ReferenceName = "htmlAttributeValue"
5464
},
5565
new Style(ScopeName.HtmlOperator)
5666
{
57-
Foreground = Blue,
67+
Foreground = VSDarkKeyword,
5868
ReferenceName = "htmlOperator"
5969
},
6070
new Style(ScopeName.Comment)
6171
{
62-
Foreground = Green,
72+
Foreground = VSDarkComment,
6373
ReferenceName = "comment"
6474
},
6575
new Style(ScopeName.XmlDocTag)
6676
{
67-
Foreground = Green,
77+
Foreground = VSDarkXMLComment,
6878
ReferenceName = "xmlDocTag"
6979
},
7080
new Style(ScopeName.XmlDocComment)
7181
{
72-
Foreground = Gray,
82+
Foreground = VSDarkXMLComment,
7383
ReferenceName = "xmlDocComment"
7484
},
7585
new Style(ScopeName.String)
7686
{
77-
Foreground = DullRed,
87+
Foreground = VSDarkString,
7888
ReferenceName = "string"
7989
},
8090
new Style(ScopeName.StringCSharpVerbatim)
8191
{
82-
Foreground = DullRed,
92+
Foreground = VSDarkString,
8393
ReferenceName = "stringCSharpVerbatim"
8494
},
8595
new Style(ScopeName.Keyword)
8696
{
87-
Foreground = Blue,
97+
Foreground = VSDarkKeyword,
8898
ReferenceName = "keyword"
8999
},
90100
new Style(ScopeName.PreprocessorKeyword)
91101
{
92-
Foreground = Blue,
102+
Foreground = VSDarkKeyword,
93103
ReferenceName = "preprocessorKeyword"
94104
},
95105
new Style(ScopeName.HtmlEntity)
@@ -109,22 +119,22 @@ public static StyleDictionary DefaultDark
109119
},
110120
new Style(ScopeName.XmlAttributeValue)
111121
{
112-
Foreground = Blue,
122+
Foreground = VSDarkKeyword,
113123
ReferenceName = "xmlAttributeValue"
114124
},
115125
new Style(ScopeName.XmlCDataSection)
116126
{
117-
Foreground = Gray,
127+
Foreground = VSDarkGray,
118128
ReferenceName = "xmlCDataSection"
119129
},
120130
new Style(ScopeName.XmlComment)
121131
{
122-
Foreground = Green,
132+
Foreground = VSDarkComment,
123133
ReferenceName = "xmlComment"
124134
},
125135
new Style(ScopeName.XmlDelimiter)
126136
{
127-
Foreground = Blue,
137+
Foreground = VSDarkKeyword,
128138
ReferenceName = "xmlDelimiter"
129139
},
130140
new Style(ScopeName.XmlName)
@@ -134,7 +144,7 @@ public static StyleDictionary DefaultDark
134144
},
135145
new Style(ScopeName.ClassName)
136146
{
137-
Foreground = MediumTurqoise,
147+
Foreground = VSDarkClass,
138148
ReferenceName = "className"
139149
},
140150
new Style(ScopeName.CssSelector)
@@ -149,7 +159,7 @@ public static StyleDictionary DefaultDark
149159
},
150160
new Style(ScopeName.CssPropertyValue)
151161
{
152-
Foreground = Blue,
162+
Foreground = VSDarkKeyword,
153163
ReferenceName = "cssPropertyValue"
154164
},
155165
new Style(ScopeName.SqlSystemFunction)
@@ -164,7 +174,7 @@ public static StyleDictionary DefaultDark
164174
},
165175
new Style(ScopeName.PowerShellOperator)
166176
{
167-
Foreground = Gray,
177+
Foreground = VSDarkGray,
168178
ReferenceName = "powershellOperator"
169179
},
170180
new Style(ScopeName.PowerShellType)
@@ -211,18 +221,18 @@ public static StyleDictionary DefaultDark
211221
},
212222
new Style(ScopeName.StringEscape)
213223
{
214-
Foreground = Gray,
224+
Foreground = VSDarkGray,
215225
ReferenceName = "stringEscape"
216226
},
217227
new Style(ScopeName.ControlKeyword)
218228
{
219-
Foreground = Blue,
229+
Foreground = VSDarkKeyword,
220230
ReferenceName = "controlKeyword"
221231
},
222232
new Style(ScopeName.Number)
223233
{
224234
ReferenceName = "number",
225-
Foreground = NumberGreen
235+
Foreground = VSDarkNumber
226236
},
227237
new Style(ScopeName.Operator)
228238
{
@@ -235,13 +245,13 @@ public static StyleDictionary DefaultDark
235245

236246
new Style(ScopeName.MarkdownHeader)
237247
{
238-
Foreground = Blue,
248+
Foreground = VSDarkKeyword,
239249
Bold = true,
240250
ReferenceName = "markdownHeader"
241251
},
242252
new Style(ScopeName.MarkdownCode)
243253
{
244-
Foreground = Teal,
254+
Foreground = VSDarkString,
245255
ReferenceName = "markdownCode"
246256
},
247257
new Style(ScopeName.MarkdownListItem)

ColorCode.Core/Styling/StyleDictionary.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ protected override string GetKeyForItem(Style item)
1919
return item.ScopeName;
2020
}
2121

22-
public const string VSDarkBackground = "#FF1E1E1E";
2322
public const string Blue = "#FF0000FF";
2423
public const string White = "#FFFFFFFF";
2524
public const string Black = "#FF000000";
@@ -38,6 +37,5 @@ protected override string GetKeyForItem(Style item)
3837
public const string OliveDrab = "#FF6B8E23";
3938
public const string DarkOliveGreen = "#FF556B2F";
4039
public const string DarkCyan = "#FF008B8B";
41-
public const string NumberGreen = "#FFB5CEA8";
4240
}
4341
}

0 commit comments

Comments
 (0)