mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-06-19 21:38:16 +08:00
Add an implicit operator to convert from Color to Style (#1160)
This commit is contained in:
@ -11,7 +11,7 @@ public sealed class ElapsedTimeColumn : ProgressColumn
|
||||
/// <summary>
|
||||
/// Gets or sets the style of the remaining time text.
|
||||
/// </summary>
|
||||
public Style Style { get; set; } = new Style(foreground: Color.Blue);
|
||||
public Style Style { get; set; } = Color.Blue;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override IRenderable Render(RenderOptions options, ProgressTask task, TimeSpan deltaTime)
|
||||
|
@ -13,7 +13,7 @@ public sealed class PercentageColumn : ProgressColumn
|
||||
/// <summary>
|
||||
/// Gets or sets the style for a completed task.
|
||||
/// </summary>
|
||||
public Style CompletedStyle { get; set; } = new Style(foreground: Color.Green);
|
||||
public Style CompletedStyle { get; set; } = Color.Green;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override IRenderable Render(RenderOptions options, ProgressTask task, TimeSpan deltaTime)
|
||||
|
@ -13,17 +13,17 @@ public sealed class ProgressBarColumn : ProgressColumn
|
||||
/// <summary>
|
||||
/// Gets or sets the style of completed portions of the progress bar.
|
||||
/// </summary>
|
||||
public Style CompletedStyle { get; set; } = new Style(foreground: Color.Yellow);
|
||||
public Style CompletedStyle { get; set; } = Color.Yellow;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the style of a finished progress bar.
|
||||
/// </summary>
|
||||
public Style FinishedStyle { get; set; } = new Style(foreground: Color.Green);
|
||||
public Style FinishedStyle { get; set; } = Color.Green;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the style of remaining portions of the progress bar.
|
||||
/// </summary>
|
||||
public Style RemainingStyle { get; set; } = new Style(foreground: Color.Grey);
|
||||
public Style RemainingStyle { get; set; } = Color.Grey;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the style of an indeterminate progress bar.
|
||||
|
@ -11,7 +11,7 @@ public sealed class RemainingTimeColumn : ProgressColumn
|
||||
/// <summary>
|
||||
/// Gets or sets the style of the remaining time text.
|
||||
/// </summary>
|
||||
public Style Style { get; set; } = new Style(foreground: Color.Blue);
|
||||
public Style Style { get; set; } = Color.Blue;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override IRenderable Render(RenderOptions options, ProgressTask task, TimeSpan deltaTime)
|
||||
|
@ -74,7 +74,7 @@ public sealed class SpinnerColumn : ProgressColumn
|
||||
/// <summary>
|
||||
/// Gets or sets the style of the spinner.
|
||||
/// </summary>
|
||||
public Style? Style { get; set; } = new Style(foreground: Color.Yellow);
|
||||
public Style? Style { get; set; } = Color.Yellow;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SpinnerColumn"/> class.
|
||||
|
@ -15,7 +15,7 @@ public sealed class Status
|
||||
/// <summary>
|
||||
/// Gets or sets the spinner style.
|
||||
/// </summary>
|
||||
public Style? SpinnerStyle { get; set; } = new Style(foreground: Color.Yellow);
|
||||
public Style? SpinnerStyle { get; set; } = Color.Yellow;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether or not status
|
||||
|
Reference in New Issue
Block a user