Style Class
Represents color and text decoration.
public sealed class Style : IEquatable<Style>
- Namespace
- Spectre
.Console - Interfaces
-
- IEquatable
<Style>
- IEquatable
Constructors
-
Style
(Color?, Color?, Decoration?, string) -
Initializes a new instance of the
Style
class.
Properties
- Color Background
- Gets the background color.
- Decoration Decoration
- Gets the text decoration.
- Color Foreground
- Gets the foreground color.
- string Link
- Gets the link associated with the style.
Methods
-
Style Combine
(Style) - Combines this style with another one.
-
override bool Equals
(object) -
bool Equals
(Style) -
override int GetHashCode
() -
static Style Parse
(string) -
Converts the string representation of a style to its
Style
equivalent. -
string ToMarkup
() - Returns the markup representation of this style.
-
static bool TryParse
(string, Style) -
Converts the string representation of a style to its
Style
equivalent. A return value indicates whether the operation succeeded. -
static Style WithBackground
(Color) - Creates a new style from the specified background color.
-
static Style WithDecoration
(Decoration) - Creates a new style from the specified text decoration.
-
static Style WithForeground
(Color) - Creates a new style from the specified foreground color.
-
static Style WithLink
(string) - Creates a new style from the specified link.
Extension Methods
-
Style Background
(Color) - Creates a new style from the specified one with the specified background color.
-
Style Decoration
(Decoration) - Creates a new style from the specified one with the specified text decoration.
-
Style Foreground
(Color) - Creates a new style from the specified one with the specified foreground color.
-
Style Link
(string) - Creates a new style from the specified one with the specified link.