mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-12-27 03:15:48 +08:00
Restructure solution a bit
This commit is contained in:
@@ -7,7 +7,7 @@ namespace Spectre.Console
|
||||
/// <summary>
|
||||
/// Represents color and text decoration.
|
||||
/// </summary>
|
||||
public sealed partial class Style : IEquatable<Style>
|
||||
public sealed class Style : IEquatable<Style>
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the foreground color.
|
||||
@@ -48,6 +48,36 @@ namespace Spectre.Console
|
||||
Decoration = decoration ?? Decoration.None;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new style from the specified foreground color.
|
||||
/// </summary>
|
||||
/// <param name="color">The foreground color.</param>
|
||||
/// <returns>A new <see cref="Style"/> with the specified foreground color.</returns>
|
||||
public static Style WithForeground(Color color)
|
||||
{
|
||||
return new Style(foreground: color);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new style from the specified background color.
|
||||
/// </summary>
|
||||
/// <param name="color">The background color.</param>
|
||||
/// <returns>A new <see cref="Style"/> with the specified background color.</returns>
|
||||
public static Style WithBackground(Color color)
|
||||
{
|
||||
return new Style(background: color);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new style from the specified text decoration.
|
||||
/// </summary>
|
||||
/// <param name="decoration">The text decoration.</param>
|
||||
/// <returns>A new <see cref="Style"/> with the specified text decoration.</returns>
|
||||
public static Style WithDecoration(Decoration decoration)
|
||||
{
|
||||
return new Style(decoration: decoration);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a copy of the current <see cref="Style"/>.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user