Skip to the content.

PromptPlus API:StyleExtensions

Build Publish License NuGet Downloads

Back to List Api

StyleExtensions

Namespace: PPlus

Contains extension methods for Style.

public static class StyleExtensions

Inheritance ObjectStyleExtensions

Methods

Background(Style, Color)

Create a new style from the specified one with the specified background color.

public static Style Background(Style style, Color color)

Parameters

style Style
The style.

color Color
The background color.

Returns

The new Style

Foreground(Style, Color)

Create a new style from the specified one with the specified foreground color.

public static Style Foreground(Style style, Color color)

Parameters

style Style
The style.

color Color
The foreground color.

Returns

The new Style

Overflow(Style, Overflow)

Create a new style from the specified one with the specified overfow strategy

public static Style Overflow(Style style, Overflow overflow)

Parameters

style Style
The style.

overflow Overflow
The Overflow overflow strategy

Returns

The new Style

ToStyle(Color)

Convert Color to Style with default background color

public static Style ToStyle(Color color)

Parameters

color Color
The StyleExtensions.Overflow(Style, Overflow)

Returns

Style


Back to List Api