-
-
Notifications
You must be signed in to change notification settings - Fork 25
/
RichTextBoxConsoleThemes.cs
92 lines (88 loc) · 7.76 KB
/
RichTextBoxConsoleThemes.cs
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
#region Copyright 2021-2023 C. Augusto Proiete & Contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#endregion
using System.Collections.Generic;
namespace Serilog.Sinks.RichTextBox.Themes
{
internal static class RichTextBoxConsoleThemes
{
public static RichTextBoxConsoleTheme Literate { get; } = new RichTextBoxConsoleTheme
(
new Dictionary<RichTextBoxThemeStyle, RichTextBoxConsoleThemeStyle>
{
[RichTextBoxThemeStyle.Text] = new RichTextBoxConsoleThemeStyle { Foreground = ConsoleHtmlColor.White },
[RichTextBoxThemeStyle.SecondaryText] = new RichTextBoxConsoleThemeStyle { Foreground = ConsoleHtmlColor.Gray },
[RichTextBoxThemeStyle.TertiaryText] = new RichTextBoxConsoleThemeStyle { Foreground = ConsoleHtmlColor.DarkGray },
[RichTextBoxThemeStyle.Invalid] = new RichTextBoxConsoleThemeStyle { Foreground = ConsoleHtmlColor.Yellow },
[RichTextBoxThemeStyle.Null] = new RichTextBoxConsoleThemeStyle { Foreground = ConsoleHtmlColor.Blue },
[RichTextBoxThemeStyle.Name] = new RichTextBoxConsoleThemeStyle { Foreground = ConsoleHtmlColor.Gray },
[RichTextBoxThemeStyle.String] = new RichTextBoxConsoleThemeStyle { Foreground = ConsoleHtmlColor.Cyan },
[RichTextBoxThemeStyle.Number] = new RichTextBoxConsoleThemeStyle { Foreground = ConsoleHtmlColor.Magenta },
[RichTextBoxThemeStyle.Boolean] = new RichTextBoxConsoleThemeStyle { Foreground = ConsoleHtmlColor.Blue },
[RichTextBoxThemeStyle.Scalar] = new RichTextBoxConsoleThemeStyle { Foreground = ConsoleHtmlColor.Green },
[RichTextBoxThemeStyle.LevelVerbose] = new RichTextBoxConsoleThemeStyle { Foreground = ConsoleHtmlColor.Gray },
[RichTextBoxThemeStyle.LevelDebug] = new RichTextBoxConsoleThemeStyle { Foreground = ConsoleHtmlColor.Gray },
[RichTextBoxThemeStyle.LevelInformation] = new RichTextBoxConsoleThemeStyle { Foreground = ConsoleHtmlColor.White },
[RichTextBoxThemeStyle.LevelWarning] = new RichTextBoxConsoleThemeStyle { Foreground = ConsoleHtmlColor.Yellow },
[RichTextBoxThemeStyle.LevelError] = new RichTextBoxConsoleThemeStyle { Foreground = ConsoleHtmlColor.White, Background = ConsoleHtmlColor.Red },
[RichTextBoxThemeStyle.LevelFatal] = new RichTextBoxConsoleThemeStyle { Foreground = ConsoleHtmlColor.White, Background = ConsoleHtmlColor.Red },
}
);
public static RichTextBoxConsoleTheme Grayscale { get; } = new RichTextBoxConsoleTheme
(
new Dictionary<RichTextBoxThemeStyle, RichTextBoxConsoleThemeStyle>
{
[RichTextBoxThemeStyle.Text] = new RichTextBoxConsoleThemeStyle { Foreground = ConsoleHtmlColor.White },
[RichTextBoxThemeStyle.SecondaryText] = new RichTextBoxConsoleThemeStyle { Foreground = ConsoleHtmlColor.Gray },
[RichTextBoxThemeStyle.TertiaryText] = new RichTextBoxConsoleThemeStyle { Foreground = ConsoleHtmlColor.DarkGray },
[RichTextBoxThemeStyle.Invalid] = new RichTextBoxConsoleThemeStyle { Foreground = ConsoleHtmlColor.White, Background = ConsoleHtmlColor.DarkGray },
[RichTextBoxThemeStyle.Null] = new RichTextBoxConsoleThemeStyle { Foreground = ConsoleHtmlColor.White },
[RichTextBoxThemeStyle.Name] = new RichTextBoxConsoleThemeStyle { Foreground = ConsoleHtmlColor.Gray },
[RichTextBoxThemeStyle.String] = new RichTextBoxConsoleThemeStyle { Foreground = ConsoleHtmlColor.White },
[RichTextBoxThemeStyle.Number] = new RichTextBoxConsoleThemeStyle { Foreground = ConsoleHtmlColor.White },
[RichTextBoxThemeStyle.Boolean] = new RichTextBoxConsoleThemeStyle { Foreground = ConsoleHtmlColor.White },
[RichTextBoxThemeStyle.Scalar] = new RichTextBoxConsoleThemeStyle { Foreground = ConsoleHtmlColor.White },
[RichTextBoxThemeStyle.LevelVerbose] = new RichTextBoxConsoleThemeStyle { Foreground = ConsoleHtmlColor.DarkGray },
[RichTextBoxThemeStyle.LevelDebug] = new RichTextBoxConsoleThemeStyle { Foreground = ConsoleHtmlColor.DarkGray },
[RichTextBoxThemeStyle.LevelInformation] = new RichTextBoxConsoleThemeStyle { Foreground = ConsoleHtmlColor.White },
[RichTextBoxThemeStyle.LevelWarning] = new RichTextBoxConsoleThemeStyle { Foreground = ConsoleHtmlColor.White, Background = ConsoleHtmlColor.DarkGray },
[RichTextBoxThemeStyle.LevelError] = new RichTextBoxConsoleThemeStyle { Foreground = ConsoleHtmlColor.Black, Background = ConsoleHtmlColor.White },
[RichTextBoxThemeStyle.LevelFatal] = new RichTextBoxConsoleThemeStyle { Foreground = ConsoleHtmlColor.Black, Background = ConsoleHtmlColor.White },
}
);
public static RichTextBoxConsoleTheme Colored { get; } = new RichTextBoxConsoleTheme
(
new Dictionary<RichTextBoxThemeStyle, RichTextBoxConsoleThemeStyle>
{
[RichTextBoxThemeStyle.Text] = new RichTextBoxConsoleThemeStyle { Foreground = ConsoleHtmlColor.Gray },
[RichTextBoxThemeStyle.SecondaryText] = new RichTextBoxConsoleThemeStyle { Foreground = ConsoleHtmlColor.DarkGray },
[RichTextBoxThemeStyle.TertiaryText] = new RichTextBoxConsoleThemeStyle { Foreground = ConsoleHtmlColor.DarkGray },
[RichTextBoxThemeStyle.Invalid] = new RichTextBoxConsoleThemeStyle { Foreground = ConsoleHtmlColor.Yellow },
[RichTextBoxThemeStyle.Null] = new RichTextBoxConsoleThemeStyle { Foreground = ConsoleHtmlColor.White },
[RichTextBoxThemeStyle.Name] = new RichTextBoxConsoleThemeStyle { Foreground = ConsoleHtmlColor.White },
[RichTextBoxThemeStyle.String] = new RichTextBoxConsoleThemeStyle { Foreground = ConsoleHtmlColor.White },
[RichTextBoxThemeStyle.Number] = new RichTextBoxConsoleThemeStyle { Foreground = ConsoleHtmlColor.White },
[RichTextBoxThemeStyle.Boolean] = new RichTextBoxConsoleThemeStyle { Foreground = ConsoleHtmlColor.White },
[RichTextBoxThemeStyle.Scalar] = new RichTextBoxConsoleThemeStyle { Foreground = ConsoleHtmlColor.White },
[RichTextBoxThemeStyle.LevelVerbose] = new RichTextBoxConsoleThemeStyle { Foreground = ConsoleHtmlColor.Gray, Background = ConsoleHtmlColor.DarkGray },
[RichTextBoxThemeStyle.LevelDebug] = new RichTextBoxConsoleThemeStyle { Foreground = ConsoleHtmlColor.White, Background = ConsoleHtmlColor.DarkGray },
[RichTextBoxThemeStyle.LevelInformation] = new RichTextBoxConsoleThemeStyle { Foreground = ConsoleHtmlColor.White, Background = ConsoleHtmlColor.Blue },
[RichTextBoxThemeStyle.LevelWarning] = new RichTextBoxConsoleThemeStyle { Foreground = ConsoleHtmlColor.DarkGray, Background = ConsoleHtmlColor.Yellow },
[RichTextBoxThemeStyle.LevelError] = new RichTextBoxConsoleThemeStyle { Foreground = ConsoleHtmlColor.White, Background = ConsoleHtmlColor.Red },
[RichTextBoxThemeStyle.LevelFatal] = new RichTextBoxConsoleThemeStyle { Foreground = ConsoleHtmlColor.White, Background = ConsoleHtmlColor.Red },
}
);
}
}