Add an implicit operator to convert from Color to Style (#1160)

This commit is contained in:
Cédric Luthi
2023-05-10 15:20:12 +02:00
committed by GitHub
parent 3ec0fee795
commit 6acf9b8c63
16 changed files with 95 additions and 73 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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.

View File

@ -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)

View File

@ -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.

View File

@ -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