-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathStrings.cs
84 lines (68 loc) · 3.19 KB
/
Strings.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
namespace Meep.Tech.Text {
/// <summary>
/// Extension methods for ANSI strings.
/// </summary>
public static class ANSIStringExtensions {
/// <inheritdoc cref="ANSI.AddColor(string, ANSI.Color, bool)"/>
public static string Color(this string text, ANSI.Color color)
=> ANSI.AddColor(text, color);
/// <inheritdoc cref="ANSI.AddColor(string, ANSI.RGB, bool)"/>
public static string Color(this string text, ANSI.RGB color)
=> ANSI.AddColor(text, color);
/// <inheritdoc cref="ANSI.AddBg(string, ANSI.Bg, bool)"/>
public static string Bg(this string text, ANSI.Bg bg)
=> ANSI.AddBg(text, bg);
/// <inheritdoc cref="ANSI.AddBg(string, ANSI.Color, bool)"/>
public static string Bg(this string text, ANSI.Color bg)
=> ANSI.AddBg(text, bg);
/// <inheritdoc cref="ANSI.AddBg(string, ANSI.RGB, bool)"/>
public static string Bg(this string text, ANSI.RGB bg)
=> ANSI.AddBg(text, bg);
/// <inheritdoc cref="ANSI.AddEffect(string, ANSI.Effect, bool)"/>
public static string Effect(this string text, ANSI.Effect effect)
=> ANSI.AddEffect(text, effect);
/// <inheritdoc cref="ANSI.Bold(string, bool)"/>
public static string Bold(this string text)
=> ANSI.Bold(text);
/// <inheritdoc cref="ANSI.Italic(string, bool)"/>
public static string Italic(this string text)
=> ANSI.Italic(text);
/// <inheritdoc cref="ANSI.Underline(string, bool)"/>
public static string Underline(this string text)
=> ANSI.Underline(text);
/// <inheritdoc cref="ANSI.Stylize(string, ANSI.Color?, ANSI.Bg?, ANSI.Effect?, bool)"/>
public static string Style(
this string text,
ANSI.Color? color = null!,
ANSI.Bg? bg = null!,
ANSI.Effect? effect = null!
) => ANSI.Stylize(text, color, bg, effect);
/// <inheritdoc cref="ANSI.Stylize(string, ANSI.Color?, ANSI.Bg?, ANSI.Effect?, bool)"/>
public static string Style(
this string text,
ANSI.RGB color,
ANSI.Bg? bg = null!,
ANSI.Effect? effect = null!
) => ANSI.Stylize(text, color, bg, effect);
/// <inheritdoc cref="ANSI.Stylize(string, ANSI.Color?, ANSI.Bg?, ANSI.Effect?, bool)"/>
public static string Style(
this string text,
ANSI.Color? color = null!,
ANSI.RGB? bg = null!,
ANSI.Effect? effect = null!
) => ANSI.Stylize(text, color, bg, effect);
/// <inheritdoc cref="ANSI.Stylize(string, ANSI.Color?, ANSI.Bg?, ANSI.Effect?, bool)"/>
public static string Style(
this string text,
ANSI.RGB? color,
ANSI.RGB? bg,
ANSI.Effect? effect = null!
) => ANSI.Stylize(text, color, bg, effect);
/// <inheritdoc cref="ANSI.Clear(string)"/>
public static string Strip(this string text)
=> ANSI.Clear(text);
/// <inheritdoc cref="ANSI.Reset(string)"/>
public static string Reset(this string text)
=> ANSI.Reset(text);
}
}