Skip to content

Latest commit

 

History

History
161 lines (98 loc) · 7.2 KB

File metadata and controls

161 lines (98 loc) · 7.2 KB

ConsolePlus

StyleExtensions Class

Provides extension methods for creating modified Style instances by selectively changing foreground, background, or overflow strategy.

public static class StyleExtensions

Inheritance System.Object → StyleExtensions

Methods

StyleExtensions.Background(this Style, Color) Method

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);

Parameters

style Style

The original style.

color Color

The new background Color.

Returns

Style
A new Style with the updated background color.

StyleExtensions.Colors(this Style, Color) Method

Creates a style with an explicit foreground color and current background color.

public static ConsolePlusLibrary.Style Colors(this ConsolePlusLibrary.Style style, ConsolePlusLibrary.Color forecolor);

Parameters

style Style

The original style.

forecolor Color

The foreground Color.

Returns

Style
A new Style with the specified colors.

StyleExtensions.Colors(this Style, Color, Color) Method

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);

Parameters

style Style

The original style.

forecolor Color

The foreground Color.

backcolor Color

Optional background Color; if null, console background is used.

Returns

Style
A new Style with the specified colors.

StyleExtensions.ForeGround(this Style, Color) Method

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);

Parameters

style Style

The original style.

color Color

The new foreground Color.

Returns

Style
A new Style with the updated foreground color.

StyleExtensions.Overflow(this Style, Overflow) Method

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);

Parameters

style Style

The original style.

overflow Overflow

The new Overflow(this Style, Overflow) strategy.

Returns

Style
A new Style with the updated overflow strategy.