Struct Attribute
Attributes represent how text is styled when displayed in the terminal.
[JsonConverter(typeof(AttributeJsonConverter))]
public readonly record struct Attribute : IEqualityOperators<Attribute, Attribute, bool>, IEquatable<Attribute>
- Implements
- Inherited Members
Remarks
Attribute provides a platform independent representation of colors (and someday other forms of text styling). They encode both the foreground and the background color and are used in the ColorScheme class to define color schemes that can be used in an application.
Constructors
- Attribute()
Initializes a new instance with default values.
- Attribute(in Attribute)
Initializes a new instance from an existing instance.
- Attribute(in Color)
Initializes a new instance of the Attribute struct with the same colors for the foreground and background.
- Attribute(in Color, in Color)
Initializes a new instance of the Attribute struct.
- Attribute(in Color, in ColorName16)
Initializes a new instance of the Attribute struct.
- Attribute(in ColorName16, in Color)
Initializes a new instance of the Attribute struct.
- Attribute(in ColorName16, in ColorName16)
Initializes a new instance of the Attribute struct.
Properties
- Background
The background color.
- Default
Default empty attribute.
- Foreground
The foreground color.
Methods
- GetHashCode()
Returns the hash code for this instance.
- ToString()
Returns the fully qualified type name of this instance.