Ejemplo n.º 1
0
 /// <summary>Gets the ANSI sequence to set the background to the specified color.</summary>
 /// <param name="backgroundColor">Which background color to set.</param>
 /// <returns>The ANSI sequence to set the background to the specified color.</returns>
 public static string SetBackgroundColor(AnsiBackgroundColor backgroundColor)
 {
     return(Esc + string.Format("[{0}m", (int)backgroundColor));
 }
Ejemplo n.º 2
0
 /// <summary>Gets the ANSI sequence to set the text foreground and background colors.</summary>
 /// <param name="foregroundColor">Which foreground color to set.</param>
 /// <param name="backgroundColor">Which background color to set.</param>
 /// <returns>The ANSI sequence to set the text foreground and background colors.</returns>
 public static string SetTextAttributes(AnsiForegroundColor foregroundColor, AnsiBackgroundColor backgroundColor)
 {
     return(Esc + string.Format("[{0};{1}m", (int)foregroundColor, (int)backgroundColor));
 }
Ejemplo n.º 3
0
 /// <summary>Gets the ANSI sequence to set the background to the specified color.</summary>
 /// <param name="backgroundColor">Which background color to set.</param>
 /// <returns>The ANSI sequence to set the background to the specified color.</returns>
 public static string SetBackgroundColor(AnsiBackgroundColor backgroundColor)
 {
     return($"{ESC}[{(int)backgroundColor}m");
 }
Ejemplo n.º 4
0
 /// <summary>Gets the ANSI sequence to set the text foreground and background colors.</summary>
 /// <param name="foregroundColor">Which foreground color to set.</param>
 /// <param name="backgroundColor">Which background color to set.</param>
 /// <returns>The ANSI sequence to set the text foreground and background colors.</returns>
 public static string SetTextAttributes(AnsiForegroundColor foregroundColor, AnsiBackgroundColor backgroundColor)
 {
     return($"{ESC}[{(int)foregroundColor};{(int)backgroundColor}m");
 }
Ejemplo n.º 5
0
 /// <summary>Gets the ANSI sequence to set all of the attribute, foreground, and background colors.</summary>
 /// <param name="attribute">Which attribute to set.</param>
 /// <param name="foregroundColor">Which foreground color to set.</param>
 /// <param name="backgroundColor">Which background color to set.</param>
 /// <returns>The ANSI sequence to set all of the attribute, foreground, and background colors.</returns>
 public static string SetTextAttributes(AnsiTextAttribute attribute, AnsiForegroundColor foregroundColor, AnsiBackgroundColor backgroundColor)
 {
     return(AnsiSequences.Esc + string.Format("[{0};{1};{2}m", (int)attribute, (int)foregroundColor, (int)backgroundColor));
 }
Ejemplo n.º 6
0
 /// <summary>Gets the ANSI sequence to set the text foreground and background colors.</summary>
 /// <param name="foregroundColor">Which foreground color to set.</param>
 /// <param name="backgroundColor">Which background color to set.</param>
 /// <returns>The ANSI sequence to set the text foreground and background colors.</returns>
 public static string SetTextAttributes(AnsiForegroundColor foregroundColor, AnsiBackgroundColor backgroundColor)
 {
     return Esc + string.Format("[{0};{1}m", (int)foregroundColor, (int)backgroundColor);
 }
Ejemplo n.º 7
0
 /// <summary>Gets the ANSI sequence to set the background to the specified color.</summary>
 /// <param name="backgroundColor">Which background color to set.</param>
 /// <returns>The ANSI sequence to set the background to the specified color.</returns>
 public static string SetBackgroundColor(AnsiBackgroundColor backgroundColor)
 {
     return Esc + string.Format("[{0}m", (int)backgroundColor);
 }
Ejemplo n.º 8
0
 /// <summary>Gets the ANSI sequence to set the background to the specified color.</summary>
 /// <param name="backgroundColor">Which background color to set.</param>
 /// <returns>The ANSI sequence to set the background to the specified color.</returns>
 public static string SetBackgroundColor(AnsiBackgroundColor backgroundColor)
 {
     return(AnsiSequences.Esc + $"[{(int) backgroundColor}m");
 }
Ejemplo n.º 9
0
 /// <summary>Gets the ANSI sequence to set the text foreground and background colors.</summary>
 /// <param name="foregroundColor">Which foreground color to set.</param>
 /// <param name="backgroundColor">Which background color to set.</param>
 /// <returns>The ANSI sequence to set the text foreground and background colors.</returns>
 public static string SetTextAttributes(AnsiForegroundColor foregroundColor, AnsiBackgroundColor backgroundColor)
 {
     return(AnsiSequences.Esc + $"[{(int) foregroundColor};{(int) backgroundColor}m");
 }