namespace Spectre.Console; /// /// A console capable of writing ANSI escape sequences. /// public static partial class AnsiConsole { internal static Style CurrentStyle { get; private set; } = Style.Plain; internal static bool Created { get; private set; } /// /// Gets or sets the foreground color. /// public static Color Foreground { get => CurrentStyle.Foreground; set => CurrentStyle = CurrentStyle.Foreground(value); } /// /// Gets or sets the background color. /// public static Color Background { get => CurrentStyle.Background; set => CurrentStyle = CurrentStyle.Background(value); } /// /// Gets or sets the text decoration. /// public static Decoration Decoration { get => CurrentStyle.Decoration; set => CurrentStyle = CurrentStyle.Decoration(value); } /// /// Resets colors and text decorations. /// public static void Reset() { ResetColors(); ResetDecoration(); } /// /// Resets the current applied text decorations. /// public static void ResetDecoration() { Decoration = Decoration.None; } /// /// Resets the current applied foreground and background colors. /// public static void ResetColors() { CurrentStyle = Style.Plain; } }