示例#1
0
 /// <summary>Gets the ANSI sequence to set all of the attribute, forground, 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, forground, and background colors.</returns>
 public static string SetTextAttributes(AnsiAttribute attribute, AnsiForegroundColor foregroundColor, AnsiBackgroundColor backgroundColor)
 {
     return(Esc + string.Format(
                "[{0};{1};{2}m",
                (int)attribute,
                (int)foregroundColor,
                (int)backgroundColor));
 }
 private static string GetSequence(AnsiForegroundColor color, int bright)
 {
     return(string.Format("{0}[{2}m{0}[{1}m", Esc, (int)color, bright));
 }
示例#3
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");
 }
示例#4
0
 /// <summary>Gets the ANSI sequence to set the foreground to the specified color.</summary>
 /// <param name="foregroundColor">Which foreground color to set.</param>
 /// <returns>The ANSI sequence to set the foreground to the specified color.</returns>
 public static string SetForegroundColor(AnsiForegroundColor foregroundColor)
 {
     return(Esc + string.Format("[{0}m", (int)foregroundColor));
 }
示例#5
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 + string.Format("[{0};{1}m", (int)foregroundColor, (int)backgroundColor));
 }
示例#6
0
 /// <summary>Gets the ANSI sequence to set the foreground to the specified color.</summary>
 /// <param name="foregroundColor">Which foreground color to set.</param>
 /// <returns>The ANSI sequence to set the foreground to the specified color.</returns>
 public static string SetForegroundColor(AnsiForegroundColor foregroundColor)
 {
     return($"{ESC}[{(int)foregroundColor}m");
 }
 private static string GetSequence(AnsiForegroundColor color, int bright)
 {
     return string.Format("{0}[{2}m{0}[{1}m", ESC, (int)color, bright);
 }
示例#8
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);
 }
示例#9
0
 /// <summary>Gets the ANSI sequence to set the foreground to the specified color.</summary>
 /// <param name="foregroundColor">Which foreground color to set.</param>
 /// <returns>The ANSI sequence to set the foreground to the specified color.</returns>
 public static string SetForegroundColor(AnsiForegroundColor foregroundColor)
 {
     return Esc + string.Format("[{0}m", (int)foregroundColor);
 }
示例#10
0
 /// <summary>Gets the ANSI sequence to set the foreground to the specified color.</summary>
 /// <param name="foregroundColor">Which foreground color to set.</param>
 /// <returns>The ANSI sequence to set the foreground to the specified color.</returns>
 public static string SetForegroundColor(AnsiForegroundColor foregroundColor)
 {
     return(AnsiSequences.Esc + $"[{(int) foregroundColor}m");
 }
示例#11
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");
 }