From 5267ebda49071c2e93f806a44522c7f6daad448a Mon Sep 17 00:00:00 2001 From: Patrik Svensson Date: Mon, 3 Aug 2020 11:12:16 +0200 Subject: [PATCH] Get color names from lookup table Also adds tests for Color struct and fixes a bug that had to do with equality. --- src/Spectre.Console.Tests/Unit/ColorTests.cs | 240 ++++++++ src/Spectre.Console/Color.Known.cs | 515 +++++++++--------- src/Spectre.Console/Color.cs | 55 +- .../Internal/Colors/ColorTable.cs | 120 ++++ .../Internal/{Lookup.cs => StyleTable.cs} | 26 +- .../Internal/Text/Markup/MarkupStyleParser.cs | 4 +- 6 files changed, 660 insertions(+), 300 deletions(-) create mode 100644 src/Spectre.Console.Tests/Unit/ColorTests.cs create mode 100644 src/Spectre.Console/Internal/Colors/ColorTable.cs rename src/Spectre.Console/Internal/{Lookup.cs => StyleTable.cs} (51%) diff --git a/src/Spectre.Console.Tests/Unit/ColorTests.cs b/src/Spectre.Console.Tests/Unit/ColorTests.cs new file mode 100644 index 0000000..83c2ba1 --- /dev/null +++ b/src/Spectre.Console.Tests/Unit/ColorTests.cs @@ -0,0 +1,240 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using Shouldly; +using Xunit; + +namespace Spectre.Console.Tests.Unit +{ + public sealed class ColorTests + { + public sealed class TheEqualsMethod + { + [Fact] + public void Should_Consider_Color_And_Non_Color_Equal() + { + // Given + var color1 = new Color(128, 0, 128); + + // When + var result = color1.Equals("Foo"); + + // Then + result.ShouldBeFalse(); + } + + [Fact] + public void Should_Consider_Same_Colors_Equal_By_Component() + { + // Given + var color1 = new Color(128, 0, 128); + var color2 = new Color(128, 0, 128); + + // When + var result = color1.Equals(color2); + + // Then + result.ShouldBeTrue(); + } + + [Fact] + public void Should_Consider_Same_Known_Colors_Equal() + { + // Given + var color1 = Color.Cyan1; + var color2 = Color.Cyan1; + + // When + var result = color1.Equals(color2); + + // Then + result.ShouldBeTrue(); + } + + [Fact] + public void Should_Consider_Known_Color_And_Color_With_Same_Components_Equal() + { + // Given + var color1 = Color.Cyan1; + var color2 = new Color(0, 255, 255); + + // When + var result = color1.Equals(color2); + + // Then + result.ShouldBeTrue(); + } + + [Fact] + public void Should_Not_Consider_Different_Colors_Equal() + { + // Given + var color1 = new Color(128, 0, 128); + var color2 = new Color(128, 128, 128); + + // When + var result = color1.Equals(color2); + + // Then + result.ShouldBeFalse(); + } + } + + public sealed class TheGetHashCodeMethod + { + [Fact] + public void Should_Return_Same_HashCode_For_Same_Colors() + { + // Given + var color1 = new Color(128, 0, 128); + var color2 = new Color(128, 0, 128); + + // When + var hash1 = color1.GetHashCode(); + var hash2 = color2.GetHashCode(); + + // Then + hash1.ShouldBe(hash2); + } + + [Fact] + public void Should_Return_Different_HashCode_For_Different_Colors() + { + // Given + var color1 = new Color(128, 0, 128); + var color2 = new Color(128, 128, 128); + + // When + var hash1 = color1.GetHashCode(); + var hash2 = color2.GetHashCode(); + + // Then + hash1.ShouldNotBe(hash2); + } + } + + public sealed class ImplicitConversions + { + public sealed class Int32ToColor + { + public static IEnumerable Data => + Enumerable.Range(0, 255) + .Select(number => new object[] { number }); + + [Theory] + [MemberData(nameof(Data))] + public void Should_Return_Expected_Color(int number) + { + // Given, When + var result = (Color)number; + + // Then + result.ShouldBe(Color.FromInt32(number)); + } + + [Fact] + public void Should_Throw_If_Integer_Is_Lower_Than_Zero() + { + // Given, When + var result = Record.Exception(() => (Color)(-1)); + + // Then + result.ShouldBeOfType(); + result.Message.ShouldBe("Color number must be between 0 and 255"); + } + + [Fact] + public void Should_Throw_If_Integer_Is_Higher_Than_255() + { + // Given, When + var result = Record.Exception(() => (Color)256); + + // Then + result.ShouldBeOfType(); + result.Message.ShouldBe("Color number must be between 0 and 255"); + } + } + + public sealed class ConsoleColorToColor + { + [Theory] + [InlineData(ConsoleColor.Black, 0)] + [InlineData(ConsoleColor.DarkRed, 1)] + [InlineData(ConsoleColor.DarkGreen, 2)] + [InlineData(ConsoleColor.DarkYellow, 3)] + [InlineData(ConsoleColor.DarkBlue, 4)] + [InlineData(ConsoleColor.DarkMagenta, 5)] + [InlineData(ConsoleColor.DarkCyan, 6)] + [InlineData(ConsoleColor.Gray, 7)] + [InlineData(ConsoleColor.DarkGray, 8)] + [InlineData(ConsoleColor.Red, 9)] + [InlineData(ConsoleColor.Green, 10)] + [InlineData(ConsoleColor.Yellow, 11)] + [InlineData(ConsoleColor.Blue, 12)] + [InlineData(ConsoleColor.Magenta, 13)] + [InlineData(ConsoleColor.Cyan, 14)] + [InlineData(ConsoleColor.White, 15)] + public void Should_Return_Expected_Color(ConsoleColor color, int expected) + { + // Given, When + var result = (Color)color; + + // Then + result.ShouldBe(Color.FromInt32(expected)); + } + } + + public sealed class ColorToConsoleColor + { + [Theory] + [InlineData(0, ConsoleColor.Black)] + [InlineData(1, ConsoleColor.DarkRed)] + [InlineData(2, ConsoleColor.DarkGreen)] + [InlineData(3, ConsoleColor.DarkYellow)] + [InlineData(4, ConsoleColor.DarkBlue)] + [InlineData(5, ConsoleColor.DarkMagenta)] + [InlineData(6, ConsoleColor.DarkCyan)] + [InlineData(7, ConsoleColor.Gray)] + [InlineData(8, ConsoleColor.DarkGray)] + [InlineData(9, ConsoleColor.Red)] + [InlineData(10, ConsoleColor.Green)] + [InlineData(11, ConsoleColor.Yellow)] + [InlineData(12, ConsoleColor.Blue)] + [InlineData(13, ConsoleColor.Magenta)] + [InlineData(14, ConsoleColor.Cyan)] + [InlineData(15, ConsoleColor.White)] + public void Should_Return_Expected_ConsoleColor_For_Known_Color(int color, ConsoleColor expected) + { + // Given, When + var result = (ConsoleColor)Color.FromInt32(color); + + // Then + result.ShouldBe(expected); + } + } + } + + public sealed class TheToStringMethod + { + [Fact] + public void Should_Return_Color_Name_For_Known_Colors() + { + // Given, When + var name = Color.Fuchsia.ToString(); + + // Then + name.ShouldBe("fuchsia"); + } + + [Fact] + public void Should_Return_Hex_String_For_Unknown_Colors() + { + // Given, When + var name = new Color(128, 0, 128).ToString(); + + // Then + name.ShouldBe("#800080 (RGB=128,0,128)"); + } + } + } +} diff --git a/src/Spectre.Console/Color.Known.cs b/src/Spectre.Console/Color.Known.cs index b225823..73be13f 100644 --- a/src/Spectre.Console/Color.Known.cs +++ b/src/Spectre.Console/Color.Known.cs @@ -7,10 +7,9 @@ namespace Spectre.Console /// public partial struct Color { - internal Color(byte number, string name, byte red, byte green, byte blue, bool isDefault = false) + internal Color(byte number, byte red, byte green, byte blue, bool isDefault = false) : this(red, green, blue) { - Name = name; Number = number; IsDefault = isDefault; } @@ -18,1335 +17,1335 @@ namespace Spectre.Console /// /// Gets the color "Black" (RGB 0,0,0). /// - public static Color Black { get; } = new Color(0, "black", 0, 0, 0); + public static Color Black { get; } = new Color(0, 0, 0, 0); /// /// Gets the color "Maroon" (RGB 128,0,0). /// - public static Color Maroon { get; } = new Color(1, "maroon", 128, 0, 0); + public static Color Maroon { get; } = new Color(1, 128, 0, 0); /// /// Gets the color "Green" (RGB 0,128,0). /// - public static Color Green { get; } = new Color(2, "green", 0, 128, 0); + public static Color Green { get; } = new Color(2, 0, 128, 0); /// /// Gets the color "Olive" (RGB 128,128,0). /// - public static Color Olive { get; } = new Color(3, "olive", 128, 128, 0); + public static Color Olive { get; } = new Color(3, 128, 128, 0); /// /// Gets the color "Navy" (RGB 0,0,128). /// - public static Color Navy { get; } = new Color(4, "navy", 0, 0, 128); + public static Color Navy { get; } = new Color(4, 0, 0, 128); /// /// Gets the color "Purple" (RGB 128,0,128). /// - public static Color Purple { get; } = new Color(5, "purple", 128, 0, 128); + public static Color Purple { get; } = new Color(5, 128, 0, 128); /// /// Gets the color "Teal" (RGB 0,128,128). /// - public static Color Teal { get; } = new Color(6, "teal", 0, 128, 128); + public static Color Teal { get; } = new Color(6, 0, 128, 128); /// /// Gets the color "Silver" (RGB 192,192,192). /// - public static Color Silver { get; } = new Color(7, "silver", 192, 192, 192); + public static Color Silver { get; } = new Color(7, 192, 192, 192); /// /// Gets the color "Grey" (RGB 128,128,128). /// - public static Color Grey { get; } = new Color(8, "grey", 128, 128, 128); + public static Color Grey { get; } = new Color(8, 128, 128, 128); /// /// Gets the color "Red" (RGB 255,0,0). /// - public static Color Red { get; } = new Color(9, "red", 255, 0, 0); + public static Color Red { get; } = new Color(9, 255, 0, 0); /// /// Gets the color "Lime" (RGB 0,255,0). /// - public static Color Lime { get; } = new Color(10, "lime", 0, 255, 0); + public static Color Lime { get; } = new Color(10, 0, 255, 0); /// /// Gets the color "Yellow" (RGB 255,255,0). /// - public static Color Yellow { get; } = new Color(11, "yellow", 255, 255, 0); + public static Color Yellow { get; } = new Color(11, 255, 255, 0); /// /// Gets the color "Blue" (RGB 0,0,255). /// - public static Color Blue { get; } = new Color(12, "blue", 0, 0, 255); + public static Color Blue { get; } = new Color(12, 0, 0, 255); /// /// Gets the color "Fuchsia" (RGB 255,0,255). /// - public static Color Fuchsia { get; } = new Color(13, "fuchsia", 255, 0, 255); + public static Color Fuchsia { get; } = new Color(13, 255, 0, 255); /// /// Gets the color "Aqua" (RGB 0,255,255). /// - public static Color Aqua { get; } = new Color(14, "aqua", 0, 255, 255); + public static Color Aqua { get; } = new Color(14, 0, 255, 255); /// /// Gets the color "White" (RGB 255,255,255). /// - public static Color White { get; } = new Color(15, "white", 255, 255, 255); + public static Color White { get; } = new Color(15, 255, 255, 255); /// /// Gets the color "Grey0" (RGB 0,0,0). /// - public static Color Grey0 { get; } = new Color(16, "grey0", 0, 0, 0); + public static Color Grey0 { get; } = new Color(16, 0, 0, 0); /// /// Gets the color "NavyBlue" (RGB 0,0,95). /// - public static Color NavyBlue { get; } = new Color(17, "navyblue", 0, 0, 95); + public static Color NavyBlue { get; } = new Color(17, 0, 0, 95); /// /// Gets the color "DarkBlue" (RGB 0,0,135). /// - public static Color DarkBlue { get; } = new Color(18, "darkblue", 0, 0, 135); + public static Color DarkBlue { get; } = new Color(18, 0, 0, 135); /// /// Gets the color "Blue3" (RGB 0,0,175). /// - public static Color Blue3 { get; } = new Color(19, "blue3", 0, 0, 175); + public static Color Blue3 { get; } = new Color(19, 0, 0, 175); /// /// Gets the color "Blue3_1" (RGB 0,0,215). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color Blue3_1 { get; } = new Color(20, "blue3_1", 0, 0, 215); + public static Color Blue3_1 { get; } = new Color(20, 0, 0, 215); /// /// Gets the color "Blue1" (RGB 0,0,255). /// - public static Color Blue1 { get; } = new Color(21, "blue1", 0, 0, 255); + public static Color Blue1 { get; } = new Color(21, 0, 0, 255); /// /// Gets the color "DarkGreen" (RGB 0,95,0). /// - public static Color DarkGreen { get; } = new Color(22, "darkgreen", 0, 95, 0); + public static Color DarkGreen { get; } = new Color(22, 0, 95, 0); /// /// Gets the color "DeepSkyBlue4" (RGB 0,95,95). /// - public static Color DeepSkyBlue4 { get; } = new Color(23, "deepskyblue4", 0, 95, 95); + public static Color DeepSkyBlue4 { get; } = new Color(23, 0, 95, 95); /// /// Gets the color "DeepSkyBlue4_1" (RGB 0,95,135). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color DeepSkyBlue4_1 { get; } = new Color(24, "deepskyblue4_1", 0, 95, 135); + public static Color DeepSkyBlue4_1 { get; } = new Color(24, 0, 95, 135); /// /// Gets the color "DeepSkyBlue4_2" (RGB 0,95,175). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color DeepSkyBlue4_2 { get; } = new Color(25, "deepskyblue4_2", 0, 95, 175); + public static Color DeepSkyBlue4_2 { get; } = new Color(25, 0, 95, 175); /// /// Gets the color "DodgerBlue3" (RGB 0,95,215). /// - public static Color DodgerBlue3 { get; } = new Color(26, "dodgerblue3", 0, 95, 215); + public static Color DodgerBlue3 { get; } = new Color(26, 0, 95, 215); /// /// Gets the color "DodgerBlue2" (RGB 0,95,255). /// - public static Color DodgerBlue2 { get; } = new Color(27, "dodgerblue2", 0, 95, 255); + public static Color DodgerBlue2 { get; } = new Color(27, 0, 95, 255); /// /// Gets the color "Green4" (RGB 0,135,0). /// - public static Color Green4 { get; } = new Color(28, "green4", 0, 135, 0); + public static Color Green4 { get; } = new Color(28, 0, 135, 0); /// /// Gets the color "SpringGreen4" (RGB 0,135,95). /// - public static Color SpringGreen4 { get; } = new Color(29, "springgreen4", 0, 135, 95); + public static Color SpringGreen4 { get; } = new Color(29, 0, 135, 95); /// /// Gets the color "Turquoise4" (RGB 0,135,135). /// - public static Color Turquoise4 { get; } = new Color(30, "turquoise4", 0, 135, 135); + public static Color Turquoise4 { get; } = new Color(30, 0, 135, 135); /// /// Gets the color "DeepSkyBlue3" (RGB 0,135,175). /// - public static Color DeepSkyBlue3 { get; } = new Color(31, "deepskyblue3", 0, 135, 175); + public static Color DeepSkyBlue3 { get; } = new Color(31, 0, 135, 175); /// /// Gets the color "DeepSkyBlue3_1" (RGB 0,135,215). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color DeepSkyBlue3_1 { get; } = new Color(32, "deepskyblue3_1", 0, 135, 215); + public static Color DeepSkyBlue3_1 { get; } = new Color(32, 0, 135, 215); /// /// Gets the color "DodgerBlue1" (RGB 0,135,255). /// - public static Color DodgerBlue1 { get; } = new Color(33, "dodgerblue1", 0, 135, 255); + public static Color DodgerBlue1 { get; } = new Color(33, 0, 135, 255); /// /// Gets the color "Green3" (RGB 0,175,0). /// - public static Color Green3 { get; } = new Color(34, "green3", 0, 175, 0); + public static Color Green3 { get; } = new Color(34, 0, 175, 0); /// /// Gets the color "SpringGreen3" (RGB 0,175,95). /// - public static Color SpringGreen3 { get; } = new Color(35, "springgreen3", 0, 175, 95); + public static Color SpringGreen3 { get; } = new Color(35, 0, 175, 95); /// /// Gets the color "DarkCyan" (RGB 0,175,135). /// - public static Color DarkCyan { get; } = new Color(36, "darkcyan", 0, 175, 135); + public static Color DarkCyan { get; } = new Color(36, 0, 175, 135); /// /// Gets the color "LightSeaGreen" (RGB 0,175,175). /// - public static Color LightSeaGreen { get; } = new Color(37, "lightseagreen", 0, 175, 175); + public static Color LightSeaGreen { get; } = new Color(37, 0, 175, 175); /// /// Gets the color "DeepSkyBlue2" (RGB 0,175,215). /// - public static Color DeepSkyBlue2 { get; } = new Color(38, "deepskyblue2", 0, 175, 215); + public static Color DeepSkyBlue2 { get; } = new Color(38, 0, 175, 215); /// /// Gets the color "DeepSkyBlue1" (RGB 0,175,255). /// - public static Color DeepSkyBlue1 { get; } = new Color(39, "deepskyblue1", 0, 175, 255); + public static Color DeepSkyBlue1 { get; } = new Color(39, 0, 175, 255); /// /// Gets the color "Green3_1" (RGB 0,215,0). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color Green3_1 { get; } = new Color(40, "green3_1", 0, 215, 0); + public static Color Green3_1 { get; } = new Color(40, 0, 215, 0); /// /// Gets the color "SpringGreen3_1" (RGB 0,215,95). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color SpringGreen3_1 { get; } = new Color(41, "springgreen3_1", 0, 215, 95); + public static Color SpringGreen3_1 { get; } = new Color(41, 0, 215, 95); /// /// Gets the color "SpringGreen2" (RGB 0,215,135). /// - public static Color SpringGreen2 { get; } = new Color(42, "springgreen2", 0, 215, 135); + public static Color SpringGreen2 { get; } = new Color(42, 0, 215, 135); /// /// Gets the color "Cyan3" (RGB 0,215,175). /// - public static Color Cyan3 { get; } = new Color(43, "cyan3", 0, 215, 175); + public static Color Cyan3 { get; } = new Color(43, 0, 215, 175); /// /// Gets the color "DarkTurquoise" (RGB 0,215,215). /// - public static Color DarkTurquoise { get; } = new Color(44, "darkturquoise", 0, 215, 215); + public static Color DarkTurquoise { get; } = new Color(44, 0, 215, 215); /// /// Gets the color "Turquoise2" (RGB 0,215,255). /// - public static Color Turquoise2 { get; } = new Color(45, "turquoise2", 0, 215, 255); + public static Color Turquoise2 { get; } = new Color(45, 0, 215, 255); /// /// Gets the color "Green1" (RGB 0,255,0). /// - public static Color Green1 { get; } = new Color(46, "green1", 0, 255, 0); + public static Color Green1 { get; } = new Color(46, 0, 255, 0); /// /// Gets the color "SpringGreen2_1" (RGB 0,255,95). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color SpringGreen2_1 { get; } = new Color(47, "springgreen2_1", 0, 255, 95); + public static Color SpringGreen2_1 { get; } = new Color(47, 0, 255, 95); /// /// Gets the color "SpringGreen1" (RGB 0,255,135). /// - public static Color SpringGreen1 { get; } = new Color(48, "springgreen1", 0, 255, 135); + public static Color SpringGreen1 { get; } = new Color(48, 0, 255, 135); /// /// Gets the color "MediumSpringGreen" (RGB 0,255,175). /// - public static Color MediumSpringGreen { get; } = new Color(49, "mediumspringgreen", 0, 255, 175); + public static Color MediumSpringGreen { get; } = new Color(49, 0, 255, 175); /// /// Gets the color "Cyan2" (RGB 0,255,215). /// - public static Color Cyan2 { get; } = new Color(50, "cyan2", 0, 255, 215); + public static Color Cyan2 { get; } = new Color(50, 0, 255, 215); /// /// Gets the color "Cyan1" (RGB 0,255,255). /// - public static Color Cyan1 { get; } = new Color(51, "cyan1", 0, 255, 255); + public static Color Cyan1 { get; } = new Color(51, 0, 255, 255); /// /// Gets the color "DarkRed" (RGB 95,0,0). /// - public static Color DarkRed { get; } = new Color(52, "darkred", 95, 0, 0); + public static Color DarkRed { get; } = new Color(52, 95, 0, 0); /// /// Gets the color "DeepPink4" (RGB 95,0,95). /// - public static Color DeepPink4 { get; } = new Color(53, "deeppink4", 95, 0, 95); + public static Color DeepPink4 { get; } = new Color(53, 95, 0, 95); /// /// Gets the color "Purple4" (RGB 95,0,135). /// - public static Color Purple4 { get; } = new Color(54, "purple4", 95, 0, 135); + public static Color Purple4 { get; } = new Color(54, 95, 0, 135); /// /// Gets the color "Purple4_1" (RGB 95,0,175). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color Purple4_1 { get; } = new Color(55, "purple4_1", 95, 0, 175); + public static Color Purple4_1 { get; } = new Color(55, 95, 0, 175); /// /// Gets the color "Purple3" (RGB 95,0,215). /// - public static Color Purple3 { get; } = new Color(56, "purple3", 95, 0, 215); + public static Color Purple3 { get; } = new Color(56, 95, 0, 215); /// /// Gets the color "BlueViolet" (RGB 95,0,255). /// - public static Color BlueViolet { get; } = new Color(57, "blueviolet", 95, 0, 255); + public static Color BlueViolet { get; } = new Color(57, 95, 0, 255); /// /// Gets the color "Orange4" (RGB 95,95,0). /// - public static Color Orange4 { get; } = new Color(58, "orange4", 95, 95, 0); + public static Color Orange4 { get; } = new Color(58, 95, 95, 0); /// /// Gets the color "Grey37" (RGB 95,95,95). /// - public static Color Grey37 { get; } = new Color(59, "grey37", 95, 95, 95); + public static Color Grey37 { get; } = new Color(59, 95, 95, 95); /// /// Gets the color "MediumPurple4" (RGB 95,95,135). /// - public static Color MediumPurple4 { get; } = new Color(60, "mediumpurple4", 95, 95, 135); + public static Color MediumPurple4 { get; } = new Color(60, 95, 95, 135); /// /// Gets the color "SlateBlue3" (RGB 95,95,175). /// - public static Color SlateBlue3 { get; } = new Color(61, "slateblue3", 95, 95, 175); + public static Color SlateBlue3 { get; } = new Color(61, 95, 95, 175); /// /// Gets the color "SlateBlue3_1" (RGB 95,95,215). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color SlateBlue3_1 { get; } = new Color(62, "slateblue3_1", 95, 95, 215); + public static Color SlateBlue3_1 { get; } = new Color(62, 95, 95, 215); /// /// Gets the color "RoyalBlue1" (RGB 95,95,255). /// - public static Color RoyalBlue1 { get; } = new Color(63, "royalblue1", 95, 95, 255); + public static Color RoyalBlue1 { get; } = new Color(63, 95, 95, 255); /// /// Gets the color "Chartreuse4" (RGB 95,135,0). /// - public static Color Chartreuse4 { get; } = new Color(64, "chartreuse4", 95, 135, 0); + public static Color Chartreuse4 { get; } = new Color(64, 95, 135, 0); /// /// Gets the color "DarkSeaGreen4" (RGB 95,135,95). /// - public static Color DarkSeaGreen4 { get; } = new Color(65, "darkseagreen4", 95, 135, 95); + public static Color DarkSeaGreen4 { get; } = new Color(65, 95, 135, 95); /// /// Gets the color "PaleTurquoise4" (RGB 95,135,135). /// - public static Color PaleTurquoise4 { get; } = new Color(66, "paleturquoise4", 95, 135, 135); + public static Color PaleTurquoise4 { get; } = new Color(66, 95, 135, 135); /// /// Gets the color "SteelBlue" (RGB 95,135,175). /// - public static Color SteelBlue { get; } = new Color(67, "steelblue", 95, 135, 175); + public static Color SteelBlue { get; } = new Color(67, 95, 135, 175); /// /// Gets the color "SteelBlue3" (RGB 95,135,215). /// - public static Color SteelBlue3 { get; } = new Color(68, "steelblue3", 95, 135, 215); + public static Color SteelBlue3 { get; } = new Color(68, 95, 135, 215); /// /// Gets the color "CornflowerBlue" (RGB 95,135,255). /// - public static Color CornflowerBlue { get; } = new Color(69, "cornflowerblue", 95, 135, 255); + public static Color CornflowerBlue { get; } = new Color(69, 95, 135, 255); /// /// Gets the color "Chartreuse3" (RGB 95,175,0). /// - public static Color Chartreuse3 { get; } = new Color(70, "chartreuse3", 95, 175, 0); + public static Color Chartreuse3 { get; } = new Color(70, 95, 175, 0); /// /// Gets the color "DarkSeaGreen4_1" (RGB 95,175,95). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color DarkSeaGreen4_1 { get; } = new Color(71, "darkseagreen4_1", 95, 175, 95); + public static Color DarkSeaGreen4_1 { get; } = new Color(71, 95, 175, 95); /// /// Gets the color "CadetBlue" (RGB 95,175,135). /// - public static Color CadetBlue { get; } = new Color(72, "cadetblue", 95, 175, 135); + public static Color CadetBlue { get; } = new Color(72, 95, 175, 135); /// /// Gets the color "CadetBlue_1" (RGB 95,175,175). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color CadetBlue_1 { get; } = new Color(73, "cadetblue_1", 95, 175, 175); + public static Color CadetBlue_1 { get; } = new Color(73, 95, 175, 175); /// /// Gets the color "SkyBlue3" (RGB 95,175,215). /// - public static Color SkyBlue3 { get; } = new Color(74, "skyblue3", 95, 175, 215); + public static Color SkyBlue3 { get; } = new Color(74, 95, 175, 215); /// /// Gets the color "SteelBlue1" (RGB 95,175,255). /// - public static Color SteelBlue1 { get; } = new Color(75, "steelblue1", 95, 175, 255); + public static Color SteelBlue1 { get; } = new Color(75, 95, 175, 255); /// /// Gets the color "Chartreuse3_1" (RGB 95,215,0). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color Chartreuse3_1 { get; } = new Color(76, "chartreuse3_1", 95, 215, 0); + public static Color Chartreuse3_1 { get; } = new Color(76, 95, 215, 0); /// /// Gets the color "PaleGreen3" (RGB 95,215,95). /// - public static Color PaleGreen3 { get; } = new Color(77, "palegreen3", 95, 215, 95); + public static Color PaleGreen3 { get; } = new Color(77, 95, 215, 95); /// /// Gets the color "SeaGreen3" (RGB 95,215,135). /// - public static Color SeaGreen3 { get; } = new Color(78, "seagreen3", 95, 215, 135); + public static Color SeaGreen3 { get; } = new Color(78, 95, 215, 135); /// /// Gets the color "Aquamarine3" (RGB 95,215,175). /// - public static Color Aquamarine3 { get; } = new Color(79, "aquamarine3", 95, 215, 175); + public static Color Aquamarine3 { get; } = new Color(79, 95, 215, 175); /// /// Gets the color "MediumTurquoise" (RGB 95,215,215). /// - public static Color MediumTurquoise { get; } = new Color(80, "mediumturquoise", 95, 215, 215); + public static Color MediumTurquoise { get; } = new Color(80, 95, 215, 215); /// /// Gets the color "SteelBlue1_1" (RGB 95,215,255). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color SteelBlue1_1 { get; } = new Color(81, "steelblue1_1", 95, 215, 255); + public static Color SteelBlue1_1 { get; } = new Color(81, 95, 215, 255); /// /// Gets the color "Chartreuse2" (RGB 95,255,0). /// - public static Color Chartreuse2 { get; } = new Color(82, "chartreuse2", 95, 255, 0); + public static Color Chartreuse2 { get; } = new Color(82, 95, 255, 0); /// /// Gets the color "SeaGreen2" (RGB 95,255,95). /// - public static Color SeaGreen2 { get; } = new Color(83, "seagreen2", 95, 255, 95); + public static Color SeaGreen2 { get; } = new Color(83, 95, 255, 95); /// /// Gets the color "SeaGreen1" (RGB 95,255,135). /// - public static Color SeaGreen1 { get; } = new Color(84, "seagreen1", 95, 255, 135); + public static Color SeaGreen1 { get; } = new Color(84, 95, 255, 135); /// /// Gets the color "SeaGreen1_1" (RGB 95,255,175). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color SeaGreen1_1 { get; } = new Color(85, "seagreen1_1", 95, 255, 175); + public static Color SeaGreen1_1 { get; } = new Color(85, 95, 255, 175); /// /// Gets the color "Aquamarine1" (RGB 95,255,215). /// - public static Color Aquamarine1 { get; } = new Color(86, "aquamarine1", 95, 255, 215); + public static Color Aquamarine1 { get; } = new Color(86, 95, 255, 215); /// /// Gets the color "DarkSlateGray2" (RGB 95,255,255). /// - public static Color DarkSlateGray2 { get; } = new Color(87, "darkslategray2", 95, 255, 255); + public static Color DarkSlateGray2 { get; } = new Color(87, 95, 255, 255); /// /// Gets the color "DarkRed_1" (RGB 135,0,0). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color DarkRed_1 { get; } = new Color(88, "darkred_1", 135, 0, 0); + public static Color DarkRed_1 { get; } = new Color(88, 135, 0, 0); /// /// Gets the color "DeepPink4_1" (RGB 135,0,95). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color DeepPink4_1 { get; } = new Color(89, "deeppink4_1", 135, 0, 95); + public static Color DeepPink4_1 { get; } = new Color(89, 135, 0, 95); /// /// Gets the color "DarkMagenta" (RGB 135,0,135). /// - public static Color DarkMagenta { get; } = new Color(90, "darkmagenta", 135, 0, 135); + public static Color DarkMagenta { get; } = new Color(90, 135, 0, 135); /// /// Gets the color "DarkMagenta_1" (RGB 135,0,175). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color DarkMagenta_1 { get; } = new Color(91, "darkmagenta_1", 135, 0, 175); + public static Color DarkMagenta_1 { get; } = new Color(91, 135, 0, 175); /// /// Gets the color "DarkViolet" (RGB 135,0,215). /// - public static Color DarkViolet { get; } = new Color(92, "darkviolet", 135, 0, 215); + public static Color DarkViolet { get; } = new Color(92, 135, 0, 215); /// /// Gets the color "Purple_1" (RGB 135,0,255). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color Purple_1 { get; } = new Color(93, "purple_1", 135, 0, 255); + public static Color Purple_1 { get; } = new Color(93, 135, 0, 255); /// /// Gets the color "Orange4_1" (RGB 135,95,0). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color Orange4_1 { get; } = new Color(94, "orange4_1", 135, 95, 0); + public static Color Orange4_1 { get; } = new Color(94, 135, 95, 0); /// /// Gets the color "LightPink4" (RGB 135,95,95). /// - public static Color LightPink4 { get; } = new Color(95, "lightpink4", 135, 95, 95); + public static Color LightPink4 { get; } = new Color(95, 135, 95, 95); /// /// Gets the color "Plum4" (RGB 135,95,135). /// - public static Color Plum4 { get; } = new Color(96, "plum4", 135, 95, 135); + public static Color Plum4 { get; } = new Color(96, 135, 95, 135); /// /// Gets the color "MediumPurple3" (RGB 135,95,175). /// - public static Color MediumPurple3 { get; } = new Color(97, "mediumpurple3", 135, 95, 175); + public static Color MediumPurple3 { get; } = new Color(97, 135, 95, 175); /// /// Gets the color "MediumPurple3_1" (RGB 135,95,215). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color MediumPurple3_1 { get; } = new Color(98, "mediumpurple3_1", 135, 95, 215); + public static Color MediumPurple3_1 { get; } = new Color(98, 135, 95, 215); /// /// Gets the color "SlateBlue1" (RGB 135,95,255). /// - public static Color SlateBlue1 { get; } = new Color(99, "slateblue1", 135, 95, 255); + public static Color SlateBlue1 { get; } = new Color(99, 135, 95, 255); /// /// Gets the color "Yellow4" (RGB 135,135,0). /// - public static Color Yellow4 { get; } = new Color(100, "yellow4", 135, 135, 0); + public static Color Yellow4 { get; } = new Color(100, 135, 135, 0); /// /// Gets the color "Wheat4" (RGB 135,135,95). /// - public static Color Wheat4 { get; } = new Color(101, "wheat4", 135, 135, 95); + public static Color Wheat4 { get; } = new Color(101, 135, 135, 95); /// /// Gets the color "Grey53" (RGB 135,135,135). /// - public static Color Grey53 { get; } = new Color(102, "grey53", 135, 135, 135); + public static Color Grey53 { get; } = new Color(102, 135, 135, 135); /// /// Gets the color "LightSlateGrey" (RGB 135,135,175). /// - public static Color LightSlateGrey { get; } = new Color(103, "lightslategrey", 135, 135, 175); + public static Color LightSlateGrey { get; } = new Color(103, 135, 135, 175); /// /// Gets the color "MediumPurple" (RGB 135,135,215). /// - public static Color MediumPurple { get; } = new Color(104, "mediumpurple", 135, 135, 215); + public static Color MediumPurple { get; } = new Color(104, 135, 135, 215); /// /// Gets the color "LightSlateBlue" (RGB 135,135,255). /// - public static Color LightSlateBlue { get; } = new Color(105, "lightslateblue", 135, 135, 255); + public static Color LightSlateBlue { get; } = new Color(105, 135, 135, 255); /// /// Gets the color "Yellow4_1" (RGB 135,175,0). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color Yellow4_1 { get; } = new Color(106, "yellow4_1", 135, 175, 0); + public static Color Yellow4_1 { get; } = new Color(106, 135, 175, 0); /// /// Gets the color "DarkOliveGreen3" (RGB 135,175,95). /// - public static Color DarkOliveGreen3 { get; } = new Color(107, "darkolivegreen3", 135, 175, 95); + public static Color DarkOliveGreen3 { get; } = new Color(107, 135, 175, 95); /// /// Gets the color "DarkSeaGreen" (RGB 135,175,135). /// - public static Color DarkSeaGreen { get; } = new Color(108, "darkseagreen", 135, 175, 135); + public static Color DarkSeaGreen { get; } = new Color(108, 135, 175, 135); /// /// Gets the color "LightSkyBlue3" (RGB 135,175,175). /// - public static Color LightSkyBlue3 { get; } = new Color(109, "lightskyblue3", 135, 175, 175); + public static Color LightSkyBlue3 { get; } = new Color(109, 135, 175, 175); /// /// Gets the color "LightSkyBlue3_1" (RGB 135,175,215). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color LightSkyBlue3_1 { get; } = new Color(110, "lightskyblue3_1", 135, 175, 215); + public static Color LightSkyBlue3_1 { get; } = new Color(110, 135, 175, 215); /// /// Gets the color "SkyBlue2" (RGB 135,175,255). /// - public static Color SkyBlue2 { get; } = new Color(111, "skyblue2", 135, 175, 255); + public static Color SkyBlue2 { get; } = new Color(111, 135, 175, 255); /// /// Gets the color "Chartreuse2_1" (RGB 135,215,0). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color Chartreuse2_1 { get; } = new Color(112, "chartreuse2_1", 135, 215, 0); + public static Color Chartreuse2_1 { get; } = new Color(112, 135, 215, 0); /// /// Gets the color "DarkOliveGreen3_1" (RGB 135,215,95). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color DarkOliveGreen3_1 { get; } = new Color(113, "darkolivegreen3_1", 135, 215, 95); + public static Color DarkOliveGreen3_1 { get; } = new Color(113, 135, 215, 95); /// /// Gets the color "PaleGreen3_1" (RGB 135,215,135). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color PaleGreen3_1 { get; } = new Color(114, "palegreen3_1", 135, 215, 135); + public static Color PaleGreen3_1 { get; } = new Color(114, 135, 215, 135); /// /// Gets the color "DarkSeaGreen3" (RGB 135,215,175). /// - public static Color DarkSeaGreen3 { get; } = new Color(115, "darkseagreen3", 135, 215, 175); + public static Color DarkSeaGreen3 { get; } = new Color(115, 135, 215, 175); /// /// Gets the color "DarkSlateGray3" (RGB 135,215,215). /// - public static Color DarkSlateGray3 { get; } = new Color(116, "darkslategray3", 135, 215, 215); + public static Color DarkSlateGray3 { get; } = new Color(116, 135, 215, 215); /// /// Gets the color "SkyBlue1" (RGB 135,215,255). /// - public static Color SkyBlue1 { get; } = new Color(117, "skyblue1", 135, 215, 255); + public static Color SkyBlue1 { get; } = new Color(117, 135, 215, 255); /// /// Gets the color "Chartreuse1" (RGB 135,255,0). /// - public static Color Chartreuse1 { get; } = new Color(118, "chartreuse1", 135, 255, 0); + public static Color Chartreuse1 { get; } = new Color(118, 135, 255, 0); /// /// Gets the color "LightGreen" (RGB 135,255,95). /// - public static Color LightGreen { get; } = new Color(119, "lightgreen", 135, 255, 95); + public static Color LightGreen { get; } = new Color(119, 135, 255, 95); /// /// Gets the color "LightGreen_1" (RGB 135,255,135). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color LightGreen_1 { get; } = new Color(120, "lightgreen_1", 135, 255, 135); + public static Color LightGreen_1 { get; } = new Color(120, 135, 255, 135); /// /// Gets the color "PaleGreen1" (RGB 135,255,175). /// - public static Color PaleGreen1 { get; } = new Color(121, "palegreen1", 135, 255, 175); + public static Color PaleGreen1 { get; } = new Color(121, 135, 255, 175); /// /// Gets the color "Aquamarine1_1" (RGB 135,255,215). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color Aquamarine1_1 { get; } = new Color(122, "aquamarine1_1", 135, 255, 215); + public static Color Aquamarine1_1 { get; } = new Color(122, 135, 255, 215); /// /// Gets the color "DarkSlateGray1" (RGB 135,255,255). /// - public static Color DarkSlateGray1 { get; } = new Color(123, "darkslategray1", 135, 255, 255); + public static Color DarkSlateGray1 { get; } = new Color(123, 135, 255, 255); /// /// Gets the color "Red3" (RGB 175,0,0). /// - public static Color Red3 { get; } = new Color(124, "red3", 175, 0, 0); + public static Color Red3 { get; } = new Color(124, 175, 0, 0); /// /// Gets the color "DeepPink4_2" (RGB 175,0,95). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color DeepPink4_2 { get; } = new Color(125, "deeppink4_2", 175, 0, 95); + public static Color DeepPink4_2 { get; } = new Color(125, 175, 0, 95); /// /// Gets the color "MediumVioletRed" (RGB 175,0,135). /// - public static Color MediumVioletRed { get; } = new Color(126, "mediumvioletred", 175, 0, 135); + public static Color MediumVioletRed { get; } = new Color(126, 175, 0, 135); /// /// Gets the color "Magenta3" (RGB 175,0,175). /// - public static Color Magenta3 { get; } = new Color(127, "magenta3", 175, 0, 175); + public static Color Magenta3 { get; } = new Color(127, 175, 0, 175); /// /// Gets the color "DarkViolet_1" (RGB 175,0,215). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color DarkViolet_1 { get; } = new Color(128, "darkviolet_1", 175, 0, 215); + public static Color DarkViolet_1 { get; } = new Color(128, 175, 0, 215); /// /// Gets the color "Purple_2" (RGB 175,0,255). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color Purple_2 { get; } = new Color(129, "purple_2", 175, 0, 255); + public static Color Purple_2 { get; } = new Color(129, 175, 0, 255); /// /// Gets the color "DarkOrange3" (RGB 175,95,0). /// - public static Color DarkOrange3 { get; } = new Color(130, "darkorange3", 175, 95, 0); + public static Color DarkOrange3 { get; } = new Color(130, 175, 95, 0); /// /// Gets the color "IndianRed" (RGB 175,95,95). /// - public static Color IndianRed { get; } = new Color(131, "indianred", 175, 95, 95); + public static Color IndianRed { get; } = new Color(131, 175, 95, 95); /// /// Gets the color "HotPink3" (RGB 175,95,135). /// - public static Color HotPink3 { get; } = new Color(132, "hotpink3", 175, 95, 135); + public static Color HotPink3 { get; } = new Color(132, 175, 95, 135); /// /// Gets the color "MediumOrchid3" (RGB 175,95,175). /// - public static Color MediumOrchid3 { get; } = new Color(133, "mediumorchid3", 175, 95, 175); + public static Color MediumOrchid3 { get; } = new Color(133, 175, 95, 175); /// /// Gets the color "MediumOrchid" (RGB 175,95,215). /// - public static Color MediumOrchid { get; } = new Color(134, "mediumorchid", 175, 95, 215); + public static Color MediumOrchid { get; } = new Color(134, 175, 95, 215); /// /// Gets the color "MediumPurple2" (RGB 175,95,255). /// - public static Color MediumPurple2 { get; } = new Color(135, "mediumpurple2", 175, 95, 255); + public static Color MediumPurple2 { get; } = new Color(135, 175, 95, 255); /// /// Gets the color "DarkGoldenrod" (RGB 175,135,0). /// - public static Color DarkGoldenrod { get; } = new Color(136, "darkgoldenrod", 175, 135, 0); + public static Color DarkGoldenrod { get; } = new Color(136, 175, 135, 0); /// /// Gets the color "LightSalmon3" (RGB 175,135,95). /// - public static Color LightSalmon3 { get; } = new Color(137, "lightsalmon3", 175, 135, 95); + public static Color LightSalmon3 { get; } = new Color(137, 175, 135, 95); /// /// Gets the color "RosyBrown" (RGB 175,135,135). /// - public static Color RosyBrown { get; } = new Color(138, "rosybrown", 175, 135, 135); + public static Color RosyBrown { get; } = new Color(138, 175, 135, 135); /// /// Gets the color "Grey63" (RGB 175,135,175). /// - public static Color Grey63 { get; } = new Color(139, "grey63", 175, 135, 175); + public static Color Grey63 { get; } = new Color(139, 175, 135, 175); /// /// Gets the color "MediumPurple2_1" (RGB 175,135,215). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color MediumPurple2_1 { get; } = new Color(140, "mediumpurple2_1", 175, 135, 215); + public static Color MediumPurple2_1 { get; } = new Color(140, 175, 135, 215); /// /// Gets the color "MediumPurple1" (RGB 175,135,255). /// - public static Color MediumPurple1 { get; } = new Color(141, "mediumpurple1", 175, 135, 255); + public static Color MediumPurple1 { get; } = new Color(141, 175, 135, 255); /// /// Gets the color "Gold3" (RGB 175,175,0). /// - public static Color Gold3 { get; } = new Color(142, "gold3", 175, 175, 0); + public static Color Gold3 { get; } = new Color(142, 175, 175, 0); /// /// Gets the color "DarkKhaki" (RGB 175,175,95). /// - public static Color DarkKhaki { get; } = new Color(143, "darkkhaki", 175, 175, 95); + public static Color DarkKhaki { get; } = new Color(143, 175, 175, 95); /// /// Gets the color "NavajoWhite3" (RGB 175,175,135). /// - public static Color NavajoWhite3 { get; } = new Color(144, "navajowhite3", 175, 175, 135); + public static Color NavajoWhite3 { get; } = new Color(144, 175, 175, 135); /// /// Gets the color "Grey69" (RGB 175,175,175). /// - public static Color Grey69 { get; } = new Color(145, "grey69", 175, 175, 175); + public static Color Grey69 { get; } = new Color(145, 175, 175, 175); /// /// Gets the color "LightSteelBlue3" (RGB 175,175,215). /// - public static Color LightSteelBlue3 { get; } = new Color(146, "lightsteelblue3", 175, 175, 215); + public static Color LightSteelBlue3 { get; } = new Color(146, 175, 175, 215); /// /// Gets the color "LightSteelBlue" (RGB 175,175,255). /// - public static Color LightSteelBlue { get; } = new Color(147, "lightsteelblue", 175, 175, 255); + public static Color LightSteelBlue { get; } = new Color(147, 175, 175, 255); /// /// Gets the color "Yellow3" (RGB 175,215,0). /// - public static Color Yellow3 { get; } = new Color(148, "yellow3", 175, 215, 0); + public static Color Yellow3 { get; } = new Color(148, 175, 215, 0); /// /// Gets the color "DarkOliveGreen3_2" (RGB 175,215,95). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color DarkOliveGreen3_2 { get; } = new Color(149, "darkolivegreen3_2", 175, 215, 95); + public static Color DarkOliveGreen3_2 { get; } = new Color(149, 175, 215, 95); /// /// Gets the color "DarkSeaGreen3_1" (RGB 175,215,135). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color DarkSeaGreen3_1 { get; } = new Color(150, "darkseagreen3_1", 175, 215, 135); + public static Color DarkSeaGreen3_1 { get; } = new Color(150, 175, 215, 135); /// /// Gets the color "DarkSeaGreen2" (RGB 175,215,175). /// - public static Color DarkSeaGreen2 { get; } = new Color(151, "darkseagreen2", 175, 215, 175); + public static Color DarkSeaGreen2 { get; } = new Color(151, 175, 215, 175); /// /// Gets the color "LightCyan3" (RGB 175,215,215). /// - public static Color LightCyan3 { get; } = new Color(152, "lightcyan3", 175, 215, 215); + public static Color LightCyan3 { get; } = new Color(152, 175, 215, 215); /// /// Gets the color "LightSkyBlue1" (RGB 175,215,255). /// - public static Color LightSkyBlue1 { get; } = new Color(153, "lightskyblue1", 175, 215, 255); + public static Color LightSkyBlue1 { get; } = new Color(153, 175, 215, 255); /// /// Gets the color "GreenYellow" (RGB 175,255,0). /// - public static Color GreenYellow { get; } = new Color(154, "greenyellow", 175, 255, 0); + public static Color GreenYellow { get; } = new Color(154, 175, 255, 0); /// /// Gets the color "DarkOliveGreen2" (RGB 175,255,95). /// - public static Color DarkOliveGreen2 { get; } = new Color(155, "darkolivegreen2", 175, 255, 95); + public static Color DarkOliveGreen2 { get; } = new Color(155, 175, 255, 95); /// /// Gets the color "PaleGreen1_1" (RGB 175,255,135). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color PaleGreen1_1 { get; } = new Color(156, "palegreen1_1", 175, 255, 135); + public static Color PaleGreen1_1 { get; } = new Color(156, 175, 255, 135); /// /// Gets the color "DarkSeaGreen2_1" (RGB 175,255,175). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color DarkSeaGreen2_1 { get; } = new Color(157, "darkseagreen2_1", 175, 255, 175); + public static Color DarkSeaGreen2_1 { get; } = new Color(157, 175, 255, 175); /// /// Gets the color "DarkSeaGreen1" (RGB 175,255,215). /// - public static Color DarkSeaGreen1 { get; } = new Color(158, "darkseagreen1", 175, 255, 215); + public static Color DarkSeaGreen1 { get; } = new Color(158, 175, 255, 215); /// /// Gets the color "PaleTurquoise1" (RGB 175,255,255). /// - public static Color PaleTurquoise1 { get; } = new Color(159, "paleturquoise1", 175, 255, 255); + public static Color PaleTurquoise1 { get; } = new Color(159, 175, 255, 255); /// /// Gets the color "Red3_1" (RGB 215,0,0). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color Red3_1 { get; } = new Color(160, "red3_1", 215, 0, 0); + public static Color Red3_1 { get; } = new Color(160, 215, 0, 0); /// /// Gets the color "DeepPink3" (RGB 215,0,95). /// - public static Color DeepPink3 { get; } = new Color(161, "deeppink3", 215, 0, 95); + public static Color DeepPink3 { get; } = new Color(161, 215, 0, 95); /// /// Gets the color "DeepPink3_1" (RGB 215,0,135). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color DeepPink3_1 { get; } = new Color(162, "deeppink3_1", 215, 0, 135); + public static Color DeepPink3_1 { get; } = new Color(162, 215, 0, 135); /// /// Gets the color "Magenta3_1" (RGB 215,0,175). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color Magenta3_1 { get; } = new Color(163, "magenta3_1", 215, 0, 175); + public static Color Magenta3_1 { get; } = new Color(163, 215, 0, 175); /// /// Gets the color "Magenta3_2" (RGB 215,0,215). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color Magenta3_2 { get; } = new Color(164, "magenta3_2", 215, 0, 215); + public static Color Magenta3_2 { get; } = new Color(164, 215, 0, 215); /// /// Gets the color "Magenta2" (RGB 215,0,255). /// - public static Color Magenta2 { get; } = new Color(165, "magenta2", 215, 0, 255); + public static Color Magenta2 { get; } = new Color(165, 215, 0, 255); /// /// Gets the color "DarkOrange3_1" (RGB 215,95,0). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color DarkOrange3_1 { get; } = new Color(166, "darkorange3_1", 215, 95, 0); + public static Color DarkOrange3_1 { get; } = new Color(166, 215, 95, 0); /// /// Gets the color "IndianRed_1" (RGB 215,95,95). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color IndianRed_1 { get; } = new Color(167, "indianred_1", 215, 95, 95); + public static Color IndianRed_1 { get; } = new Color(167, 215, 95, 95); /// /// Gets the color "HotPink3_1" (RGB 215,95,135). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color HotPink3_1 { get; } = new Color(168, "hotpink3_1", 215, 95, 135); + public static Color HotPink3_1 { get; } = new Color(168, 215, 95, 135); /// /// Gets the color "HotPink2" (RGB 215,95,175). /// - public static Color HotPink2 { get; } = new Color(169, "hotpink2", 215, 95, 175); + public static Color HotPink2 { get; } = new Color(169, 215, 95, 175); /// /// Gets the color "Orchid" (RGB 215,95,215). /// - public static Color Orchid { get; } = new Color(170, "orchid", 215, 95, 215); + public static Color Orchid { get; } = new Color(170, 215, 95, 215); /// /// Gets the color "MediumOrchid1" (RGB 215,95,255). /// - public static Color MediumOrchid1 { get; } = new Color(171, "mediumorchid1", 215, 95, 255); + public static Color MediumOrchid1 { get; } = new Color(171, 215, 95, 255); /// /// Gets the color "Orange3" (RGB 215,135,0). /// - public static Color Orange3 { get; } = new Color(172, "orange3", 215, 135, 0); + public static Color Orange3 { get; } = new Color(172, 215, 135, 0); /// /// Gets the color "LightSalmon3_1" (RGB 215,135,95). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color LightSalmon3_1 { get; } = new Color(173, "lightsalmon3_1", 215, 135, 95); + public static Color LightSalmon3_1 { get; } = new Color(173, 215, 135, 95); /// /// Gets the color "LightPink3" (RGB 215,135,135). /// - public static Color LightPink3 { get; } = new Color(174, "lightpink3", 215, 135, 135); + public static Color LightPink3 { get; } = new Color(174, 215, 135, 135); /// /// Gets the color "Pink3" (RGB 215,135,175). /// - public static Color Pink3 { get; } = new Color(175, "pink3", 215, 135, 175); + public static Color Pink3 { get; } = new Color(175, 215, 135, 175); /// /// Gets the color "Plum3" (RGB 215,135,215). /// - public static Color Plum3 { get; } = new Color(176, "plum3", 215, 135, 215); + public static Color Plum3 { get; } = new Color(176, 215, 135, 215); /// /// Gets the color "Violet" (RGB 215,135,255). /// - public static Color Violet { get; } = new Color(177, "violet", 215, 135, 255); + public static Color Violet { get; } = new Color(177, 215, 135, 255); /// /// Gets the color "Gold3_1" (RGB 215,175,0). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color Gold3_1 { get; } = new Color(178, "gold3_1", 215, 175, 0); + public static Color Gold3_1 { get; } = new Color(178, 215, 175, 0); /// /// Gets the color "LightGoldenrod3" (RGB 215,175,95). /// - public static Color LightGoldenrod3 { get; } = new Color(179, "lightgoldenrod3", 215, 175, 95); + public static Color LightGoldenrod3 { get; } = new Color(179, 215, 175, 95); /// /// Gets the color "Tan" (RGB 215,175,135). /// - public static Color Tan { get; } = new Color(180, "tan", 215, 175, 135); + public static Color Tan { get; } = new Color(180, 215, 175, 135); /// /// Gets the color "MistyRose3" (RGB 215,175,175). /// - public static Color MistyRose3 { get; } = new Color(181, "mistyrose3", 215, 175, 175); + public static Color MistyRose3 { get; } = new Color(181, 215, 175, 175); /// /// Gets the color "Thistle3" (RGB 215,175,215). /// - public static Color Thistle3 { get; } = new Color(182, "thistle3", 215, 175, 215); + public static Color Thistle3 { get; } = new Color(182, 215, 175, 215); /// /// Gets the color "Plum2" (RGB 215,175,255). /// - public static Color Plum2 { get; } = new Color(183, "plum2", 215, 175, 255); + public static Color Plum2 { get; } = new Color(183, 215, 175, 255); /// /// Gets the color "Yellow3_1" (RGB 215,215,0). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color Yellow3_1 { get; } = new Color(184, "yellow3_1", 215, 215, 0); + public static Color Yellow3_1 { get; } = new Color(184, 215, 215, 0); /// /// Gets the color "Khaki3" (RGB 215,215,95). /// - public static Color Khaki3 { get; } = new Color(185, "khaki3", 215, 215, 95); + public static Color Khaki3 { get; } = new Color(185, 215, 215, 95); /// /// Gets the color "LightGoldenrod2" (RGB 215,215,135). /// - public static Color LightGoldenrod2 { get; } = new Color(186, "lightgoldenrod2", 215, 215, 135); + public static Color LightGoldenrod2 { get; } = new Color(186, 215, 215, 135); /// /// Gets the color "LightYellow3" (RGB 215,215,175). /// - public static Color LightYellow3 { get; } = new Color(187, "lightyellow3", 215, 215, 175); + public static Color LightYellow3 { get; } = new Color(187, 215, 215, 175); /// /// Gets the color "Grey84" (RGB 215,215,215). /// - public static Color Grey84 { get; } = new Color(188, "grey84", 215, 215, 215); + public static Color Grey84 { get; } = new Color(188, 215, 215, 215); /// /// Gets the color "LightSteelBlue1" (RGB 215,215,255). /// - public static Color LightSteelBlue1 { get; } = new Color(189, "lightsteelblue1", 215, 215, 255); + public static Color LightSteelBlue1 { get; } = new Color(189, 215, 215, 255); /// /// Gets the color "Yellow2" (RGB 215,255,0). /// - public static Color Yellow2 { get; } = new Color(190, "yellow2", 215, 255, 0); + public static Color Yellow2 { get; } = new Color(190, 215, 255, 0); /// /// Gets the color "DarkOliveGreen1" (RGB 215,255,95). /// - public static Color DarkOliveGreen1 { get; } = new Color(191, "darkolivegreen1", 215, 255, 95); + public static Color DarkOliveGreen1 { get; } = new Color(191, 215, 255, 95); /// /// Gets the color "DarkOliveGreen1_1" (RGB 215,255,135). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color DarkOliveGreen1_1 { get; } = new Color(192, "darkolivegreen1_1", 215, 255, 135); + public static Color DarkOliveGreen1_1 { get; } = new Color(192, 215, 255, 135); /// /// Gets the color "DarkSeaGreen1_1" (RGB 215,255,175). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color DarkSeaGreen1_1 { get; } = new Color(193, "darkseagreen1_1", 215, 255, 175); + public static Color DarkSeaGreen1_1 { get; } = new Color(193, 215, 255, 175); /// /// Gets the color "Honeydew2" (RGB 215,255,215). /// - public static Color Honeydew2 { get; } = new Color(194, "honeydew2", 215, 255, 215); + public static Color Honeydew2 { get; } = new Color(194, 215, 255, 215); /// /// Gets the color "LightCyan1" (RGB 215,255,255). /// - public static Color LightCyan1 { get; } = new Color(195, "lightcyan1", 215, 255, 255); + public static Color LightCyan1 { get; } = new Color(195, 215, 255, 255); /// /// Gets the color "Red1" (RGB 255,0,0). /// - public static Color Red1 { get; } = new Color(196, "red1", 255, 0, 0); + public static Color Red1 { get; } = new Color(196, 255, 0, 0); /// /// Gets the color "DeepPink2" (RGB 255,0,95). /// - public static Color DeepPink2 { get; } = new Color(197, "deeppink2", 255, 0, 95); + public static Color DeepPink2 { get; } = new Color(197, 255, 0, 95); /// /// Gets the color "DeepPink1" (RGB 255,0,135). /// - public static Color DeepPink1 { get; } = new Color(198, "deeppink1", 255, 0, 135); + public static Color DeepPink1 { get; } = new Color(198, 255, 0, 135); /// /// Gets the color "DeepPink1_1" (RGB 255,0,175). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color DeepPink1_1 { get; } = new Color(199, "deeppink1_1", 255, 0, 175); + public static Color DeepPink1_1 { get; } = new Color(199, 255, 0, 175); /// /// Gets the color "Magenta2_1" (RGB 255,0,215). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color Magenta2_1 { get; } = new Color(200, "magenta2_1", 255, 0, 215); + public static Color Magenta2_1 { get; } = new Color(200, 255, 0, 215); /// /// Gets the color "Magenta1" (RGB 255,0,255). /// - public static Color Magenta1 { get; } = new Color(201, "magenta1", 255, 0, 255); + public static Color Magenta1 { get; } = new Color(201, 255, 0, 255); /// /// Gets the color "OrangeRed1" (RGB 255,95,0). /// - public static Color OrangeRed1 { get; } = new Color(202, "orangered1", 255, 95, 0); + public static Color OrangeRed1 { get; } = new Color(202, 255, 95, 0); /// /// Gets the color "IndianRed1" (RGB 255,95,95). /// - public static Color IndianRed1 { get; } = new Color(203, "indianred1", 255, 95, 95); + public static Color IndianRed1 { get; } = new Color(203, 255, 95, 95); /// /// Gets the color "IndianRed1_1" (RGB 255,95,135). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color IndianRed1_1 { get; } = new Color(204, "indianred1_1", 255, 95, 135); + public static Color IndianRed1_1 { get; } = new Color(204, 255, 95, 135); /// /// Gets the color "HotPink" (RGB 255,95,175). /// - public static Color HotPink { get; } = new Color(205, "hotpink", 255, 95, 175); + public static Color HotPink { get; } = new Color(205, 255, 95, 175); /// /// Gets the color "HotPink_1" (RGB 255,95,215). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color HotPink_1 { get; } = new Color(206, "hotpink_1", 255, 95, 215); + public static Color HotPink_1 { get; } = new Color(206, 255, 95, 215); /// /// Gets the color "MediumOrchid1_1" (RGB 255,95,255). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color MediumOrchid1_1 { get; } = new Color(207, "mediumorchid1_1", 255, 95, 255); + public static Color MediumOrchid1_1 { get; } = new Color(207, 255, 95, 255); /// /// Gets the color "DarkOrange" (RGB 255,135,0). /// - public static Color DarkOrange { get; } = new Color(208, "darkorange", 255, 135, 0); + public static Color DarkOrange { get; } = new Color(208, 255, 135, 0); /// /// Gets the color "Salmon1" (RGB 255,135,95). /// - public static Color Salmon1 { get; } = new Color(209, "salmon1", 255, 135, 95); + public static Color Salmon1 { get; } = new Color(209, 255, 135, 95); /// /// Gets the color "LightCoral" (RGB 255,135,135). /// - public static Color LightCoral { get; } = new Color(210, "lightcoral", 255, 135, 135); + public static Color LightCoral { get; } = new Color(210, 255, 135, 135); /// /// Gets the color "PaleVioletRed1" (RGB 255,135,175). /// - public static Color PaleVioletRed1 { get; } = new Color(211, "palevioletred1", 255, 135, 175); + public static Color PaleVioletRed1 { get; } = new Color(211, 255, 135, 175); /// /// Gets the color "Orchid2" (RGB 255,135,215). /// - public static Color Orchid2 { get; } = new Color(212, "orchid2", 255, 135, 215); + public static Color Orchid2 { get; } = new Color(212, 255, 135, 215); /// /// Gets the color "Orchid1" (RGB 255,135,255). /// - public static Color Orchid1 { get; } = new Color(213, "orchid1", 255, 135, 255); + public static Color Orchid1 { get; } = new Color(213, 255, 135, 255); /// /// Gets the color "Orange1" (RGB 255,175,0). /// - public static Color Orange1 { get; } = new Color(214, "orange1", 255, 175, 0); + public static Color Orange1 { get; } = new Color(214, 255, 175, 0); /// /// Gets the color "SandyBrown" (RGB 255,175,95). /// - public static Color SandyBrown { get; } = new Color(215, "sandybrown", 255, 175, 95); + public static Color SandyBrown { get; } = new Color(215, 255, 175, 95); /// /// Gets the color "LightSalmon1" (RGB 255,175,135). /// - public static Color LightSalmon1 { get; } = new Color(216, "lightsalmon1", 255, 175, 135); + public static Color LightSalmon1 { get; } = new Color(216, 255, 175, 135); /// /// Gets the color "LightPink1" (RGB 255,175,175). /// - public static Color LightPink1 { get; } = new Color(217, "lightpink1", 255, 175, 175); + public static Color LightPink1 { get; } = new Color(217, 255, 175, 175); /// /// Gets the color "Pink1" (RGB 255,175,215). /// - public static Color Pink1 { get; } = new Color(218, "pink1", 255, 175, 215); + public static Color Pink1 { get; } = new Color(218, 255, 175, 215); /// /// Gets the color "Plum1" (RGB 255,175,255). /// - public static Color Plum1 { get; } = new Color(219, "plum1", 255, 175, 255); + public static Color Plum1 { get; } = new Color(219, 255, 175, 255); /// /// Gets the color "Gold1" (RGB 255,215,0). /// - public static Color Gold1 { get; } = new Color(220, "gold1", 255, 215, 0); + public static Color Gold1 { get; } = new Color(220, 255, 215, 0); /// /// Gets the color "LightGoldenrod2_1" (RGB 255,215,95). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color LightGoldenrod2_1 { get; } = new Color(221, "lightgoldenrod2_1", 255, 215, 95); + public static Color LightGoldenrod2_1 { get; } = new Color(221, 255, 215, 95); /// /// Gets the color "LightGoldenrod2_2" (RGB 255,215,135). /// [SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores")] - public static Color LightGoldenrod2_2 { get; } = new Color(222, "lightgoldenrod2_2", 255, 215, 135); + public static Color LightGoldenrod2_2 { get; } = new Color(222, 255, 215, 135); /// /// Gets the color "NavajoWhite1" (RGB 255,215,175). /// - public static Color NavajoWhite1 { get; } = new Color(223, "navajowhite1", 255, 215, 175); + public static Color NavajoWhite1 { get; } = new Color(223, 255, 215, 175); /// /// Gets the color "MistyRose1" (RGB 255,215,215). /// - public static Color MistyRose1 { get; } = new Color(224, "mistyrose1", 255, 215, 215); + public static Color MistyRose1 { get; } = new Color(224, 255, 215, 215); /// /// Gets the color "Thistle1" (RGB 255,215,255). /// - public static Color Thistle1 { get; } = new Color(225, "thistle1", 255, 215, 255); + public static Color Thistle1 { get; } = new Color(225, 255, 215, 255); /// /// Gets the color "Yellow1" (RGB 255,255,0). /// - public static Color Yellow1 { get; } = new Color(226, "yellow1", 255, 255, 0); + public static Color Yellow1 { get; } = new Color(226, 255, 255, 0); /// /// Gets the color "LightGoldenrod1" (RGB 255,255,95). /// - public static Color LightGoldenrod1 { get; } = new Color(227, "lightgoldenrod1", 255, 255, 95); + public static Color LightGoldenrod1 { get; } = new Color(227, 255, 255, 95); /// /// Gets the color "Khaki1" (RGB 255,255,135). /// - public static Color Khaki1 { get; } = new Color(228, "khaki1", 255, 255, 135); + public static Color Khaki1 { get; } = new Color(228, 255, 255, 135); /// /// Gets the color "Wheat1" (RGB 255,255,175). /// - public static Color Wheat1 { get; } = new Color(229, "wheat1", 255, 255, 175); + public static Color Wheat1 { get; } = new Color(229, 255, 255, 175); /// /// Gets the color "Cornsilk1" (RGB 255,255,215). /// - public static Color Cornsilk1 { get; } = new Color(230, "cornsilk1", 255, 255, 215); + public static Color Cornsilk1 { get; } = new Color(230, 255, 255, 215); /// /// Gets the color "Grey100" (RGB 255,255,255). /// - public static Color Grey100 { get; } = new Color(231, "grey100", 255, 255, 255); + public static Color Grey100 { get; } = new Color(231, 255, 255, 255); /// /// Gets the color "Grey3" (RGB 8,8,8). /// - public static Color Grey3 { get; } = new Color(232, "grey3", 8, 8, 8); + public static Color Grey3 { get; } = new Color(232, 8, 8, 8); /// /// Gets the color "Grey7" (RGB 18,18,18). /// - public static Color Grey7 { get; } = new Color(233, "grey7", 18, 18, 18); + public static Color Grey7 { get; } = new Color(233, 18, 18, 18); /// /// Gets the color "Grey11" (RGB 28,28,28). /// - public static Color Grey11 { get; } = new Color(234, "grey11", 28, 28, 28); + public static Color Grey11 { get; } = new Color(234, 28, 28, 28); /// /// Gets the color "Grey15" (RGB 38,38,38). /// - public static Color Grey15 { get; } = new Color(235, "grey15", 38, 38, 38); + public static Color Grey15 { get; } = new Color(235, 38, 38, 38); /// /// Gets the color "Grey19" (RGB 48,48,48). /// - public static Color Grey19 { get; } = new Color(236, "grey19", 48, 48, 48); + public static Color Grey19 { get; } = new Color(236, 48, 48, 48); /// /// Gets the color "Grey23" (RGB 58,58,58). /// - public static Color Grey23 { get; } = new Color(237, "grey23", 58, 58, 58); + public static Color Grey23 { get; } = new Color(237, 58, 58, 58); /// /// Gets the color "Grey27" (RGB 68,68,68). /// - public static Color Grey27 { get; } = new Color(238, "grey27", 68, 68, 68); + public static Color Grey27 { get; } = new Color(238, 68, 68, 68); /// /// Gets the color "Grey30" (RGB 78,78,78). /// - public static Color Grey30 { get; } = new Color(239, "grey30", 78, 78, 78); + public static Color Grey30 { get; } = new Color(239, 78, 78, 78); /// /// Gets the color "Grey35" (RGB 88,88,88). /// - public static Color Grey35 { get; } = new Color(240, "grey35", 88, 88, 88); + public static Color Grey35 { get; } = new Color(240, 88, 88, 88); /// /// Gets the color "Grey39" (RGB 98,98,98). /// - public static Color Grey39 { get; } = new Color(241, "grey39", 98, 98, 98); + public static Color Grey39 { get; } = new Color(241, 98, 98, 98); /// /// Gets the color "Grey42" (RGB 108,108,108). /// - public static Color Grey42 { get; } = new Color(242, "grey42", 108, 108, 108); + public static Color Grey42 { get; } = new Color(242, 108, 108, 108); /// /// Gets the color "Grey46" (RGB 118,118,118). /// - public static Color Grey46 { get; } = new Color(243, "grey46", 118, 118, 118); + public static Color Grey46 { get; } = new Color(243, 118, 118, 118); /// /// Gets the color "Grey50" (RGB 128,128,128). /// - public static Color Grey50 { get; } = new Color(244, "grey50", 128, 128, 128); + public static Color Grey50 { get; } = new Color(244, 128, 128, 128); /// /// Gets the color "Grey54" (RGB 138,138,138). /// - public static Color Grey54 { get; } = new Color(245, "grey54", 138, 138, 138); + public static Color Grey54 { get; } = new Color(245, 138, 138, 138); /// /// Gets the color "Grey58" (RGB 148,148,148). /// - public static Color Grey58 { get; } = new Color(246, "grey58", 148, 148, 148); + public static Color Grey58 { get; } = new Color(246, 148, 148, 148); /// /// Gets the color "Grey62" (RGB 158,158,158). /// - public static Color Grey62 { get; } = new Color(247, "grey62", 158, 158, 158); + public static Color Grey62 { get; } = new Color(247, 158, 158, 158); /// /// Gets the color "Grey66" (RGB 168,168,168). /// - public static Color Grey66 { get; } = new Color(248, "grey66", 168, 168, 168); + public static Color Grey66 { get; } = new Color(248, 168, 168, 168); /// /// Gets the color "Grey70" (RGB 178,178,178). /// - public static Color Grey70 { get; } = new Color(249, "grey70", 178, 178, 178); + public static Color Grey70 { get; } = new Color(249, 178, 178, 178); /// /// Gets the color "Grey74" (RGB 188,188,188). /// - public static Color Grey74 { get; } = new Color(250, "grey74", 188, 188, 188); + public static Color Grey74 { get; } = new Color(250, 188, 188, 188); /// /// Gets the color "Grey78" (RGB 198,198,198). /// - public static Color Grey78 { get; } = new Color(251, "grey78", 198, 198, 198); + public static Color Grey78 { get; } = new Color(251, 198, 198, 198); /// /// Gets the color "Grey82" (RGB 208,208,208). /// - public static Color Grey82 { get; } = new Color(252, "grey82", 208, 208, 208); + public static Color Grey82 { get; } = new Color(252, 208, 208, 208); /// /// Gets the color "Grey85" (RGB 218,218,218). /// - public static Color Grey85 { get; } = new Color(253, "grey85", 218, 218, 218); + public static Color Grey85 { get; } = new Color(253, 218, 218, 218); /// /// Gets the color "Grey89" (RGB 228,228,228). /// - public static Color Grey89 { get; } = new Color(254, "grey89", 228, 228, 228); + public static Color Grey89 { get; } = new Color(254, 228, 228, 228); /// /// Gets the color "Grey93" (RGB 238,238,238). /// - public static Color Grey93 { get; } = new Color(255, "grey93", 238, 238, 238); + public static Color Grey93 { get; } = new Color(255, 238, 238, 238); } } diff --git a/src/Spectre.Console/Color.cs b/src/Spectre.Console/Color.cs index c60d18b..93d6672 100644 --- a/src/Spectre.Console/Color.cs +++ b/src/Spectre.Console/Color.cs @@ -1,7 +1,6 @@ using System; using System.Diagnostics; using System.Globalization; -using System.Linq; using Spectre.Console.Internal; namespace Spectre.Console @@ -18,7 +17,7 @@ namespace Spectre.Console static Color() { - Default = new Color(0, "default", 0, 0, 0, true); + Default = new Color(0, 0, 0, 0, true); } /// @@ -36,11 +35,6 @@ namespace Spectre.Console /// public byte B { get; } - /// - /// Gets the name of the color, if any. - /// - public string Name { get; } - /// /// Gets the number of the color, if any. /// @@ -63,7 +57,6 @@ namespace Spectre.Console G = green; B = blue; IsDefault = false; - Name = null; Number = null; } @@ -89,7 +82,7 @@ namespace Spectre.Console /// public bool Equals(Color other) { - return Number == other.Number || (R == other.R && G == other.G && B == other.B); + return R == other.R && G == other.G && B == other.B; } /// @@ -114,6 +107,15 @@ namespace Spectre.Console return !(left == right); } + /// + /// Convers a to a . + /// + /// The color number to convert. + public static implicit operator Color(int number) + { + return FromInt32(number); + } + /// /// Convers a to a . /// @@ -124,18 +126,12 @@ namespace Spectre.Console } /// - /// Convers a color number into a . + /// Convers a to a . /// - /// The color number. - /// The color representing the specified color number. - public static Color FromColorNumber(int number) + /// The console color to convert. + public static implicit operator ConsoleColor(Color color) { - if (number < 0 || number > 255) - { - throw new InvalidOperationException("Color number must be between 0 and 255"); - } - - return ColorPalette.EightBit.First(x => x.Number == number); + return ToConsoleColor(color); } /// @@ -180,6 +176,16 @@ namespace Spectre.Console }; } + /// + /// Convers a color number into a . + /// + /// The color number. + /// The color representing the specified color number. + public static Color FromInt32(int number) + { + return ColorTable.GetColor(number); + } + /// /// Convers a to a . /// @@ -212,7 +218,16 @@ namespace Spectre.Console /// public override string ToString() { - return Name ?? string.Format(CultureInfo.InvariantCulture, "#{0:2X}{1:2X}{2:2X}", R, G, B); + if (Number != null) + { + var name = ColorTable.GetName(Number.Value); + if (!string.IsNullOrWhiteSpace(name)) + { + return name; + } + } + + return string.Format(CultureInfo.InvariantCulture, "#{0:X2}{1:X2}{2:X2} (RGB={0},{1},{2})", R, G, B); } } } diff --git a/src/Spectre.Console/Internal/Colors/ColorTable.cs b/src/Spectre.Console/Internal/Colors/ColorTable.cs new file mode 100644 index 0000000..12736a3 --- /dev/null +++ b/src/Spectre.Console/Internal/Colors/ColorTable.cs @@ -0,0 +1,120 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; + +namespace Spectre.Console.Internal +{ + internal static class ColorTable + { + private static readonly Dictionary _nameLookup; + private static readonly Dictionary _numberLookup; + + [SuppressMessage("Performance", "CA1810:Initialize reference type static fields inline")] + static ColorTable() + { + _numberLookup = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + { "black", 0 }, { "maroon", 1 }, { "green", 2 }, { "olive", 3 }, { "navy", 4 }, + { "purple", 5 }, { "teal", 6 }, { "silver", 7 }, { "grey", 8 }, + { "red", 9 }, { "lime", 10 }, { "yellow", 11 }, { "blue", 12 }, + { "fuchsia", 13 }, { "aqua", 14 }, { "white", 15 }, { "grey0", 16 }, + { "navyblue", 17 }, { "darkblue", 18 }, { "blue3", 19 }, { "blue3_1", 20 }, + { "blue1", 21 }, { "darkgreen", 22 }, { "deepskyblue4", 23 }, { "deepskyblue4_1", 24 }, + { "deepskyblue4_2", 25 }, { "dodgerblue3", 26 }, { "dodgerblue2", 27 }, { "green4", 28 }, + { "springgreen4", 29 }, { "turquoise4", 30 }, { "deepskyblue3", 31 }, { "deepskyblue3_1", 32 }, + { "dodgerblue1", 33 }, { "green3", 34 }, { "springgreen3", 35 }, { "darkcyan", 36 }, + { "lightseagreen", 37 }, { "deepskyblue2", 38 }, { "deepskyblue1", 39 }, { "green3_1", 40 }, + { "springgreen3_1", 41 }, { "springgreen2", 42 }, { "cyan3", 43 }, { "darkturquoise", 44 }, + { "turquoise2", 45 }, { "green1", 46 }, { "springgreen2_1", 47 }, { "springgreen1", 48 }, + { "mediumspringgreen", 49 }, { "cyan2", 50 }, { "cyan1", 51 }, { "darkred", 52 }, + { "deeppink4", 53 }, { "purple4", 54 }, { "purple4_1", 55 }, { "purple3", 56 }, + { "blueviolet", 57 }, { "orange4", 58 }, { "grey37", 59 }, { "mediumpurple4", 60 }, + { "slateblue3", 61 }, { "slateblue3_1", 62 }, { "royalblue1", 63 }, { "chartreuse4", 64 }, + { "darkseagreen4", 65 }, { "paleturquoise4", 66 }, { "steelblue", 67 }, { "steelblue3", 68 }, + { "cornflowerblue", 69 }, { "chartreuse3", 70 }, { "darkseagreen4_1", 71 }, { "cadetblue", 72 }, + { "cadetblue_1", 73 }, { "skyblue3", 74 }, { "steelblue1", 75 }, { "chartreuse3_1", 76 }, + { "palegreen3", 77 }, { "seagreen3", 78 }, { "aquamarine3", 79 }, { "mediumturquoise", 80 }, + { "steelblue1_1", 81 }, { "chartreuse2", 82 }, { "seagreen2", 83 }, { "seagreen1", 84 }, + { "seagreen1_1", 85 }, { "aquamarine1", 86 }, { "darkslategray2", 87 }, { "darkred_1", 88 }, + { "deeppink4_1", 89 }, { "darkmagenta", 90 }, { "darkmagenta_1", 91 }, { "darkviolet", 92 }, + { "purple_1", 93 }, { "orange4_1", 94 }, { "lightpink4", 95 }, { "plum4", 96 }, + { "mediumpurple3", 97 }, { "mediumpurple3_1", 98 }, { "slateblue1", 99 }, { "yellow4", 100 }, + { "wheat4", 101 }, { "grey53", 102 }, { "lightslategrey", 103 }, { "mediumpurple", 104 }, + { "lightslateblue", 105 }, { "yellow4_1", 106 }, { "darkolivegreen3", 107 }, { "darkseagreen", 108 }, + { "lightskyblue3", 109 }, { "lightskyblue3_1", 110 }, { "skyblue2", 111 }, { "chartreuse2_1", 112 }, + { "darkolivegreen3_1", 113 }, { "palegreen3_1", 114 }, { "darkseagreen3", 115 }, { "darkslategray3", 116 }, + { "skyblue1", 117 }, { "chartreuse1", 118 }, { "lightgreen", 119 }, { "lightgreen_1", 120 }, + { "palegreen1", 121 }, { "aquamarine1_1", 122 }, { "darkslategray1", 123 }, { "red3", 124 }, + { "deeppink4_2", 125 }, { "mediumvioletred", 126 }, { "magenta3", 127 }, { "darkviolet_1", 128 }, + { "purple_2", 129 }, { "darkorange3", 130 }, { "indianred", 131 }, { "hotpink3", 132 }, + { "mediumorchid3", 133 }, { "mediumorchid", 134 }, { "mediumpurple2", 135 }, { "darkgoldenrod", 136 }, + { "lightsalmon3", 137 }, { "rosybrown", 138 }, { "grey63", 139 }, { "mediumpurple2_1", 140 }, + { "mediumpurple1", 141 }, { "gold3", 142 }, { "darkkhaki", 143 }, { "navajowhite3", 144 }, + { "grey69", 145 }, { "lightsteelblue3", 146 }, { "lightsteelblue", 147 }, { "yellow3", 148 }, + { "darkolivegreen3_2", 149 }, { "darkseagreen3_1", 150 }, { "darkseagreen2", 151 }, { "lightcyan3", 152 }, + { "lightskyblue1", 153 }, { "greenyellow", 154 }, { "darkolivegreen2", 155 }, { "palegreen1_1", 156 }, + { "darkseagreen2_1", 157 }, { "darkseagreen1", 158 }, { "paleturquoise1", 159 }, { "red3_1", 160 }, + { "deeppink3", 161 }, { "deeppink3_1", 162 }, { "magenta3_1", 163 }, { "magenta3_2", 164 }, + { "magenta2", 165 }, { "darkorange3_1", 166 }, { "indianred_1", 167 }, { "hotpink3_1", 168 }, + { "hotpink2", 169 }, { "orchid", 170 }, { "mediumorchid1", 171 }, { "orange3", 172 }, + { "lightsalmon3_1", 173 }, { "lightpink3", 174 }, { "pink3", 175 }, { "plum3", 176 }, + { "violet", 177 }, { "gold3_1", 178 }, { "lightgoldenrod3", 179 }, { "tan", 180 }, + { "mistyrose3", 181 }, { "thistle3", 182 }, { "plum2", 183 }, { "yellow3_1", 184 }, + { "khaki3", 185 }, { "lightgoldenrod2", 186 }, { "lightyellow3", 187 }, { "grey84", 188 }, + { "lightsteelblue1", 189 }, { "yellow2", 190 }, { "darkolivegreen1", 191 }, { "darkolivegreen1_1", 192 }, + { "darkseagreen1_1", 193 }, { "honeydew2", 194 }, { "lightcyan1", 195 }, { "red1", 196 }, + { "deeppink2", 197 }, { "deeppink1", 198 }, { "deeppink1_1", 199 }, { "magenta2_1", 200 }, + { "magenta1", 201 }, { "orangered1", 202 }, { "indianred1", 203 }, { "indianred1_1", 204 }, + { "hotpink", 205 }, { "hotpink_1", 206 }, { "mediumorchid1_1", 207 }, { "darkorange", 208 }, + { "salmon1", 209 }, { "lightcoral", 210 }, { "palevioletred1", 211 }, { "orchid2", 212 }, + { "orchid1", 213 }, { "orange1", 214 }, { "sandybrown", 215 }, { "lightsalmon1", 216 }, + { "lightpink1", 217 }, { "pink1", 218 }, { "plum1", 219 }, { "gold1", 220 }, + { "lightgoldenrod2_1", 221 }, { "lightgoldenrod2_2", 222 }, { "navajowhite1", 223 }, { "mistyrose1", 224 }, + { "thistle1", 225 }, { "yellow1", 226 }, { "lightgoldenrod1", 227 }, { "khaki1", 228 }, + { "wheat1", 229 }, { "cornsilk1", 230 }, { "grey100", 231 }, { "grey3", 232 }, + { "grey7", 233 }, { "grey11", 234 }, { "grey15", 235 }, { "grey19", 236 }, + { "grey23", 237 }, { "grey27", 238 }, { "grey30", 239 }, { "grey35", 240 }, + { "grey39", 241 }, { "grey42", 242 }, { "grey46", 243 }, { "grey50", 244 }, + { "grey54", 245 }, { "grey58", 246 }, { "grey62", 247 }, { "grey66", 248 }, + { "grey70", 249 }, { "grey74", 250 }, { "grey78", 251 }, { "grey82", 252 }, + }; + + _nameLookup = new Dictionary(); + foreach (var pair in _numberLookup) + { + _nameLookup.Add(pair.Value, pair.Key); + } + } + + public static Color GetColor(int number) + { + if (number < 0 || number > 255) + { + throw new InvalidOperationException("Color number must be between 0 and 255"); + } + + return ColorPalette.EightBit[number]; + } + + public static Color? GetColor(string name) + { + if (!_numberLookup.TryGetValue(name, out var number)) + { + return null; + } + + if (number > ColorPalette.EightBit.Count - 1) + { + return null; + } + + return ColorPalette.EightBit[number]; + } + + public static string GetName(int number) + { + _nameLookup.TryGetValue(number, out var name); + return name; + } + } +} diff --git a/src/Spectre.Console/Internal/Lookup.cs b/src/Spectre.Console/Internal/StyleTable.cs similarity index 51% rename from src/Spectre.Console/Internal/Lookup.cs rename to src/Spectre.Console/Internal/StyleTable.cs index c228d8f..1784b9f 100644 --- a/src/Spectre.Console/Internal/Lookup.cs +++ b/src/Spectre.Console/Internal/StyleTable.cs @@ -1,17 +1,15 @@ using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; namespace Spectre.Console.Internal { - internal sealed class Lookup + internal static class StyleTable { - private readonly Dictionary _styles; - private readonly Dictionary _colors; + private static readonly Dictionary _styles; - private static readonly Lazy _lazy = new Lazy(() => new Lookup()); - public static Lookup Instance => _lazy.Value; - - private Lookup() + [SuppressMessage("Performance", "CA1810:Initialize reference type static fields inline")] + static StyleTable() { _styles = new Dictionary(StringComparer.OrdinalIgnoreCase) { @@ -25,24 +23,12 @@ namespace Spectre.Console.Internal { "rapidblink", Styles.RapidBlink }, { "strikethrough", Styles.Strikethrough }, }; - - _colors = new Dictionary(StringComparer.OrdinalIgnoreCase); - foreach (var color in ColorPalette.EightBit) - { - _colors.Add(color.Name, color); - } } - public Styles? GetStyle(string name) + public static Styles? GetStyle(string name) { _styles.TryGetValue(name, out var style); return style; } - - public Color? GetColor(string name) - { - _colors.TryGetValue(name, out var color); - return color; - } } } diff --git a/src/Spectre.Console/Internal/Text/Markup/MarkupStyleParser.cs b/src/Spectre.Console/Internal/Text/Markup/MarkupStyleParser.cs index cbd3c68..8620540 100644 --- a/src/Spectre.Console/Internal/Text/Markup/MarkupStyleParser.cs +++ b/src/Spectre.Console/Internal/Text/Markup/MarkupStyleParser.cs @@ -20,7 +20,7 @@ namespace Spectre.Console.Internal continue; } - var style = Lookup.Instance.GetStyle(part); + var style = StyleTable.GetStyle(part); if (style != null) { if (effectiveStyle == null) @@ -32,7 +32,7 @@ namespace Spectre.Console.Internal } else { - var color = Lookup.Instance.GetColor(part); + var color = ColorTable.GetColor(part); if (color == null) { throw new InvalidOperationException("Could not find color..");