Struct Style
- Namespace
- MiniTui
- Assembly
- MiniTui.dll
A patch of cell attributes. Drawing with a style changes only what the style specifies: a null Fg or Bg keeps the cell's existing color.
public readonly record struct Style : IEquatable<Style>
- Implements
- Inherited Members
Constructors
Style(Color?, Color?, Modifiers, Modifiers)
A patch of cell attributes. Drawing with a style changes only what the style specifies: a null Fg or Bg keeps the cell's existing color.
public Style(Color? Fg = null, Color? Bg = null, Modifiers Add = Modifiers.None, Modifiers Remove = Modifiers.None)
Parameters
FgColor?Foreground color, or null to keep the existing one.
BgColor?Background color, or null to keep the existing one.
AddModifiersModifiers to turn on.
RemoveModifiersModifiers to turn off.
Properties
Add
Modifiers to turn on.
public Modifiers Add { get; init; }
Property Value
Bg
Background color, or null to keep the existing one.
public Color? Bg { get; init; }
Property Value
Default
A style that changes nothing.
public static Style Default { get; }
Property Value
Fg
Foreground color, or null to keep the existing one.
public Color? Fg { get; init; }
Property Value
Remove
Modifiers to turn off.
public Modifiers Remove { get; init; }
Property Value
Methods
Bold()
Returns this style with Bold added.
public Style Bold()
Returns
CrossedOut()
Returns this style with CrossedOut added.
public Style CrossedOut()
Returns
Dim()
Returns this style with Dim added.
public Style Dim()
Returns
Italic()
Returns this style with Italic added.
public Style Italic()
Returns
Patch(Style)
Combine two styles. other's non-null colors win, and its modifiers
are applied on top of this style's.
public Style Patch(Style other)
Parameters
otherStyle
Returns
Reversed()
Returns this style with Reversed added.
public Style Reversed()
Returns
Underlined()
Returns this style with Underlined added.
public Style Underlined()
Returns
WithBg(Color)
Returns this style with the given background color.
public Style WithBg(Color c)
Parameters
cColor
Returns
WithFg(Color)
Returns this style with the given foreground color.
public Style WithFg(Color c)
Parameters
cColor