Constructor Attribute
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
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
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
stringForeground color as a string (name, hex, or rgb).
background
stringBackground color as a string (name, hex, or rgb).
style
stringOptional 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
stringForeground color as a string (name, hex, or rgb).
background
stringBackground color as a string (name, hex, or rgb).
style
TextStyleOptional 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
ColorName16background16Name
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
ColorName16background
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
Colorbackground16Name
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
StandardColorbackground
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
StandardColorbackground
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
Colorbackground
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
StandardColorbackground
StandardColorstyle
TextStyle