Table of Contents

Constructor Attribute

Namespace
Terminal.Gui.Drawing
Assembly
Terminal.Gui.dll

Attribute()

Initializes a new instance of the Attribute struct with default values.

public Attribute()

Attribute(in Attribute)

Initializes a new Attribute from an existing instance, preserving explicit state.

public Attribute(in Attribute attr)

Parameters

attr Attribute

Attribute(in Color, in Color)

Initializes an instance using two named colors.

public Attribute(in Color foreground, in Color background)

Parameters

foreground Color
background Color

Attribute(in Color, in Color, in TextStyle)

Initializes a new instance with foreground, background, and TextStyle.

public Attribute(in Color foreground, in Color background, in TextStyle style)

Parameters

foreground Color
background Color
style TextStyle

Attribute(in string, in string, in string?)

Initializes a new instance of the Attribute struct from string representations of colors and style.

public Attribute(in string foreground, in string background, in string? style = null)

Parameters

foreground string

Foreground color as a string (name, hex, or rgb).

background string

Background color as a string (name, hex, or rgb).

style string

Optional style as a string (e.g., "Bold,Underline").

Exceptions

ArgumentException

Thrown if color parsing fails.

Attribute(in string, in string, in TextStyle)

Initializes a new instance of the Attribute struct from string representations of colors and style.

public Attribute(in string foreground, in string background, in TextStyle style)

Parameters

foreground string

Foreground color as a string (name, hex, or rgb).

background string

Background color as a string (name, hex, or rgb).

style TextStyle

Optional style as a string (e.g., "Bold,Underline").

Exceptions

ArgumentException

Thrown if color parsing fails.

Attribute(in ColorName16, in ColorName16)

Initializes a new instance with foreground and background colors.

public Attribute(in ColorName16 foreground16Name, in ColorName16 background16Name)

Parameters

foreground16Name ColorName16
background16Name ColorName16

Attribute(in ColorName16, in Color)

Initializes a new instance with foreground and background colors.

public Attribute(in ColorName16 foreground16Name, in Color background)

Parameters

foreground16Name ColorName16
background Color

Attribute(in Color, in ColorName16)

Initializes a new instance with foreground and background colors.

public Attribute(in Color foreground, in ColorName16 background16Name)

Parameters

foreground Color
background16Name ColorName16

Attribute(in StandardColor, in StandardColor)

Initializes a new instance with foreground and background colors.

public Attribute(in StandardColor foreground, in StandardColor background)

Parameters

foreground StandardColor
background StandardColor

Attribute(in StandardColor, in Color)

Initializes a new instance with foreground and background colors.

public Attribute(in StandardColor foreground, in Color background)

Parameters

foreground StandardColor
background Color

Attribute(in Color, in StandardColor)

Initializes a new instance with foreground and background colors.

public Attribute(in Color foreground, in StandardColor background)

Parameters

foreground Color
background StandardColor

Attribute(in Color)

Initializes an instance using a single color for both foreground and background.

public Attribute(in Color color)

Parameters

color Color

Attribute(in StandardColor, in StandardColor, in TextStyle)

Initializes a new instance with foreground and background colors and a TextStyle.

public Attribute(in StandardColor foreground, in StandardColor background, in TextStyle style)

Parameters

foreground StandardColor
background StandardColor
style TextStyle