/// <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)); }
/// <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)); }
/// <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"); }
/// <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"); }
/// <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)); }
/// <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); }
/// <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); }
/// <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"); }
/// <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"); }