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
attrAttribute
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
foregroundstringForeground color as a string (name, hex, or rgb).
backgroundstringBackground color as a string (name, hex, or rgb).
stylestringOptional 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
foregroundstringForeground color as a string (name, hex, or rgb).
backgroundstringBackground color as a string (name, hex, or rgb).
styleTextStyleOptional 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
foreground16NameColorName16background16NameColorName16
Attribute(in ColorName16, in Color)
Initializes a new instance with foreground and background colors.
public Attribute(in ColorName16 foreground16Name, in Color background)
Parameters
foreground16NameColorName16backgroundColor
Attribute(in Color, in ColorName16)
Initializes a new instance with foreground and background colors.
public Attribute(in Color foreground, in ColorName16 background16Name)
Parameters
foregroundColorbackground16NameColorName16
Attribute(in StandardColor, in StandardColor)
Initializes a new instance with foreground and background colors.
public Attribute(in StandardColor foreground, in StandardColor background)
Parameters
foregroundStandardColorbackgroundStandardColor
Attribute(in StandardColor, in Color)
Initializes a new instance with foreground and background colors.
public Attribute(in StandardColor foreground, in Color background)
Parameters
foregroundStandardColorbackgroundColor
Attribute(in Color, in StandardColor)
Initializes a new instance with foreground and background colors.
public Attribute(in Color foreground, in StandardColor background)
Parameters
foregroundColorbackgroundStandardColor
Attribute(in Color)
Initializes an instance using a single color for both foreground and background.
public Attribute(in Color color)
Parameters
colorColor
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
foregroundStandardColorbackgroundStandardColorstyleTextStyle