-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Render.cs
52 lines (45 loc) · 1.26 KB
/
Render.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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace lika
{
internal class Render
{
public static void Str(string str, ConsoleColor? backgroundColor = null, ConsoleColor? foregroundColor = null)
{
if (backgroundColor != null)
{
Console.BackgroundColor = (ConsoleColor)backgroundColor;
}
if (foregroundColor != null)
{
Console.ForegroundColor = (ConsoleColor)foregroundColor;
}
Console.WriteLine(str);
ResetColor();
}
public static void StrWhiteBlack(string str)
{
Str(str, ConsoleColor.White, ConsoleColor.Black);
}
public static void Err(string err)
{
Str(err, ConsoleColor.DarkRed, ConsoleColor.White);
}
public static void Info(string str)
{
Str(str, ConsoleColor.Black, ConsoleColor.Green);
}
public static void Idle()
{
Str("Press any key to exit.");
Console.ReadKey();
}
private static void ResetColor()
{
Console.ResetColor();
}
}
}