-
Notifications
You must be signed in to change notification settings - Fork 0
/
ColoredText.cs
36 lines (35 loc) · 1.33 KB
/
ColoredText.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
public static class ColoredText
{
/// <summary>
/// Produces a colored console text. Takes in the text to be colored and the color you want the text, does a writeline with it.
/// </summary>
/// <param name="text"></param>
/// <param name="color"></param>
public static void TextWriteLine(string text, ConsoleColor color)
{
Console.ForegroundColor = color;
Console.WriteLine(text);
}
/// <summary>
/// Produces a colored console text. Takes in the text to be colored and the color you want the text, does a write with it.
/// </summary>
/// <param name="text"></param>
/// <param name="color"></param>
public static void TextWrite(string text, ConsoleColor color)
{
Console.ForegroundColor = color;
Console.Write(text);
}
/// <summary>
/// Produces highlighted text in yellow. Put the text you wish to highlight in the highlight variable.
/// </summary>
/// <param name="beginning"></param>
/// <param name="highlight"></param>
/// <param name="end"></param>
public static void TextHighlight(string beginning, string highlight, string end)
{
TextWrite(beginning, ConsoleColor.White);
TextWrite(highlight, ConsoleColor.Yellow);
TextWrite(end, ConsoleColor.White);
}
}