Repository: spectreconsole/spectre.console

Issue:
Grey hard-coded in BreakdownTags
**Information**
 - OS: Windows
 - Version: 0.43.0
 - Terminal: cmd.exe

**Describe the bug**

I noticed that there is a hard-coded `grey` color inside the breakdown chart tag format: https://github.com/spectreconsole/spectre.console/blob/main/src/Spectre.Console/Widgets/Charts/BreakdownTags.cs#L58

It can be difficult to see on light backgrounds:
![image](https://user-images.githubusercontent.com/578591/148657072-9c257118-ef59-42d4-afff-e99333bdbd83.png)


**To Reproduce**
Display a breakdown chart on a light or grey background.

**Expected behavior**
I'd expect this value to either be not colored by default or be configurable.

However, I'm guessing now there would be a back-compat concern around changing it, so perhaps the fix is to keep grey the default but expose a way to configure it with a new field on `IBreakdownChartItem`.

**Screenshots**
See above

**Additional context**
I'm working on incorporating Spectre.Console into Maoni's realmon tool at https://github.com/Maoni0/realmon/pull/39 and ran into this issue while coming up with a light color theme.

Happy to contribute a fix here if there is an acceptable resolution! Thanks for this wonderful library.



Hints:

Patch:
diff --git a/examples/Console/Charts/Program.cs b/examples/Console/Charts/Program.cs
index b107f6b24..5aadfa8a0 100644
--- a/examples/Console/Charts/Program.cs
+++ b/examples/Console/Charts/Program.cs
@@ -23,6 +23,7 @@ public static void Main()
             .FullSize()
             .Width(60)
             .ShowPercentage()
+            .WithValueColor(Color.Orange1)
             .AddItem("SCSS", 37, Color.Red)
             .AddItem("HTML", 28.3, Color.Blue)
             .AddItem("C#", 22.6, Color.Green)
diff --git a/src/Spectre.Console/Extensions/BreakdownChartExtensions.cs b/src/Spectre.Console/Extensions/BreakdownChartExtensions.cs
index 5ace7a969..ed3610f49 100644
--- a/src/Spectre.Console/Extensions/BreakdownChartExtensions.cs
+++ b/src/Spectre.Console/Extensions/BreakdownChartExtensions.cs
@@ -297,4 +297,21 @@ public static BreakdownChart Compact(this BreakdownChart chart, bool compact)
         chart.Compact = compact;
         return chart;
     }
+
+    /// <summary>
+    /// Sets the <see cref="BreakdownChart.ValueColor"/>.
+    /// </summary>
+    /// <param name="chart">The breakdown chart.</param>
+    /// <param name="color">The <see cref="Color"/> to set.</param>
+    /// <returns>The same instance so that multiple calls can be chained.</returns>
+    public static BreakdownChart WithValueColor(this BreakdownChart chart, Color color)
+    {
+        if (chart is null)
+        {
+            throw new ArgumentNullException(nameof(chart));
+        }
+
+        chart.ValueColor = color;
+        return chart;
+    }
 }
\ No newline at end of file
diff --git a/src/Spectre.Console/Widgets/Charts/BreakdownChart.cs b/src/Spectre.Console/Widgets/Charts/BreakdownChart.cs
index 85067c904..7ed9ce824 100644
--- a/src/Spectre.Console/Widgets/Charts/BreakdownChart.cs
+++ b/src/Spectre.Console/Widgets/Charts/BreakdownChart.cs
@@ -30,6 +30,11 @@ public sealed class BreakdownChart : Renderable, IHasCulture, IExpandable
     /// </summary>
     public Func<double, CultureInfo, string>? ValueFormatter { get; set; }
 
+    /// <summary>
+    /// Gets or sets the Color in which the values will be shown.
+    /// </summary>
+    public Color ValueColor { get; set; } = Color.Grey;
+
     /// <summary>
     /// Gets or sets a value indicating whether or not the
     /// chart and tags should be rendered in compact mode.
@@ -94,6 +99,7 @@ protected override IEnumerable<Segment> Render(RenderOptions options, int maxWid
                 Culture = Culture,
                 ShowTagValues = ShowTagValues,
                 ValueFormatter = ValueFormatter,
+                ValueColor = ValueColor,
             });
         }
 
diff --git a/src/Spectre.Console/Widgets/Charts/BreakdownTags.cs b/src/Spectre.Console/Widgets/Charts/BreakdownTags.cs
index a74734555..67a49092d 100644
--- a/src/Spectre.Console/Widgets/Charts/BreakdownTags.cs
+++ b/src/Spectre.Console/Widgets/Charts/BreakdownTags.cs
@@ -8,6 +8,7 @@ internal sealed class BreakdownTags : Renderable
     public CultureInfo? Culture { get; set; }
     public bool ShowTagValues { get; set; } = true;
     public Func<double, CultureInfo, string>? ValueFormatter { get; set; }
+    public Color ValueColor { get; set; } = Color.Grey;
 
     public BreakdownTags(List<IBreakdownChartItem> data)
     {
@@ -55,8 +56,9 @@ private string FormatValue(IBreakdownChartItem item, CultureInfo culture)
 
         if (ShowTagValues)
         {
-            return string.Format(culture, "{0} [grey]{1}[/]",
+            return string.Format(culture, "{0} [{1}]{2}[/]",
                 item.Label.EscapeMarkup(),
+                ValueColor.ToMarkup(),
                 formatter(item.Value, culture));
         }
 


Test patch:
diff --git a/test/Spectre.Console.Tests/Expectations/Widgets/BreakdownChart/ValueColor.Output.verified.txt b/test/Spectre.Console.Tests/Expectations/Widgets/BreakdownChart/ValueColor.Output.verified.txt
new file mode 100644
index 000000000..5b95b8b27
--- /dev/null
+++ b/test/Spectre.Console.Tests/Expectations/Widgets/BreakdownChart/ValueColor.Output.verified.txt
@@ -0,0 +1,3 @@
+﻿[38;5;9m████████████████████████[0m[38;5;12m█████████████████[0m[38;5;2m█████████████[0m[38;5;11m███[0m[38;5;119m███[0m
+[38;5;9m■[0m SCSS [38;5;9m37[0m    [38;5;12m■[0m HTML [38;5;9m28.3[0m     [38;5;2m■[0m C# [38;5;9m22.6[0m    [38;5;11m■[0m JavaScript [38;5;9m6[0m    
+[38;5;119m■[0m Ruby [38;5;9m6[0m     [38;5;14m■[0m Shell [38;5;9m0.1[0m                                    
diff --git a/test/Spectre.Console.Tests/Unit/Widgets/BreakdownChartTests.cs b/test/Spectre.Console.Tests/Unit/Widgets/BreakdownChartTests.cs
index ab92efb4c..4fdc7d1ff 100644
--- a/test/Spectre.Console.Tests/Unit/Widgets/BreakdownChartTests.cs
+++ b/test/Spectre.Console.Tests/Unit/Widgets/BreakdownChartTests.cs
@@ -127,6 +127,21 @@ public async Task Should_Render_Correct_Ansi()
         await Verifier.Verify(console.Output);
     }
 
+    [Fact]
+    [Expectation("ValueColor")]
+    public async Task Should_Render_Correct_ValueColor()
+    {
+        // Given
+        var console = new TestConsole().EmitAnsiSequences();
+        var chart = Fixture.GetChart().Width(60).WithValueColor(Color.Red);
+
+        // When
+        console.Write(chart);
+
+        // Then
+        await Verifier.Verify(console.Output);
+    }
+
     public static class Fixture
     {
         public static BreakdownChart GetChart()