Provides extension methods for creating modified Style instances by selectively changing foreground, background, or overflow strategy.
public static class StyleExtensionsInheritance System.Object → StyleExtensions
Creates a new Style based on style with a replaced background color. Foreground color and overflow strategy are preserved.
public static ConsolePlusLibrary.Style Background(this ConsolePlusLibrary.Style style, ConsolePlusLibrary.Color color);style Style
The original style.
color Color
The new background Color.
Style
A new Style with the updated background color.
Creates a style with an explicit foreground color and current background color.
public static ConsolePlusLibrary.Style Colors(this ConsolePlusLibrary.Style style, ConsolePlusLibrary.Color forecolor);style Style
The original style.
forecolor Color
The foreground Color.
Style
A new Style with the specified colors.
Creates a style with an explicit foreground color and an optional background color. If no background color is provided, the current console background color is used.
public static ConsolePlusLibrary.Style Colors(this ConsolePlusLibrary.Style style, ConsolePlusLibrary.Color forecolor, ConsolePlusLibrary.Color backcolor);style Style
The original style.
forecolor Color
The foreground Color.
backcolor Color
Optional background Color; if null, console background is used.
Style
A new Style with the specified colors.
Creates a new Style based on style with a replaced foreground color. Background and overflow strategy are preserved.
public static ConsolePlusLibrary.Style ForeGround(this ConsolePlusLibrary.Style style, ConsolePlusLibrary.Color color);style Style
The original style.
color Color
The new foreground Color.
Style
A new Style with the updated foreground color.
Creates a new Style based on style with a replaced overflow strategy. Foreground and background colors are preserved.
public static ConsolePlusLibrary.Style Overflow(this ConsolePlusLibrary.Style style, ConsolePlusLibrary.Overflow overflow);style Style
The original style.
overflow Overflow
The new Overflow(this Style, Overflow) strategy.