diff --git a/ChartJs.Blazor.Samples/Shared/SampleUtils.cs b/ChartJs.Blazor.Samples/Shared/SampleUtils.cs index d7bcd411..af590c88 100644 --- a/ChartJs.Blazor.Samples/Shared/SampleUtils.cs +++ b/ChartJs.Blazor.Samples/Shared/SampleUtils.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; +using System.Drawing; using System.Text; namespace ChartJs.Blazor.Samples.Shared @@ -12,18 +13,20 @@ public static class SampleUtils public static class ChartColors { - public static IReadOnlyList All { get; } = new string[7] + private static readonly Lazy> _all = new Lazy>(() => new Color[7] { Red, Orange, Yellow, Green, Blue, Purple, Grey - }; - - public const string Red = "rgb(255, 99, 132)"; - public const string Orange = "rgb(255, 159, 64)"; - public const string Yellow = "rgb(255, 205, 86)"; - public const string Green = "rgb(75, 192, 192)"; - public const string Blue = "rgb(54, 162, 235)"; - public const string Purple = "rgb(153, 102, 255)"; - public const string Grey = "rgb(201, 203, 207"; + }); + + public static IReadOnlyList All => _all.Value; + + public static readonly Color Red = Color.FromArgb(255, 99, 132); + public static readonly Color Orange = Color.FromArgb(255, 159, 64); + public static readonly Color Yellow = Color.FromArgb(255, 205, 86); + public static readonly Color Green = Color.FromArgb(75, 192, 192); + public static readonly Color Blue = Color.FromArgb(54, 162, 235); + public static readonly Color Purple = Color.FromArgb(153, 102, 255); + public static readonly Color Grey = Color.FromArgb(201, 203, 207); } public static IReadOnlyList Months { get; } = new ReadOnlyCollection(new[]