Exemple #1
0
 /// <summary>Gets the ANSI sequence to set the text attribute.</summary>
 /// <param name="attribute">Which attribute to set.</param>
 /// <returns>The ANSI sequence to set the text attribute.</returns>
 public static string SetTextAttributes(AnsiTextAttribute attribute)
 {
     return(AnsiSequences.Esc + string.Format("[{0}m", (int)attribute));
 }
Exemple #2
0
 /// <summary>Gets the ANSI sequence to set the text attribute.</summary>
 /// <param name="attribute">Which attribute to set.</param>
 /// <returns>The ANSI sequence to set the text attribute.</returns>
 public static string SetTextAttributes(AnsiTextAttribute attribute)
 {
     return(AnsiSequences.Esc + $"[{(int) attribute}m");
 }
Exemple #3
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));
 }
Exemple #4
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 + $"[{(int) attribute};{(int) foregroundColor};{(int) backgroundColor}m");
 }