浏览代码

ColorNames->ColorName

Tig Kindel 1 年之前
父节点
当前提交
03c16fe893

+ 1 - 1
Terminal.Gui/Application.cs

@@ -54,7 +54,7 @@ namespace Terminal.Gui {
 		public static bool UseSystemConsole { get; set; } = false;
 		public static bool UseSystemConsole { get; set; } = false;
 
 
 		/// <summary>
 		/// <summary>
-		/// Gets or sets whether <see cref="Application.Driver"/> will be forced to output only the 16 colors defined in <see cref="ColorNames"/>.
+		/// Gets or sets whether <see cref="Application.Driver"/> will be forced to output only the 16 colors defined in <see cref="ColorName"/>.
 		/// The default is <see langword="false"/>, meaning 24-bit (TrueColor) colors will be output as long as the selected <see cref="ConsoleDriver"/>
 		/// The default is <see langword="false"/>, meaning 24-bit (TrueColor) colors will be output as long as the selected <see cref="ConsoleDriver"/>
 		/// supports TrueColor.
 		/// supports TrueColor.
 		/// </summary>
 		/// </summary>

+ 1 - 1
Terminal.Gui/Configuration/ColorJsonConverter.cs

@@ -31,7 +31,7 @@ namespace Terminal.Gui {
 				var colorString = reader.GetString ();
 				var colorString = reader.GetString ();
 
 
 				// Check if the color string is a color name
 				// Check if the color string is a color name
-				if (Enum.TryParse (colorString, ignoreCase: true, out ColorNames color)) {
+				if (Enum.TryParse (colorString, ignoreCase: true, out ColorName color)) {
 					// Return the parsed color
 					// Return the parsed color
 					return new Color(color);
 					return new Color(color);
 				}
 				}

+ 36 - 36
Terminal.Gui/ConsoleDrivers/CursesDriver/CursesDriver.cs

@@ -88,7 +88,7 @@ internal class CursesDriver : ConsoleDriver {
 	/// and the background color is stored in the least significant 4 bits.
 	/// and the background color is stored in the least significant 4 bits.
 	/// The Terminal.GUi Color values are converted to curses color encoding before being encoded.
 	/// The Terminal.GUi Color values are converted to curses color encoding before being encoded.
 	/// </remarks>
 	/// </remarks>
-	private Attribute MakeColor (ColorNames foregroundName, ColorNames backgroundName)
+	private Attribute MakeColor (ColorName foregroundName, ColorName backgroundName)
 	{
 	{
 		if (!RunningUnitTests) {
 		if (!RunningUnitTests) {
 			return MakeColor (ColorNameToCursesColorNumber (foregroundName), ColorNameToCursesColorNumber (backgroundName));
 			return MakeColor (ColorNameToCursesColorNumber (foregroundName), ColorNameToCursesColorNumber (backgroundName));
@@ -119,80 +119,80 @@ internal class CursesDriver : ConsoleDriver {
 		}
 		}
 	}
 	}
 
 
-	static short ColorNameToCursesColorNumber (ColorNames color)
+	static short ColorNameToCursesColorNumber (ColorName color)
 	{
 	{
 		switch (color) {
 		switch (color) {
-		case ColorNames.Black:
+		case ColorName.Black:
 			return Curses.COLOR_BLACK;
 			return Curses.COLOR_BLACK;
-		case ColorNames.Blue:
+		case ColorName.Blue:
 			return Curses.COLOR_BLUE;
 			return Curses.COLOR_BLUE;
-		case ColorNames.Green:
+		case ColorName.Green:
 			return Curses.COLOR_GREEN;
 			return Curses.COLOR_GREEN;
-		case ColorNames.Cyan:
+		case ColorName.Cyan:
 			return Curses.COLOR_CYAN;
 			return Curses.COLOR_CYAN;
-		case ColorNames.Red:
+		case ColorName.Red:
 			return Curses.COLOR_RED;
 			return Curses.COLOR_RED;
-		case ColorNames.Magenta:
+		case ColorName.Magenta:
 			return Curses.COLOR_MAGENTA;
 			return Curses.COLOR_MAGENTA;
-		case ColorNames.Yellow:
+		case ColorName.Yellow:
 			return Curses.COLOR_YELLOW;
 			return Curses.COLOR_YELLOW;
-		case ColorNames.Gray:
+		case ColorName.Gray:
 			return Curses.COLOR_WHITE;
 			return Curses.COLOR_WHITE;
-		case ColorNames.DarkGray:
+		case ColorName.DarkGray:
 			return Curses.COLOR_GRAY;
 			return Curses.COLOR_GRAY;
-		case ColorNames.BrightBlue:
+		case ColorName.BrightBlue:
 			return Curses.COLOR_BLUE | Curses.COLOR_GRAY;
 			return Curses.COLOR_BLUE | Curses.COLOR_GRAY;
-		case ColorNames.BrightGreen:
+		case ColorName.BrightGreen:
 			return Curses.COLOR_GREEN | Curses.COLOR_GRAY;
 			return Curses.COLOR_GREEN | Curses.COLOR_GRAY;
-		case ColorNames.BrightCyan:
+		case ColorName.BrightCyan:
 			return Curses.COLOR_CYAN | Curses.COLOR_GRAY;
 			return Curses.COLOR_CYAN | Curses.COLOR_GRAY;
-		case ColorNames.BrightRed:
+		case ColorName.BrightRed:
 			return Curses.COLOR_RED | Curses.COLOR_GRAY;
 			return Curses.COLOR_RED | Curses.COLOR_GRAY;
-		case ColorNames.BrightMagenta:
+		case ColorName.BrightMagenta:
 			return Curses.COLOR_MAGENTA | Curses.COLOR_GRAY;
 			return Curses.COLOR_MAGENTA | Curses.COLOR_GRAY;
-		case ColorNames.BrightYellow:
+		case ColorName.BrightYellow:
 			return Curses.COLOR_YELLOW | Curses.COLOR_GRAY;
 			return Curses.COLOR_YELLOW | Curses.COLOR_GRAY;
-		case ColorNames.White:
+		case ColorName.White:
 			return Curses.COLOR_WHITE | Curses.COLOR_GRAY;
 			return Curses.COLOR_WHITE | Curses.COLOR_GRAY;
 		}
 		}
 		throw new ArgumentException ("Invalid color code");
 		throw new ArgumentException ("Invalid color code");
 	}
 	}
 
 
-	static ColorNames CursesColorNumberToColorName (short color)
+	static ColorName CursesColorNumberToColorName (short color)
 	{
 	{
 		switch (color) {
 		switch (color) {
 		case Curses.COLOR_BLACK:
 		case Curses.COLOR_BLACK:
-			return ColorNames.Black;
+			return ColorName.Black;
 		case Curses.COLOR_BLUE:
 		case Curses.COLOR_BLUE:
-			return ColorNames.Blue;
+			return ColorName.Blue;
 		case Curses.COLOR_GREEN:
 		case Curses.COLOR_GREEN:
-			return ColorNames.Green;
+			return ColorName.Green;
 		case Curses.COLOR_CYAN:
 		case Curses.COLOR_CYAN:
-			return ColorNames.Cyan;
+			return ColorName.Cyan;
 		case Curses.COLOR_RED:
 		case Curses.COLOR_RED:
-			return ColorNames.Red;
+			return ColorName.Red;
 		case Curses.COLOR_MAGENTA:
 		case Curses.COLOR_MAGENTA:
-			return ColorNames.Magenta;
+			return ColorName.Magenta;
 		case Curses.COLOR_YELLOW:
 		case Curses.COLOR_YELLOW:
-			return ColorNames.Yellow;
+			return ColorName.Yellow;
 		case Curses.COLOR_WHITE:
 		case Curses.COLOR_WHITE:
-			return ColorNames.Gray;
+			return ColorName.Gray;
 		case Curses.COLOR_GRAY:
 		case Curses.COLOR_GRAY:
-			return ColorNames.DarkGray;
+			return ColorName.DarkGray;
 		case Curses.COLOR_BLUE | Curses.COLOR_GRAY:
 		case Curses.COLOR_BLUE | Curses.COLOR_GRAY:
-			return ColorNames.BrightBlue;
+			return ColorName.BrightBlue;
 		case Curses.COLOR_GREEN | Curses.COLOR_GRAY:
 		case Curses.COLOR_GREEN | Curses.COLOR_GRAY:
-			return ColorNames.BrightGreen;
+			return ColorName.BrightGreen;
 		case Curses.COLOR_CYAN | Curses.COLOR_GRAY:
 		case Curses.COLOR_CYAN | Curses.COLOR_GRAY:
-			return ColorNames.BrightCyan;
+			return ColorName.BrightCyan;
 		case Curses.COLOR_RED | Curses.COLOR_GRAY:
 		case Curses.COLOR_RED | Curses.COLOR_GRAY:
-			return ColorNames.BrightRed;
+			return ColorName.BrightRed;
 		case Curses.COLOR_MAGENTA | Curses.COLOR_GRAY:
 		case Curses.COLOR_MAGENTA | Curses.COLOR_GRAY:
-			return ColorNames.BrightMagenta;
+			return ColorName.BrightMagenta;
 		case Curses.COLOR_YELLOW | Curses.COLOR_GRAY:
 		case Curses.COLOR_YELLOW | Curses.COLOR_GRAY:
-			return ColorNames.BrightYellow;
+			return ColorName.BrightYellow;
 		case Curses.COLOR_WHITE | Curses.COLOR_GRAY:
 		case Curses.COLOR_WHITE | Curses.COLOR_GRAY:
-			return ColorNames.White;
+			return ColorName.White;
 		}
 		}
 		throw new ArgumentException ("Invalid curses color code");
 		throw new ArgumentException ("Invalid curses color code");
 	}
 	}
@@ -675,7 +675,7 @@ internal class CursesDriver : ConsoleDriver {
 			Curses.UseDefaultColors ();
 			Curses.UseDefaultColors ();
 		}
 		}
 
 
-		CurrentAttribute = MakeColor (ColorNames.White, ColorNames.Black);
+		CurrentAttribute = MakeColor (ColorName.White, ColorName.Black);
 
 
 		TerminalResized = terminalResized;
 		TerminalResized = terminalResized;
 
 

+ 0 - 9
Terminal.Gui/ConsoleDrivers/FakeDriver/FakeDriver.cs

@@ -2,19 +2,12 @@
 // FakeDriver.cs: A fake ConsoleDriver for unit tests. 
 // FakeDriver.cs: A fake ConsoleDriver for unit tests. 
 //
 //
 using System;
 using System;
-using System.Buffers;
-using System.Collections.Generic;
 using System.Diagnostics;
 using System.Diagnostics;
-using System.Linq;
 using System.Runtime.InteropServices;
 using System.Runtime.InteropServices;
-using System.Threading;
 using System.Text;
 using System.Text;
 
 
 // Alias Console to MockConsole so we don't accidentally use Console
 // Alias Console to MockConsole so we don't accidentally use Console
 using Console = Terminal.Gui.FakeConsole;
 using Console = Terminal.Gui.FakeConsole;
-using Unix.Terminal;
-using static Terminal.Gui.WindowsConsole;
-using System.Drawing;
 
 
 namespace Terminal.Gui;
 namespace Terminal.Gui;
 /// <summary>
 /// <summary>
@@ -80,9 +73,7 @@ public class FakeDriver : ConsoleDriver {
 		Rows = FakeConsole.WindowHeight = FakeConsole.BufferHeight = FakeConsole.HEIGHT;
 		Rows = FakeConsole.WindowHeight = FakeConsole.BufferHeight = FakeConsole.HEIGHT;
 		FakeConsole.Clear ();
 		FakeConsole.Clear ();
 		ResizeScreen ();
 		ResizeScreen ();
-		// Call InitializeColorSchemes before UpdateOffScreen as it references Colors
 		CurrentAttribute = new Attribute (Color.White, Color.Black);
 		CurrentAttribute = new Attribute (Color.White, Color.Black);
-		//InitializeColorSchemes ();
 		ClearContents ();
 		ClearContents ();
 	}
 	}
 
 

+ 941 - 941
Terminal.Gui/Drawing/Color.cs

@@ -8,1054 +8,1054 @@ using System.Runtime.CompilerServices;
 using System.Text.Json.Serialization;
 using System.Text.Json.Serialization;
 using System.Text.RegularExpressions;
 using System.Text.RegularExpressions;
 
 
-namespace Terminal.Gui {
+namespace Terminal.Gui;
+/// <summary>
+/// Defines the 16 legacy color names and values that can be used to set the
+/// foreground and background colors in Terminal.Gui apps. Used with <see cref="Color"/>.
+/// </summary>
+/// <remarks>
+/// <para>
+/// These colors match the 16 colors defined for ANSI escape sequences for 4-bit (16) colors.
+/// </para>
+/// <para>
+/// For terminals that support 24-bit color (TrueColor), the RGB values for each of these colors can be configured using the
+/// <see cref="Color.Colors"/> property.
+/// </para>
+/// </remarks>
+public enum ColorName {
 	/// <summary>
 	/// <summary>
-	/// Defines the 16 legacy color names and values that can be used to set the
-	/// foreground and background colors in Terminal.Gui apps. Used with <see cref="Color"/>.
+	/// The black color. ANSI escape sequence: <c>\u001b[30m</c>.
 	/// </summary>
 	/// </summary>
-	/// <remarks>
-	/// <para>
-	/// These colors match the 16 colors defined for ANSI escape sequences for 4-bit (16) colors.
-	/// </para>
-	/// <para>
-	/// For terminals that support 24-bit color (TrueColor), the RGB values for each of these colors can be configured using the
-	/// <see cref="Color.Colors"/> property.
-	/// </para>
-	/// </remarks>
-	public enum ColorNames {
-		/// <summary>
-		/// The black color. ANSI escape sequence: <c>\u001b[30m</c>.
-		/// </summary>
-		Black,
-		/// <summary>
-		/// The blue color. ANSI escape sequence: <c>\u001b[34m</c>.
-		/// </summary>
-		Blue,
-		/// <summary>
-		/// The green color. ANSI escape sequence: <c>\u001b[32m</c>.
-		/// </summary>
-		Green,
-		/// <summary>
-		/// The cyan color. ANSI escape sequence: <c>\u001b[36m</c>.
-		/// </summary>
-		Cyan,
-		/// <summary>
-		/// The red color. ANSI escape sequence: <c>\u001b[31m</c>.
-		/// </summary>
-		Red,
-		/// <summary>
-		/// The magenta color. ANSI escape sequence: <c>\u001b[35m</c>.
-		/// </summary>
-		Magenta,
-		/// <summary>
-		/// The yellow color (also known as Brown). ANSI escape sequence: <c>\u001b[33m</c>.
-		/// </summary>
-		Yellow,
-		/// <summary>
-		/// The gray color (also known as White). ANSI escape sequence: <c>\u001b[37m</c>.
-		/// </summary>
-		Gray,
-		/// <summary>
-		/// The dark gray color (also known as Bright Black). ANSI escape sequence: <c>\u001b[30;1m</c>.
-		/// </summary>
-		DarkGray,
-		/// <summary>
-		/// The bright blue color. ANSI escape sequence: <c>\u001b[34;1m</c>.
-		/// </summary>
-		BrightBlue,
-		/// <summary>
-		/// The bright green color. ANSI escape sequence: <c>\u001b[32;1m</c>.
-		/// </summary>
-		BrightGreen,
-		/// <summary>
-		/// The bright cyan color. ANSI escape sequence: <c>\u001b[36;1m</c>.
-		/// </summary>
-		BrightCyan,
-		/// <summary>
-		/// The bright red color. ANSI escape sequence: <c>\u001b[31;1m</c>.
-		/// </summary>
-		BrightRed,
-		/// <summary>
-		/// The bright magenta color. ANSI escape sequence: <c>\u001b[35;1m</c>.
-		/// </summary>
-		BrightMagenta,
-		/// <summary>
-		/// The bright yellow color. ANSI escape sequence: <c>\u001b[33;1m</c>.
-		/// </summary>
-		BrightYellow,
-		/// <summary>
-		/// The White color (also known as Bright White). ANSI escape sequence: <c>\u001b[37;1m</c>.
-		/// </summary>
-		White
+	Black,
+	/// <summary>
+	/// The blue color. ANSI escape sequence: <c>\u001b[34m</c>.
+	/// </summary>
+	Blue,
+	/// <summary>
+	/// The green color. ANSI escape sequence: <c>\u001b[32m</c>.
+	/// </summary>
+	Green,
+	/// <summary>
+	/// The cyan color. ANSI escape sequence: <c>\u001b[36m</c>.
+	/// </summary>
+	Cyan,
+	/// <summary>
+	/// The red color. ANSI escape sequence: <c>\u001b[31m</c>.
+	/// </summary>
+	Red,
+	/// <summary>
+	/// The magenta color. ANSI escape sequence: <c>\u001b[35m</c>.
+	/// </summary>
+	Magenta,
+	/// <summary>
+	/// The yellow color (also known as Brown). ANSI escape sequence: <c>\u001b[33m</c>.
+	/// </summary>
+	Yellow,
+	/// <summary>
+	/// The gray color (also known as White). ANSI escape sequence: <c>\u001b[37m</c>.
+	/// </summary>
+	Gray,
+	/// <summary>
+	/// The dark gray color (also known as Bright Black). ANSI escape sequence: <c>\u001b[30;1m</c>.
+	/// </summary>
+	DarkGray,
+	/// <summary>
+	/// The bright blue color. ANSI escape sequence: <c>\u001b[34;1m</c>.
+	/// </summary>
+	BrightBlue,
+	/// <summary>
+	/// The bright green color. ANSI escape sequence: <c>\u001b[32;1m</c>.
+	/// </summary>
+	BrightGreen,
+	/// <summary>
+	/// The bright cyan color. ANSI escape sequence: <c>\u001b[36;1m</c>.
+	/// </summary>
+	BrightCyan,
+	/// <summary>
+	/// The bright red color. ANSI escape sequence: <c>\u001b[31;1m</c>.
+	/// </summary>
+	BrightRed,
+	/// <summary>
+	/// The bright magenta color. ANSI escape sequence: <c>\u001b[35;1m</c>.
+	/// </summary>
+	BrightMagenta,
+	/// <summary>
+	/// The bright yellow color. ANSI escape sequence: <c>\u001b[33;1m</c>.
+	/// </summary>
+	BrightYellow,
+	/// <summary>
+	/// The White color (also known as Bright White). ANSI escape sequence: <c>\u001b[37;1m</c>.
+	/// </summary>
+	White
+}
+
+/// <summary>
+/// Represents a 24-bit color. Provides automatic mapping between the legacy 4-bit (16 color) system and 24-bit colors (see <see cref="ColorName"/>).
+/// Used with <see cref="Attribute"/>. 
+/// </summary>
+[JsonConverter (typeof (ColorJsonConverter))]
+public class Color : IEquatable<Color> {
+
+	/// <summary>
+	/// Initializes a new instance of the <see cref="Color"/> class.
+	/// </summary>
+	/// <param name="red">The red 8-bits.</param>
+	/// <param name="green">The green 8-bits.</param>
+	/// <param name="blue">The blue 8-bits.</param>
+	/// <param name="alpha">Optional; defaults to 0xFF. The Alpha channel is not supported by Terminal.Gui.</param>
+	public Color (int red, int green, int blue, int alpha = 0xFF)
+	{
+		R = red;
+		G = green;
+		B = blue;
+		A = alpha;
 	}
 	}
 
 
 	/// <summary>
 	/// <summary>
-	/// Represents a 24-bit color. Provides automatic mapping between the legacy 4-bit (16 color) system and 24-bit colors (see <see cref="ColorName"/>).
-	/// Used with <see cref="Attribute"/>. 
+	/// Initializes a new instance of the <see cref="Color"/> class with an encoded 24-bit color value.
 	/// </summary>
 	/// </summary>
-	[JsonConverter (typeof (ColorJsonConverter))]
-	public class Color : IEquatable<Color> {
-
-		/// <summary>
-		/// Initializes a new instance of the <see cref="Color"/> class.
-		/// </summary>
-		/// <param name="red">The red 8-bits.</param>
-		/// <param name="green">The green 8-bits.</param>
-		/// <param name="blue">The blue 8-bits.</param>
-		/// <param name="alpha">Optional; defaults to 0xFF. The Alpha channel is not supported by Terminal.Gui.</param>
-		public Color (int red, int green, int blue, int alpha = 0xFF)
-		{
-			R = red;
-			G = green;
-			B = blue;
-			A = alpha;
-		}
+	/// <param name="rgba">The encoded 24-bit color value (see <see cref="Rgba"/>).</param>
+	public Color (int rgba)
+	{
+		Rgba = rgba;
+	}
 
 
-		/// <summary>
-		/// Initializes a new instance of the <see cref="Color"/> class with an encoded 24-bit color value.
-		/// </summary>
-		/// <param name="rgba">The encoded 24-bit color value (see <see cref="Rgba"/>).</param>
-		public Color (int rgba)
-		{
-			Rgba = rgba;
-		}
+	/// <summary>
+	/// Initializes a new instance of the <see cref="Color"/> color from a legacy 16-color value.
+	/// </summary>
+	/// <param name="colorName">The 16-color value.</param>
+	public Color (ColorName colorName)
+	{
+		var c = Color.FromColorName (colorName);
+		R = c.R;
+		G = c.G;
+		B = c.B;
+		A = c.A;
+	}
 
 
-		/// <summary>
-		/// Initializes a new instance of the <see cref="Color"/> color from a legacy 16-color value.
-		/// </summary>
-		/// <param name="colorName">The 16-color value.</param>
-		public Color (ColorNames colorName)
-		{
-			var c = Color.FromColorName (colorName);
-			R = c.R;
-			G = c.G;
-			B = c.B;
-			A = c.A;
+	/// <summary>
+	/// Initializes a new instance of the <see cref="Color"/> color from string. See <see cref="TryParse(string, out Color)"/> for details.
+	/// </summary>
+	/// <param name="colorString"></param>
+	/// <exception cref="Exception"></exception>
+	public Color (string colorString)
+	{
+		if (!TryParse (colorString, out var c)) {
+			throw new ArgumentOutOfRangeException (nameof (colorString));
 		}
 		}
+		R = c.R;
+		G = c.G;
+		B = c.B;
+		A = c.A;
+	}
 
 
-		/// <summary>
-		/// Initializes a new instance of the <see cref="Color"/> color from string. See <see cref="TryParse(string, out Color)"/> for details.
-		/// </summary>
-		/// <param name="colorString"></param>
-		/// <exception cref="Exception"></exception>
-		public Color (string colorString)
-		{
-			if (!TryParse (colorString, out var c)) {
-				throw new ArgumentOutOfRangeException (nameof (colorString));
-			}
-			R = c.R;
-			G = c.G;
-			B = c.B;
-			A = c.A;
-		}
+	/// <summary>
+	/// Initializes a new instance of the <see cref="Color"/>.
+	/// </summary>
+	public Color ()
+	{
+		R = 0;
+		G = 0;
+		B = 0;
+		A = 0xFF;
+	}
 
 
-		/// <summary>
-		/// Initializes a new instance of the <see cref="Color"/>.
-		/// </summary>
-		public Color ()
-		{
-			R = 0;
-			G = 0;
-			B = 0;
-			A = 0xFF;
-		}
+	/// <summary>
+	/// Red color component.
+	/// </summary>
+	public int R { get; set; }
+	/// <summary>
+	/// Green color component.
+	/// </summary>
+	public int G { get; set; }
+	/// <summary>
+	/// Blue color component.
+	/// </summary>
+	public int B { get; set; }
 
 
-		/// <summary>
-		/// Red color component.
-		/// </summary>
-		public int R { get; set; }
-		/// <summary>
-		/// Green color component.
-		/// </summary>
-		public int G { get; set; }
-		/// <summary>
-		/// Blue color component.
-		/// </summary>
-		public int B { get; set; }
-
-		/// <summary>
-		/// Alpha color component.
-		/// </summary>
-		/// <remarks>
-		/// The Alpha channel is not supported by Terminal.Gui.
-		/// </remarks>
-		public int A { get; set; } = 0xFF; // Not currently supported; here for completeness.
-
-		/// <summary>
-		/// Gets or sets the color value encoded as ARGB32.
-		/// <code>
-		/// (&lt;see cref="A"/&gt; &lt;&lt; 24) | (&lt;see cref="R"/&gt; &lt;&lt; 16) | (&lt;see cref="G"/&gt; &lt;&lt; 8) | &lt;see cref="B"/&gt;
-		/// </code>
-		/// </summary>
-		public int Rgba {
-			get => (A << 24) | (R << 16) | (G << 8) | B;
-			set {
-				A = (byte)((value >> 24) & 0xFF);
-				R = (byte)((value >> 16) & 0xFF);
-				G = (byte)((value >> 8) & 0xFF);
-				B = (byte)(value & 0xFF);
-			}
+	/// <summary>
+	/// Alpha color component.
+	/// </summary>
+	/// <remarks>
+	/// The Alpha channel is not supported by Terminal.Gui.
+	/// </remarks>
+	public int A { get; set; } = 0xFF; // Not currently supported; here for completeness.
+
+	/// <summary>
+	/// Gets or sets the color value encoded as ARGB32.
+	/// <code>
+	/// (&lt;see cref="A"/&gt; &lt;&lt; 24) | (&lt;see cref="R"/&gt; &lt;&lt; 16) | (&lt;see cref="G"/&gt; &lt;&lt; 8) | &lt;see cref="B"/&gt;
+	/// </code>
+	/// </summary>
+	public int Rgba {
+		get => (A << 24) | (R << 16) | (G << 8) | B;
+		set {
+			A = (byte)((value >> 24) & 0xFF);
+			R = (byte)((value >> 16) & 0xFF);
+			G = (byte)((value >> 8) & 0xFF);
+			B = (byte)(value & 0xFF);
 		}
 		}
+	}
 
 
-		// TODO: Make this map configurable via ConfigurationManager
-		// TODO: This does not need to be a Dictionary, but can be an 16 element array.
-		/// <summary>
-		/// Maps legacy 16-color values to the corresponding 24-bit RGB value.
-		/// </summary>
-		internal static ImmutableDictionary<Color, ColorNames> _colorToNameMap = new Dictionary<Color, ColorNames> () {
+	// TODO: Make this map configurable via ConfigurationManager
+	// TODO: This does not need to be a Dictionary, but can be an 16 element array.
+	/// <summary>
+	/// Maps legacy 16-color values to the corresponding 24-bit RGB value.
+	/// </summary>
+	internal static ImmutableDictionary<Color, ColorName> _colorToNameMap = new Dictionary<Color, ColorName> () {
 			// using "Windows 10 Console/PowerShell 6" here: https://i.stack.imgur.com/9UVnC.png
 			// using "Windows 10 Console/PowerShell 6" here: https://i.stack.imgur.com/9UVnC.png
 			// See also: https://en.wikipedia.org/wiki/ANSI_escape_code
 			// See also: https://en.wikipedia.org/wiki/ANSI_escape_code
-			{ new Color (12, 12, 12),ColorNames.Black },
-			{ new Color (0, 55, 218),ColorNames.Blue },
-			{ new Color (19, 161, 14),ColorNames.Green},
-			{ new Color (58, 150, 221),ColorNames.Cyan},
-			{ new Color (197, 15, 31),ColorNames.Red},
-			{ new Color (136, 23, 152),ColorNames.Magenta},
-			{ new Color (128, 64, 32),ColorNames.Yellow},
-			{ new Color (204, 204, 204),ColorNames.Gray},
-			{ new Color (118, 118, 118),ColorNames.DarkGray},
-			{ new Color (59, 120, 255),ColorNames.BrightBlue},
-			{ new Color (22, 198, 12),ColorNames.BrightGreen},
-			{ new Color (97, 214, 214),ColorNames.BrightCyan},
-			{ new Color (231, 72, 86),ColorNames.BrightRed},
-			{ new Color (180, 0, 158),ColorNames.BrightMagenta },
-			{ new Color (249, 241, 165),ColorNames.BrightYellow},
-			{ new Color (242, 242, 242),ColorNames.White},
+			{ new Color (12, 12, 12),Gui.ColorName.Black },
+			{ new Color (0, 55, 218),Gui.ColorName.Blue },
+			{ new Color (19, 161, 14),Gui.ColorName.Green},
+			{ new Color (58, 150, 221),Gui.ColorName.Cyan},
+			{ new Color (197, 15, 31),Gui.ColorName.Red},
+			{ new Color (136, 23, 152),Gui.ColorName.Magenta},
+			{ new Color (128, 64, 32),Gui.ColorName.Yellow},
+			{ new Color (204, 204, 204),Gui.ColorName.Gray},
+			{ new Color (118, 118, 118),Gui.ColorName.DarkGray},
+			{ new Color (59, 120, 255),Gui.ColorName.BrightBlue},
+			{ new Color (22, 198, 12),Gui.ColorName.BrightGreen},
+			{ new Color (97, 214, 214),Gui.ColorName.BrightCyan},
+			{ new Color (231, 72, 86),Gui.ColorName.BrightRed},
+			{ new Color (180, 0, 158),Gui.ColorName.BrightMagenta },
+			{ new Color (249, 241, 165),Gui.ColorName.BrightYellow},
+			{ new Color (242, 242, 242),Gui.ColorName.White},
 		}.ToImmutableDictionary ();
 		}.ToImmutableDictionary ();
 
 
-		[SerializableConfigurationProperty (Scope = typeof (SettingsScope), OmitClassName = true)]
-		//[JsonConverter (typeof (DictionaryJsonConverter<string>))]
-		public static Dictionary<ColorNames, string> Colors {
-			get {
-				// Transform _colorToNameMap into a Dictionary<ColorNames,string>
-				return _colorToNameMap.ToDictionary (kvp => kvp.Value, kvp => $"#{kvp.Key.R:X2}{kvp.Key.G:X2}{kvp.Key.B:X2}");
-			}
-			set {
-				// Transform Dictionary<ColorNames,string> into _colorToNameMap
-				var newMap = value.ToDictionary (kvp => new Color (kvp.Value), kvp => {
-					if (Enum.TryParse<ColorNames> (kvp.Key.ToString(), ignoreCase: true, out ColorNames colorName)) {
-						return colorName;
-					}
-					throw new ArgumentException ($"Invalid color name: {kvp.Key}");
-				});
-				_colorToNameMap = newMap.ToImmutableDictionary ();
-			}
+	/// <summary>
+	/// Gets or sets the 24-bit color value for each of the legacy 16-color values.
+	/// </summary>
+	[SerializableConfigurationProperty (Scope = typeof (SettingsScope), OmitClassName = true)]
+	public static Dictionary<ColorName, string> Colors {
+		get {
+			// Transform _colorToNameMap into a Dictionary<ColorNames,string>
+			return _colorToNameMap.ToDictionary (kvp => kvp.Value, kvp => $"#{kvp.Key.R:X2}{kvp.Key.G:X2}{kvp.Key.B:X2}");
 		}
 		}
-
-		/// <summary>
-		/// Converts a legacy <see cref="ColorNames"/> to a 24-bit <see cref="Color"/>.
-		/// </summary>
-		/// <param name="consoleColor">The <see cref="Color"/> to convert.</param>
-		/// <returns></returns>
-		private static Color FromColorName (ColorNames consoleColor) => _colorToNameMap.FirstOrDefault (x => x.Value == consoleColor).Key;
-
-		// Iterates through the entries in the _colorNames dictionary, calculates the
-		// Euclidean distance between the input color and each dictionary color in RGB space,
-		// and keeps track of the closest entry found so far. The function returns a KeyValuePair
-		// representing the closest color entry and its associated color name.
-		internal static ColorNames FindClosestColor (Color inputColor)
-		{
-			ColorNames closestColor = ColorNames.Black; // Default to Black
-			double closestDistance = double.MaxValue;
-
-			foreach (var colorEntry in _colorToNameMap) {
-				var distance = CalculateColorDistance (inputColor, colorEntry.Key);
-				if (distance < closestDistance) {
-					closestDistance = distance;
-					closestColor = colorEntry.Value;
+		set {
+			// Transform Dictionary<ColorNames,string> into _colorToNameMap
+			var newMap = value.ToDictionary (kvp => new Color (kvp.Value), kvp => {
+				if (Enum.TryParse<ColorName> (kvp.Key.ToString (), ignoreCase: true, out ColorName colorName)) {
+					return colorName;
 				}
 				}
-			}
+				throw new ArgumentException ($"Invalid color name: {kvp.Key}");
+			});
+			_colorToNameMap = newMap.ToImmutableDictionary ();
+		}
+	}
 
 
-			return closestColor;
+	/// <summary>
+	/// Converts a legacy <see cref="Gui.ColorName"/> to a 24-bit <see cref="Color"/>.
+	/// </summary>
+	/// <param name="consoleColor">The <see cref="Color"/> to convert.</param>
+	/// <returns></returns>
+	private static Color FromColorName (ColorName consoleColor) => _colorToNameMap.FirstOrDefault (x => x.Value == consoleColor).Key;
+
+	// Iterates through the entries in the _colorNames dictionary, calculates the
+	// Euclidean distance between the input color and each dictionary color in RGB space,
+	// and keeps track of the closest entry found so far. The function returns a KeyValuePair
+	// representing the closest color entry and its associated color name.
+	internal static ColorName FindClosestColor (Color inputColor)
+	{
+		ColorName closestColor = Gui.ColorName.Black; // Default to Black
+		double closestDistance = double.MaxValue;
+
+		foreach (var colorEntry in _colorToNameMap) {
+			var distance = CalculateColorDistance (inputColor, colorEntry.Key);
+			if (distance < closestDistance) {
+				closestDistance = distance;
+				closestColor = colorEntry.Value;
+			}
 		}
 		}
 
 
-		private static double CalculateColorDistance (Color color1, Color color2)
-		{
-			// Calculate the Euclidean distance between two colors
-			var deltaR = (double)color1.R - (double)color2.R;
-			var deltaG = (double)color1.G - (double)color2.G;
-			var deltaB = (double)color1.B - (double)color2.B;
+		return closestColor;
+	}
 
 
-			return Math.Sqrt (deltaR * deltaR + deltaG * deltaG + deltaB * deltaB);
-		}
+	private static double CalculateColorDistance (Color color1, Color color2)
+	{
+		// Calculate the Euclidean distance between two colors
+		var deltaR = (double)color1.R - (double)color2.R;
+		var deltaG = (double)color1.G - (double)color2.G;
+		var deltaB = (double)color1.B - (double)color2.B;
 
 
-		/// <summary>
-		/// Gets or sets the <see cref="Color"/> using a legacy 16-color <see cref="ColorNames"/> value.
-		/// </summary>
-		/// <remarks>
-		/// Get returns the <see cref="ColorName"/> of the closest 24-bit color value. Set sets the RGB value using a hard-coded map.
-		/// </remarks>
-		public ColorNames ColorName {
-			get => FindClosestColor (this);
-			set {
-
-				var c = FromColorName (value);
-				R = c.R;
-				G = c.G;
-				B = c.B;
-				A = c.A;
-			}
+		return Math.Sqrt (deltaR * deltaR + deltaG * deltaG + deltaB * deltaB);
+	}
+
+	/// <summary>
+	/// Gets or sets the <see cref="Color"/> using a legacy 16-color <see cref="Gui.ColorName"/> value.
+	/// </summary>
+	/// <remarks>
+	/// Get returns the <see cref="ColorName"/> of the closest 24-bit color value. Set sets the RGB value using a hard-coded map.
+	/// </remarks>
+	public ColorName ColorName {
+		get => FindClosestColor (this);
+		set {
+
+			var c = FromColorName (value);
+			R = c.R;
+			G = c.G;
+			B = c.B;
+			A = c.A;
 		}
 		}
+	}
 
 
-		#region Legacy Color Names
-		/// <summary>
-		/// 
-		/// The black color.
-		/// </summary>
-		public const ColorNames Black = ColorNames.Black;
-
-		/// <summary>
-		/// The blue color.
-		/// </summary>
-		public const ColorNames Blue = ColorNames.Blue;
-		/// <summary>
-		/// The green color.
-		/// </summary>
-		public const ColorNames Green = ColorNames.Green;
-		/// <summary>
-		/// The cyan color.
-		/// </summary>
-		public const ColorNames Cyan = ColorNames.Cyan;
-		/// <summary>
-		/// The red color.
-		/// </summary>
-		public const ColorNames Red = ColorNames.Red;
-		/// <summary>
-		/// The magenta color.
-		/// </summary>
-		public const ColorNames Magenta = ColorNames.Magenta;
-		/// <summary>
-		/// The yellow color.
-		/// </summary>
-		public const ColorNames Yellow = ColorNames.Yellow;
-		/// <summary>
-		/// The gray color.
-		/// </summary>
-		public const ColorNames Gray = ColorNames.Gray;
-		/// <summary>
-		/// The dark gray color.
-		/// </summary>
-		public const ColorNames DarkGray = ColorNames.DarkGray;
-		/// <summary>
-		/// The bright bBlue color.
-		/// </summary>
-		public const ColorNames BrightBlue = ColorNames.BrightBlue;
-		/// <summary>
-		/// The bright green color.
-		/// </summary>
-		public const ColorNames BrightGreen = ColorNames.BrightGreen;
-		/// <summary>
-		/// The bright cyan color.
-		/// </summary>
-		public const ColorNames BrightCyan = ColorNames.BrightCyan;
-		/// <summary>
-		/// The bright red color.
-		/// </summary>
-		public const ColorNames BrightRed = ColorNames.BrightRed;
-		/// <summary>
-		/// The bright magenta color.
-		/// </summary>
-		public const ColorNames BrightMagenta = ColorNames.BrightMagenta;
-		/// <summary>
-		/// The bright yellow color.
-		/// </summary>
-		public const ColorNames BrightYellow = ColorNames.BrightYellow;
-		/// <summary>
-		/// The White color.
-		/// </summary>
-		public const ColorNames White = ColorNames.White;
-		#endregion
-
-		/// <summary>
-		/// Converts the provided string to a new <see cref="Color"/> instance.
-		/// </summary>
-		/// <param name="text">The text to analyze. Formats supported are
-		/// "#RGB", "#RRGGBB", "#RGBA", "#RRGGBBAA", "rgb(r,g,b)", "rgb(r,g,b,a)", and any of the
-		/// <see cref="ColorNames"/>.</param>
-		/// <param name="color">The parsed value.</param>
-		/// <returns>A boolean value indicating whether parsing was successful.</returns>
-		/// <remarks>
-		/// While <see cref="Color"/> supports the alpha channel <see cref="A"/>, Terminal.Gui does not.
-		/// </remarks>
-		public static bool TryParse (string text, [NotNullWhen (true)] out Color color)
-		{
-			// empty color
-			if ((text == null) || (text.Length == 0)) {
-				color = null;
-				return false;
-			}
+	#region Legacy Color Names
+	/// <summary>
+	/// 
+	/// The black color.
+	/// </summary>
+	public const ColorName Black = ColorName.Black;
 
 
-			// #RRGGBB, #RGB
-			if ((text [0] == '#') && text.Length is 7 or 4) {
-				if (text.Length == 7) {
-					var r = Convert.ToInt32 (text.Substring (1, 2), 16);
-					var g = Convert.ToInt32 (text.Substring (3, 2), 16);
-					var b = Convert.ToInt32 (text.Substring (5, 2), 16);
-					color = new Color (r, g, b);
-				} else {
-					var rText = char.ToString (text [1]);
-					var gText = char.ToString (text [2]);
-					var bText = char.ToString (text [3]);
-
-					var r = Convert.ToInt32 (rText + rText, 16);
-					var g = Convert.ToInt32 (gText + gText, 16);
-					var b = Convert.ToInt32 (bText + bText, 16);
-					color = new Color (r, g, b);
-				}
-				return true;
-			}
+	/// <summary>
+	/// The blue color.
+	/// </summary>
+	public const ColorName Blue = ColorName.Blue;
+	/// <summary>
+	/// The green color.
+	/// </summary>
+	public const ColorName Green = ColorName.Green;
+	/// <summary>
+	/// The cyan color.
+	/// </summary>
+	public const ColorName Cyan = ColorName.Cyan;
+	/// <summary>
+	/// The red color.
+	/// </summary>
+	public const ColorName Red = ColorName.Red;
+	/// <summary>
+	/// The magenta color.
+	/// </summary>
+	public const ColorName Magenta = ColorName.Magenta;
+	/// <summary>
+	/// The yellow color.
+	/// </summary>
+	public const ColorName Yellow = ColorName.Yellow;
+	/// <summary>
+	/// The gray color.
+	/// </summary>
+	public const ColorName Gray = ColorName.Gray;
+	/// <summary>
+	/// The dark gray color.
+	/// </summary>
+	public const ColorName DarkGray = ColorName.DarkGray;
+	/// <summary>
+	/// The bright bBlue color.
+	/// </summary>
+	public const ColorName BrightBlue = ColorName.BrightBlue;
+	/// <summary>
+	/// The bright green color.
+	/// </summary>
+	public const ColorName BrightGreen = ColorName.BrightGreen;
+	/// <summary>
+	/// The bright cyan color.
+	/// </summary>
+	public const ColorName BrightCyan = ColorName.BrightCyan;
+	/// <summary>
+	/// The bright red color.
+	/// </summary>
+	public const ColorName BrightRed = ColorName.BrightRed;
+	/// <summary>
+	/// The bright magenta color.
+	/// </summary>
+	public const ColorName BrightMagenta = ColorName.BrightMagenta;
+	/// <summary>
+	/// The bright yellow color.
+	/// </summary>
+	public const ColorName BrightYellow = ColorName.BrightYellow;
+	/// <summary>
+	/// The White color.
+	/// </summary>
+	public const ColorName White = ColorName.White;
+	#endregion
 
 
-			// #RRGGBB, #RGBA
-			if ((text [0] == '#') && text.Length is 8 or 5) {
-				if (text.Length == 7) {
-					var r = Convert.ToInt32 (text.Substring (1, 2), 16);
-					var g = Convert.ToInt32 (text.Substring (3, 2), 16);
-					var b = Convert.ToInt32 (text.Substring (5, 2), 16);
-					var a = Convert.ToInt32 (text.Substring (7, 2), 16);
-					color = new Color (a, r, g, b);
-				} else {
-					var rText = char.ToString (text [1]);
-					var gText = char.ToString (text [2]);
-					var bText = char.ToString (text [3]);
-					var aText = char.ToString (text [4]);
-
-					var r = Convert.ToInt32 (aText + aText, 16);
-					var g = Convert.ToInt32 (rText + rText, 16);
-					var b = Convert.ToInt32 (gText + gText, 16);
-					var a = Convert.ToInt32 (bText + bText, 16);
-					color = new Color (r, g, b, a);
-				}
-				return true;
-			}
+	/// <summary>
+	/// Converts the provided string to a new <see cref="Color"/> instance.
+	/// </summary>
+	/// <param name="text">The text to analyze. Formats supported are
+	/// "#RGB", "#RRGGBB", "#RGBA", "#RRGGBBAA", "rgb(r,g,b)", "rgb(r,g,b,a)", and any of the
+	/// <see cref="Gui.ColorName"/>.</param>
+	/// <param name="color">The parsed value.</param>
+	/// <returns>A boolean value indicating whether parsing was successful.</returns>
+	/// <remarks>
+	/// While <see cref="Color"/> supports the alpha channel <see cref="A"/>, Terminal.Gui does not.
+	/// </remarks>
+	public static bool TryParse (string text, [NotNullWhen (true)] out Color color)
+	{
+		// empty color
+		if ((text == null) || (text.Length == 0)) {
+			color = null;
+			return false;
+		}
 
 
-			// rgb(r,g,b)
-			var match = Regex.Match (text, @"rgb\((\d+),(\d+),(\d+)\)");
-			if (match.Success) {
-				var r = int.Parse (match.Groups [1].Value);
-				var g = int.Parse (match.Groups [2].Value);
-				var b = int.Parse (match.Groups [3].Value);
+		// #RRGGBB, #RGB
+		if ((text [0] == '#') && text.Length is 7 or 4) {
+			if (text.Length == 7) {
+				var r = Convert.ToInt32 (text.Substring (1, 2), 16);
+				var g = Convert.ToInt32 (text.Substring (3, 2), 16);
+				var b = Convert.ToInt32 (text.Substring (5, 2), 16);
+				color = new Color (r, g, b);
+			} else {
+				var rText = char.ToString (text [1]);
+				var gText = char.ToString (text [2]);
+				var bText = char.ToString (text [3]);
+
+				var r = Convert.ToInt32 (rText + rText, 16);
+				var g = Convert.ToInt32 (gText + gText, 16);
+				var b = Convert.ToInt32 (bText + bText, 16);
 				color = new Color (r, g, b);
 				color = new Color (r, g, b);
-				return true;
 			}
 			}
+			return true;
+		}
 
 
-			// rgb(r,g,b,a)
-			match = Regex.Match (text, @"rgb\((\d+),(\d+),(\d+),(\d+)\)");
-			if (match.Success) {
-				var r = int.Parse (match.Groups [1].Value);
-				var g = int.Parse (match.Groups [2].Value);
-				var b = int.Parse (match.Groups [3].Value);
-				var a = int.Parse (match.Groups [4].Value);
+		// #RRGGBB, #RGBA
+		if ((text [0] == '#') && text.Length is 8 or 5) {
+			if (text.Length == 7) {
+				var r = Convert.ToInt32 (text.Substring (1, 2), 16);
+				var g = Convert.ToInt32 (text.Substring (3, 2), 16);
+				var b = Convert.ToInt32 (text.Substring (5, 2), 16);
+				var a = Convert.ToInt32 (text.Substring (7, 2), 16);
+				color = new Color (a, r, g, b);
+			} else {
+				var rText = char.ToString (text [1]);
+				var gText = char.ToString (text [2]);
+				var bText = char.ToString (text [3]);
+				var aText = char.ToString (text [4]);
+
+				var r = Convert.ToInt32 (aText + aText, 16);
+				var g = Convert.ToInt32 (rText + rText, 16);
+				var b = Convert.ToInt32 (gText + gText, 16);
+				var a = Convert.ToInt32 (bText + bText, 16);
 				color = new Color (r, g, b, a);
 				color = new Color (r, g, b, a);
-				return true;
 			}
 			}
-
-			if (Enum.TryParse<ColorNames> (text, ignoreCase: true, out ColorNames colorName)) {
-				color = new Color (colorName);
-				return true;
-			}
-
-			color = null;
-			return false;
+			return true;
 		}
 		}
 
 
-		#region Operators
-		/// <summary>
-		/// Cast from int.
-		/// </summary>
-		/// <param name="rgba"></param>
-		public static implicit operator Color (int rgba)
-		{
-			return new Color (rgba);
+		// rgb(r,g,b)
+		var match = Regex.Match (text, @"rgb\((\d+),(\d+),(\d+)\)");
+		if (match.Success) {
+			var r = int.Parse (match.Groups [1].Value);
+			var g = int.Parse (match.Groups [2].Value);
+			var b = int.Parse (match.Groups [3].Value);
+			color = new Color (r, g, b);
+			return true;
 		}
 		}
 
 
-		/// <summary>
-		/// Cast to int.
-		/// </summary>
-		/// <param name="color"></param>
-		public static explicit operator int (Color color)
-		{
-			return color.Rgba;
+		// rgb(r,g,b,a)
+		match = Regex.Match (text, @"rgb\((\d+),(\d+),(\d+),(\d+)\)");
+		if (match.Success) {
+			var r = int.Parse (match.Groups [1].Value);
+			var g = int.Parse (match.Groups [2].Value);
+			var b = int.Parse (match.Groups [3].Value);
+			var a = int.Parse (match.Groups [4].Value);
+			color = new Color (r, g, b, a);
+			return true;
 		}
 		}
 
 
-		/// <summary>
-		/// Cast from <see cref="ColorNames"/>.
-		/// </summary>
-		/// <param name="colorName"></param>
-		public static explicit operator Color (ColorNames colorName)
-		{
-			return new Color (colorName);
+		if (Enum.TryParse<ColorName> (text, ignoreCase: true, out ColorName colorName)) {
+			color = new Color (colorName);
+			return true;
 		}
 		}
 
 
-		/// <summary>
-		/// Cast to <see cref="ColorNames"/>.
-		/// </summary>
-		/// <param name="color"></param>
-		public static explicit operator ColorNames (Color color)
-		{
-			return color.ColorName;
-		}
+		color = null;
+		return false;
+	}
 
 
+	#region Operators
+	/// <summary>
+	/// Cast from int.
+	/// </summary>
+	/// <param name="rgba"></param>
+	public static implicit operator Color (int rgba)
+	{
+		return new Color (rgba);
+	}
 
 
-		/// <summary>
-		/// Equality operator for two <see cref="Color"/> objects..
-		/// </summary>
-		/// <param name="left"></param>
-		/// <param name="right"></param>
-		/// <returns></returns>
-		public static bool operator == (Color left, Color right)
-		{
-			if (left is null && right is null)
-				return true;
+	/// <summary>
+	/// Cast to int.
+	/// </summary>
+	/// <param name="color"></param>
+	public static explicit operator int (Color color)
+	{
+		return color.Rgba;
+	}
 
 
-			if (left is null || right is null)
-				return false;
+	/// <summary>
+	/// Cast from <see cref="Gui.ColorName"/>.
+	/// </summary>
+	/// <param name="colorName"></param>
+	public static explicit operator Color (ColorName colorName)
+	{
+		return new Color (colorName);
+	}
 
 
-			return left.Equals (right);
-		}
+	/// <summary>
+	/// Cast to <see cref="Gui.ColorName"/>.
+	/// </summary>
+	/// <param name="color"></param>
+	public static explicit operator ColorName (Color color)
+	{
+		return color.ColorName;
+	}
 
 
 
 
-		/// <summary>
-		/// Inequality operator for two <see cref="Color"/> objects.
-		/// </summary>
-		/// <param name="left"></param>
-		/// <param name="right"></param>
-		/// <returns></returns>
-		public static bool operator != (Color left, Color right)
-		{
-			if (left is null && right is null)
-				return false;
+	/// <summary>
+	/// Equality operator for two <see cref="Color"/> objects..
+	/// </summary>
+	/// <param name="left"></param>
+	/// <param name="right"></param>
+	/// <returns></returns>
+	public static bool operator == (Color left, Color right)
+	{
+		if (left is null && right is null)
+			return true;
+
+		if (left is null || right is null)
+			return false;
 
 
-			if (left is null || right is null)
-				return true;
+		return left.Equals (right);
+	}
 
 
-			return !left.Equals (right);
-		}
 
 
-		/// <summary>
-		/// Equality operator for <see cref="Color"/> and <see cref="ColorNames"/> objects.
-		/// </summary>
-		/// <param name="left"></param>
-		/// <param name="right"></param>
-		/// <returns></returns>
-		public static bool operator == (ColorNames left, Color right)
-		{
-			return left == right.ColorName;
-		}
+	/// <summary>
+	/// Inequality operator for two <see cref="Color"/> objects.
+	/// </summary>
+	/// <param name="left"></param>
+	/// <param name="right"></param>
+	/// <returns></returns>
+	public static bool operator != (Color left, Color right)
+	{
+		if (left is null && right is null)
+			return false;
 
 
-		/// <summary>
-		/// Inequality operator for <see cref="Color"/> and <see cref="ColorNames"/> objects.
-		/// </summary>
-		/// <param name="left"></param>
-		/// <param name="right"></param>
-		/// <returns></returns>
-		public static bool operator != (ColorNames left, Color right)
-		{
-			return left != right.ColorName;
-		}
+		if (left is null || right is null)
+			return true;
 
 
-		/// <summary>
-		/// Equality operator for <see cref="Color"/> and <see cref="ColorNames"/> objects.
-		/// </summary>
-		/// <param name="left"></param>
-		/// <param name="right"></param>
-		/// <returns></returns>
-		public static bool operator == (Color left, ColorNames right)
-		{
-			return left.ColorName == right;
-		}
+		return !left.Equals (right);
+	}
 
 
-		/// <summary>
-		/// Inequality operator for <see cref="Color"/> and <see cref="ColorNames"/> objects.
-		/// </summary>
-		/// <param name="left"></param>
-		/// <param name="right"></param>
-		/// <returns></returns>
-		public static bool operator != (Color left, ColorNames right)
-		{
-			return left.ColorName != right;
-		}
+	/// <summary>
+	/// Equality operator for <see cref="Color"/> and <see cref="Gui.ColorName"/> objects.
+	/// </summary>
+	/// <param name="left"></param>
+	/// <param name="right"></param>
+	/// <returns></returns>
+	public static bool operator == (ColorName left, Color right)
+	{
+		return left == right.ColorName;
+	}
 
 
+	/// <summary>
+	/// Inequality operator for <see cref="Color"/> and <see cref="Gui.ColorName"/> objects.
+	/// </summary>
+	/// <param name="left"></param>
+	/// <param name="right"></param>
+	/// <returns></returns>
+	public static bool operator != (ColorName left, Color right)
+	{
+		return left != right.ColorName;
+	}
 
 
-		/// <inheritdoc/>
-		public override bool Equals (object obj)
-		{
-			return obj is Color other && Equals (other);
-		}
+	/// <summary>
+	/// Equality operator for <see cref="Color"/> and <see cref="Gui.ColorName"/> objects.
+	/// </summary>
+	/// <param name="left"></param>
+	/// <param name="right"></param>
+	/// <returns></returns>
+	public static bool operator == (Color left, ColorName right)
+	{
+		return left.ColorName == right;
+	}
 
 
-		/// <inheritdoc/>
-		public bool Equals (Color other)
-		{
-			return
-				R == other.R &&
-				G == other.G &&
-				B == other.B &&
-				A == other.A;
-		}
+	/// <summary>
+	/// Inequality operator for <see cref="Color"/> and <see cref="Gui.ColorName"/> objects.
+	/// </summary>
+	/// <param name="left"></param>
+	/// <param name="right"></param>
+	/// <returns></returns>
+	public static bool operator != (Color left, ColorName right)
+	{
+		return left.ColorName != right;
+	}
 
 
-		/// <inheritdoc/>
-		public override int GetHashCode ()
-		{
-			return HashCode.Combine (R, G, B, A);
-		}
-		#endregion
-
-		/// <summary>
-		/// Converts the color to a string representation.
-		/// </summary>
-		/// <remarks>
-		/// <para>
-		/// If the color is a named color, the name is returned. Otherwise, the color is returned as a hex string.
-		/// </para>
-		/// <para>
-		/// <see cref="A"/> (Alpha channel) is ignored and the returned string will not include it.
-		/// </para>
-		/// </remarks>
-		/// <returns></returns>
-		public override string ToString ()
-		{
-			// If Values has an exact match with a named color (in _colorNames), use that.
-			if (_colorToNameMap.TryGetValue (this, out ColorNames colorName)) {
-				return Enum.GetName (typeof (ColorNames), colorName);
-			}
-			// Otherwise return as an RGB hex value.
-			return $"#{R:X2}{G:X2}{B:X2}";
-		}
+
+	/// <inheritdoc/>
+	public override bool Equals (object obj)
+	{
+		return obj is Color other && Equals (other);
 	}
 	}
 
 
+	/// <inheritdoc/>
+	public bool Equals (Color other)
+	{
+		return
+			R == other.R &&
+			G == other.G &&
+			B == other.B &&
+			A == other.A;
+	}
+
+	/// <inheritdoc/>
+	public override int GetHashCode ()
+	{
+		return HashCode.Combine (R, G, B, A);
+	}
+	#endregion
+
 	/// <summary>
 	/// <summary>
-	/// Attributes represent how text is styled when displayed in the terminal. 
+	/// Converts the color to a string representation.
 	/// </summary>
 	/// </summary>
 	/// <remarks>
 	/// <remarks>
-	///   <see cref="Attribute"/> provides a platform independent representation of colors (and someday other forms of text styling).
-	///   They encode both the foreground and the background color and are used in the <see cref="ColorScheme"/>
-	///   class to define color schemes that can be used in an application.
+	/// <para>
+	/// If the color is a named color, the name is returned. Otherwise, the color is returned as a hex string.
+	/// </para>
+	/// <para>
+	/// <see cref="A"/> (Alpha channel) is ignored and the returned string will not include it.
+	/// </para>
 	/// </remarks>
 	/// </remarks>
-	[JsonConverter (typeof (AttributeJsonConverter))]
-	public readonly struct Attribute : IEquatable<Attribute> {
-
-		/// <summary>
-		/// Default empty attribute.
-		/// </summary>
-		public static readonly Attribute Default = new Attribute (Color.White, Color.Black);
-
-		/// <summary>
-		/// The <see cref="ConsoleDriver"/>-specific color value.
-		/// </summary>
-		[JsonIgnore (Condition = JsonIgnoreCondition.Always)]
-		internal int PlatformColor { get; }
-
-		/// <summary>
-		/// The foreground color.
-		/// </summary>
-		[JsonConverter (typeof (ColorJsonConverter))]
-		public Color Foreground { get; private init; }
-
-		/// <summary>
-		/// The background color.
-		/// </summary>
-		[JsonConverter (typeof (ColorJsonConverter))]
-		public Color Background { get; private init; }
-
-		/// <summary>
-		///  Initializes a new instance with default values.
-		/// </summary>
-		public Attribute ()
-		{
-			var d = Default;
-			PlatformColor = -1;
-			Foreground = d.Foreground;
-			Background = d.Background;
+	/// <returns></returns>
+	public override string ToString ()
+	{
+		// If Values has an exact match with a named color (in _colorNames), use that.
+		if (_colorToNameMap.TryGetValue (this, out ColorName colorName)) {
+			return Enum.GetName (typeof (ColorName), colorName);
 		}
 		}
+		// Otherwise return as an RGB hex value.
+		return $"#{R:X2}{G:X2}{B:X2}";
+	}
+}
 
 
-		/// <summary>
-		/// Initializes a new instance with platform specific color value.
-		/// </summary>
-		/// <param name="platformColor">Value.</param>
-		internal Attribute (int platformColor) : this (platformColor, Default.Foreground, Default.Background) { }
-
-		/// <summary>
-		/// Initializes a new instance of the <see cref="Attribute"/> struct.
-		/// </summary>
-		/// <param name="platformColor">platform-dependent color value.</param>
-		/// <param name="foreground">Foreground</param>
-		/// <param name="background">Background</param>
-		internal Attribute (int platformColor, Color foreground, Color background)
-		{
-			Foreground = foreground;
-			Background = background;
-			PlatformColor = platformColor;
-		}
+/// <summary>
+/// Attributes represent how text is styled when displayed in the terminal. 
+/// </summary>
+/// <remarks>
+///   <see cref="Attribute"/> provides a platform independent representation of colors (and someday other forms of text styling).
+///   They encode both the foreground and the background color and are used in the <see cref="ColorScheme"/>
+///   class to define color schemes that can be used in an application.
+/// </remarks>
+[JsonConverter (typeof (AttributeJsonConverter))]
+public readonly struct Attribute : IEquatable<Attribute> {
 
 
-		/// <summary>
-		/// Initializes a new instance of the <see cref="Attribute"/> struct.
-		/// </summary>
-		/// <param name="platformColor">platform-dependent color value.</param>
-		/// <param name="foreground">Foreground</param>
-		/// <param name="background">Background</param>
-		internal Attribute (int platformColor, ColorNames foreground, ColorNames background) : this (platformColor, (Color)foreground, (Color)background) { }
-
-		/// <summary>
-		/// Initializes a new instance of the <see cref="Attribute"/> struct.
-		/// </summary>
-		/// <param name="foreground">Foreground</param>
-		/// <param name="background">Background</param>
-		public Attribute (Color foreground, Color background)
-		{
-			Foreground = foreground;
-			Background = background;
+	/// <summary>
+	/// Default empty attribute.
+	/// </summary>
+	public static readonly Attribute Default = new Attribute (Color.White, Color.Black);
 
 
-			if (Application.Driver == null) {
-				PlatformColor = -1;
-				return;
-			}
+	/// <summary>
+	/// The <see cref="ConsoleDriver"/>-specific color value.
+	/// </summary>
+	[JsonIgnore (Condition = JsonIgnoreCondition.Always)]
+	internal int PlatformColor { get; }
 
 
-			var make = Application.Driver.MakeAttribute (foreground, background);
-			PlatformColor = make.PlatformColor;
-		}
+	/// <summary>
+	/// The foreground color.
+	/// </summary>
+	[JsonConverter (typeof (ColorJsonConverter))]
+	public Color Foreground { get; private init; }
 
 
-		/// <summary>
-		/// Initializes a new instance with a <see cref="ColorNames"/> value. Both <see cref="Foreground"/> and
-		/// <see cref="Background"/> will be set to the specified color.
-		/// </summary>
-		/// <param name="colorName">Value.</param>
-		internal Attribute (ColorNames colorName) : this (colorName, colorName) { }
-
-		/// <summary>
-		/// Initializes a new instance of the <see cref="Attribute"/> struct.
-		/// </summary>
-		/// <param name="foregroundName">Foreground</param>
-		/// <param name="backgroundName">Background</param>
-		public Attribute (ColorNames foregroundName, ColorNames backgroundName) : this (new Color (foregroundName), new Color (backgroundName)) { }
-
-
-		/// <summary>
-		/// Initializes a new instance of the <see cref="Attribute"/> struct.
-		/// </summary>
-		/// <param name="foregroundName">Foreground</param>
-		/// <param name="background">Background</param>
-		public Attribute (ColorNames foregroundName, Color background) : this (new Color (foregroundName), background) { }
-
-		/// <summary>
-		/// Initializes a new instance of the <see cref="Attribute"/> struct.
-		/// </summary>
-		/// <param name="foreground">Foreground</param>
-		/// <param name="backgroundName">Background</param>
-		public Attribute (Color foreground, ColorNames backgroundName) : this (foreground, new Color (backgroundName)) { }
-
-		/// <summary>
-		/// Initializes a new instance of the <see cref="Attribute"/> struct
-		///  with the same colors for the foreground and background.
-		/// </summary>
-		/// <param name="color">The color.</param>
-		public Attribute (Color color) : this (color, color) { }
-
-
-		/// <summary>
-		/// Compares two attributes for equality.
-		/// </summary>
-		/// <param name="left"></param>
-		/// <param name="right"></param>
-		/// <returns></returns>
-		public static bool operator == (Attribute left, Attribute right) => left.Equals (right);
-
-		/// <summary>
-		/// Compares two attributes for inequality.
-		/// </summary>
-		/// <param name="left"></param>
-		/// <param name="right"></param>
-		/// <returns></returns>
-		public static bool operator != (Attribute left, Attribute right) => !(left == right);
-
-		/// <inheritdoc />
-		public override bool Equals (object obj)
-		{
-			return obj is Attribute other && Equals (other);
-		}
+	/// <summary>
+	/// The background color.
+	/// </summary>
+	[JsonConverter (typeof (ColorJsonConverter))]
+	public Color Background { get; private init; }
 
 
-		/// <inheritdoc />
-		public bool Equals (Attribute other)
-		{
-			return PlatformColor == other.PlatformColor &&
-				Foreground == other.Foreground &&
-				Background == other.Background;
-		}
+	/// <summary>
+	///  Initializes a new instance with default values.
+	/// </summary>
+	public Attribute ()
+	{
+		var d = Default;
+		PlatformColor = -1;
+		Foreground = d.Foreground;
+		Background = d.Background;
+	}
 
 
-		/// <inheritdoc />
-		public override int GetHashCode () => HashCode.Combine (PlatformColor, Foreground, Background);
+	/// <summary>
+	/// Initializes a new instance with platform specific color value.
+	/// </summary>
+	/// <param name="platformColor">Value.</param>
+	internal Attribute (int platformColor) : this (platformColor, Default.Foreground, Default.Background) { }
 
 
-		/// <inheritdoc />
-		public override string ToString ()
-		{
-			// Note, Unit tests are dependent on this format
-			return $"{Foreground},{Background}";
-		}
+	/// <summary>
+	/// Initializes a new instance of the <see cref="Attribute"/> struct.
+	/// </summary>
+	/// <param name="platformColor">platform-dependent color value.</param>
+	/// <param name="foreground">Foreground</param>
+	/// <param name="background">Background</param>
+	internal Attribute (int platformColor, Color foreground, Color background)
+	{
+		Foreground = foreground;
+		Background = background;
+		PlatformColor = platformColor;
 	}
 	}
 
 
 	/// <summary>
 	/// <summary>
-	/// Defines the <see cref="Attribute"/>s for common visible elements in a <see cref="View"/>. 
-	/// Containers such as <see cref="Window"/> and <see cref="FrameView"/> use <see cref="ColorScheme"/> to determine
-	/// the colors used by sub-views.
+	/// Initializes a new instance of the <see cref="Attribute"/> struct.
 	/// </summary>
 	/// </summary>
-	/// <remarks>
-	/// See also: <see cref="Colors.ColorSchemes"/>.
-	/// </remarks>
-	[JsonConverter (typeof (ColorSchemeJsonConverter))]
-	public class ColorScheme : IEquatable<ColorScheme> {
-		Attribute _normal = Attribute.Default;
-		Attribute _focus = Attribute.Default;
-		Attribute _hotNormal = Attribute.Default;
-		Attribute _hotFocus = Attribute.Default;
-		Attribute _disabled = Attribute.Default;
-
-		/// <summary>
-		/// Used by <see cref="Colors.SetColorScheme(ColorScheme, string)"/> and <see cref="Colors.GetColorScheme(string)"/> to track which ColorScheme 
-		/// is being accessed.
-		/// </summary>
-		internal string _schemeBeingSet = "";
-
-		/// <summary>
-		/// Creates a new instance.
-		/// </summary>
-		public ColorScheme () : this (Attribute.Default) { }
-
-		/// <summary>
-		/// Creates a new instance, initialized with the values from <paramref name="scheme"/>.
-		/// </summary>
-		/// <param name="scheme">The scheme to initialize the new instance with.</param>
-		public ColorScheme (ColorScheme scheme) : base ()
-		{
-			if (scheme != null) {
-				_normal = scheme.Normal;
-				_focus = scheme.Focus;
-				_hotNormal = scheme.HotNormal;
-				_disabled = scheme.Disabled;
-				_hotFocus = scheme.HotFocus;
-			}
-		}
+	/// <param name="platformColor">platform-dependent color value.</param>
+	/// <param name="foreground">Foreground</param>
+	/// <param name="background">Background</param>
+	internal Attribute (int platformColor, ColorName foreground, ColorName background) : this (platformColor, (Color)foreground, (Color)background) { }
 
 
-		/// <summary>
-		/// Creates a new instance, initialized with the values from <paramref name="attribute"/>.
-		/// </summary>
-		/// <param name="attribute">The attribute to initialize the new instance with.</param>
-		public ColorScheme (Attribute attribute)
-		{
-			_normal = attribute;
-			_focus = attribute;
-			_hotNormal = attribute;
-			_disabled = attribute;
-			_hotFocus = attribute;
+	/// <summary>
+	/// Initializes a new instance of the <see cref="Attribute"/> struct.
+	/// </summary>
+	/// <param name="foreground">Foreground</param>
+	/// <param name="background">Background</param>
+	public Attribute (Color foreground, Color background)
+	{
+		Foreground = foreground;
+		Background = background;
+
+		if (Application.Driver == null) {
+			PlatformColor = -1;
+			return;
 		}
 		}
 
 
-		/// <summary>
-		/// The foreground and background color for text when the view is not focused, hot, or disabled.
-		/// </summary>
-		public Attribute Normal {
-			get => _normal;
-			set => _normal = value;
-		}
+		var make = Application.Driver.MakeAttribute (foreground, background);
+		PlatformColor = make.PlatformColor;
+	}
 
 
-		/// <summary>
-		/// The foreground and background color for text when the view has the focus.
-		/// </summary>
-		public Attribute Focus {
-			get => _focus;
-			set => _focus = value;
-		}
+	/// <summary>
+	/// Initializes a new instance with a <see cref="ColorName"/> value. Both <see cref="Foreground"/> and
+	/// <see cref="Background"/> will be set to the specified color.
+	/// </summary>
+	/// <param name="colorName">Value.</param>
+	internal Attribute (ColorName colorName) : this (colorName, colorName) { }
 
 
-		/// <summary>
-		/// The foreground and background color for text when the view is highlighted (hot).
-		/// </summary>
-		public Attribute HotNormal {
-			get => _hotNormal;
-			set => _hotNormal = value;
-		}
+	/// <summary>
+	/// Initializes a new instance of the <see cref="Attribute"/> struct.
+	/// </summary>
+	/// <param name="foregroundName">Foreground</param>
+	/// <param name="backgroundName">Background</param>
+	public Attribute (ColorName foregroundName, ColorName backgroundName) : this (new Color (foregroundName), new Color (backgroundName)) { }
 
 
-		/// <summary>
-		/// The foreground and background color for text when the view is highlighted (hot) and has focus.
-		/// </summary>
-		public Attribute HotFocus {
-			get => _hotFocus;
-			set => _hotFocus = value;
-		}
 
 
-		/// <summary>
-		/// The default foreground and background color for text, when the view is disabled.
-		/// </summary>
-		public Attribute Disabled {
-			get => _disabled;
-			set => _disabled = value;
-		}
+	/// <summary>
+	/// Initializes a new instance of the <see cref="Attribute"/> struct.
+	/// </summary>
+	/// <param name="foregroundName">Foreground</param>
+	/// <param name="background">Background</param>
+	public Attribute (ColorName foregroundName, Color background) : this (new Color (foregroundName), background) { }
 
 
-		/// <summary>
-		/// Compares two <see cref="ColorScheme"/> objects for equality.
-		/// </summary>
-		/// <param name="obj"></param>
-		/// <returns>true if the two objects are equal</returns>
-		public override bool Equals (object obj)
-		{
-			return Equals (obj as ColorScheme);
-		}
+	/// <summary>
+	/// Initializes a new instance of the <see cref="Attribute"/> struct.
+	/// </summary>
+	/// <param name="foreground">Foreground</param>
+	/// <param name="backgroundName">Background</param>
+	public Attribute (Color foreground, ColorName backgroundName) : this (foreground, new Color (backgroundName)) { }
 
 
-		/// <summary>
-		/// Compares two <see cref="ColorScheme"/> objects for equality.
-		/// </summary>
-		/// <param name="other"></param>
-		/// <returns>true if the two objects are equal</returns>
-		public bool Equals (ColorScheme other)
-		{
-			return other != null &&
-		       EqualityComparer<Attribute>.Default.Equals (_normal, other._normal) &&
-		       EqualityComparer<Attribute>.Default.Equals (_focus, other._focus) &&
-		       EqualityComparer<Attribute>.Default.Equals (_hotNormal, other._hotNormal) &&
-		       EqualityComparer<Attribute>.Default.Equals (_hotFocus, other._hotFocus) &&
-		       EqualityComparer<Attribute>.Default.Equals (_disabled, other._disabled);
-		}
+	/// <summary>
+	/// Initializes a new instance of the <see cref="Attribute"/> struct
+	///  with the same colors for the foreground and background.
+	/// </summary>
+	/// <param name="color">The color.</param>
+	public Attribute (Color color) : this (color, color) { }
 
 
-		/// <summary>
-		/// Returns a hashcode for this instance.
-		/// </summary>
-		/// <returns>hashcode for this instance</returns>
-		public override int GetHashCode ()
-		{
-			int hashCode = -1242460230;
-			hashCode = hashCode * -1521134295 + _normal.GetHashCode ();
-			hashCode = hashCode * -1521134295 + _focus.GetHashCode ();
-			hashCode = hashCode * -1521134295 + _hotNormal.GetHashCode ();
-			hashCode = hashCode * -1521134295 + _hotFocus.GetHashCode ();
-			hashCode = hashCode * -1521134295 + _disabled.GetHashCode ();
-			return hashCode;
+
+	/// <summary>
+	/// Compares two attributes for equality.
+	/// </summary>
+	/// <param name="left"></param>
+	/// <param name="right"></param>
+	/// <returns></returns>
+	public static bool operator == (Attribute left, Attribute right) => left.Equals (right);
+
+	/// <summary>
+	/// Compares two attributes for inequality.
+	/// </summary>
+	/// <param name="left"></param>
+	/// <param name="right"></param>
+	/// <returns></returns>
+	public static bool operator != (Attribute left, Attribute right) => !(left == right);
+
+	/// <inheritdoc />
+	public override bool Equals (object obj)
+	{
+		return obj is Attribute other && Equals (other);
+	}
+
+	/// <inheritdoc />
+	public bool Equals (Attribute other)
+	{
+		return PlatformColor == other.PlatformColor &&
+			Foreground == other.Foreground &&
+			Background == other.Background;
+	}
+
+	/// <inheritdoc />
+	public override int GetHashCode () => HashCode.Combine (PlatformColor, Foreground, Background);
+
+	/// <inheritdoc />
+	public override string ToString ()
+	{
+		// Note, Unit tests are dependent on this format
+		return $"{Foreground},{Background}";
+	}
+}
+
+/// <summary>
+/// Defines the <see cref="Attribute"/>s for common visible elements in a <see cref="View"/>. 
+/// Containers such as <see cref="Window"/> and <see cref="FrameView"/> use <see cref="ColorScheme"/> to determine
+/// the colors used by sub-views.
+/// </summary>
+/// <remarks>
+/// See also: <see cref="Colors.ColorSchemes"/>.
+/// </remarks>
+[JsonConverter (typeof (ColorSchemeJsonConverter))]
+public class ColorScheme : IEquatable<ColorScheme> {
+	Attribute _normal = Attribute.Default;
+	Attribute _focus = Attribute.Default;
+	Attribute _hotNormal = Attribute.Default;
+	Attribute _hotFocus = Attribute.Default;
+	Attribute _disabled = Attribute.Default;
+
+	/// <summary>
+	/// Used by <see cref="Colors.SetColorScheme(ColorScheme, string)"/> and <see cref="Colors.GetColorScheme(string)"/> to track which ColorScheme 
+	/// is being accessed.
+	/// </summary>
+	internal string _schemeBeingSet = "";
+
+	/// <summary>
+	/// Creates a new instance.
+	/// </summary>
+	public ColorScheme () : this (Attribute.Default) { }
+
+	/// <summary>
+	/// Creates a new instance, initialized with the values from <paramref name="scheme"/>.
+	/// </summary>
+	/// <param name="scheme">The scheme to initialize the new instance with.</param>
+	public ColorScheme (ColorScheme scheme) : base ()
+	{
+		if (scheme != null) {
+			_normal = scheme.Normal;
+			_focus = scheme.Focus;
+			_hotNormal = scheme.HotNormal;
+			_disabled = scheme.Disabled;
+			_hotFocus = scheme.HotFocus;
 		}
 		}
+	}
+
+	/// <summary>
+	/// Creates a new instance, initialized with the values from <paramref name="attribute"/>.
+	/// </summary>
+	/// <param name="attribute">The attribute to initialize the new instance with.</param>
+	public ColorScheme (Attribute attribute)
+	{
+		_normal = attribute;
+		_focus = attribute;
+		_hotNormal = attribute;
+		_disabled = attribute;
+		_hotFocus = attribute;
+	}
+
+	/// <summary>
+	/// The foreground and background color for text when the view is not focused, hot, or disabled.
+	/// </summary>
+	public Attribute Normal {
+		get => _normal;
+		set => _normal = value;
+	}
+
+	/// <summary>
+	/// The foreground and background color for text when the view has the focus.
+	/// </summary>
+	public Attribute Focus {
+		get => _focus;
+		set => _focus = value;
+	}
+
+	/// <summary>
+	/// The foreground and background color for text when the view is highlighted (hot).
+	/// </summary>
+	public Attribute HotNormal {
+		get => _hotNormal;
+		set => _hotNormal = value;
+	}
+
+	/// <summary>
+	/// The foreground and background color for text when the view is highlighted (hot) and has focus.
+	/// </summary>
+	public Attribute HotFocus {
+		get => _hotFocus;
+		set => _hotFocus = value;
+	}
+
+	/// <summary>
+	/// The default foreground and background color for text, when the view is disabled.
+	/// </summary>
+	public Attribute Disabled {
+		get => _disabled;
+		set => _disabled = value;
+	}
+
+	/// <summary>
+	/// Compares two <see cref="ColorScheme"/> objects for equality.
+	/// </summary>
+	/// <param name="obj"></param>
+	/// <returns>true if the two objects are equal</returns>
+	public override bool Equals (object obj)
+	{
+		return Equals (obj as ColorScheme);
+	}
+
+	/// <summary>
+	/// Compares two <see cref="ColorScheme"/> objects for equality.
+	/// </summary>
+	/// <param name="other"></param>
+	/// <returns>true if the two objects are equal</returns>
+	public bool Equals (ColorScheme other)
+	{
+		return other != null &&
+	       EqualityComparer<Attribute>.Default.Equals (_normal, other._normal) &&
+	       EqualityComparer<Attribute>.Default.Equals (_focus, other._focus) &&
+	       EqualityComparer<Attribute>.Default.Equals (_hotNormal, other._hotNormal) &&
+	       EqualityComparer<Attribute>.Default.Equals (_hotFocus, other._hotFocus) &&
+	       EqualityComparer<Attribute>.Default.Equals (_disabled, other._disabled);
+	}
 
 
-		/// <summary>
-		/// Compares two <see cref="ColorScheme"/> objects for equality.
-		/// </summary>
-		/// <param name="left"></param>
-		/// <param name="right"></param>
-		/// <returns><c>true</c> if the two objects are equivalent</returns>
-		public static bool operator == (ColorScheme left, ColorScheme right)
+	/// <summary>
+	/// Returns a hashcode for this instance.
+	/// </summary>
+	/// <returns>hashcode for this instance</returns>
+	public override int GetHashCode ()
+	{
+		int hashCode = -1242460230;
+		hashCode = hashCode * -1521134295 + _normal.GetHashCode ();
+		hashCode = hashCode * -1521134295 + _focus.GetHashCode ();
+		hashCode = hashCode * -1521134295 + _hotNormal.GetHashCode ();
+		hashCode = hashCode * -1521134295 + _hotFocus.GetHashCode ();
+		hashCode = hashCode * -1521134295 + _disabled.GetHashCode ();
+		return hashCode;
+	}
+
+	/// <summary>
+	/// Compares two <see cref="ColorScheme"/> objects for equality.
+	/// </summary>
+	/// <param name="left"></param>
+	/// <param name="right"></param>
+	/// <returns><c>true</c> if the two objects are equivalent</returns>
+	public static bool operator == (ColorScheme left, ColorScheme right)
+	{
+		return EqualityComparer<ColorScheme>.Default.Equals (left, right);
+	}
+
+	/// <summary>
+	/// Compares two <see cref="ColorScheme"/> objects for inequality.
+	/// </summary>
+	/// <param name="left"></param>
+	/// <param name="right"></param>
+	/// <returns><c>true</c> if the two objects are not equivalent</returns>
+	public static bool operator != (ColorScheme left, ColorScheme right)
+	{
+		return !(left == right);
+	}
+}
+
+/// <summary>
+/// The default <see cref="ColorScheme"/>s for the application.
+/// </summary>
+/// <remarks>
+/// This property can be set in a Theme to change the default <see cref="Colors"/> for the application.
+/// </remarks>
+public static class Colors {
+	private class SchemeNameComparerIgnoreCase : IEqualityComparer<string> {
+		public bool Equals (string x, string y)
 		{
 		{
-			return EqualityComparer<ColorScheme>.Default.Equals (left, right);
+			if (x != null && y != null) {
+				return string.Equals (x, y, StringComparison.InvariantCultureIgnoreCase);
+			}
+			return false;
 		}
 		}
 
 
-		/// <summary>
-		/// Compares two <see cref="ColorScheme"/> objects for inequality.
-		/// </summary>
-		/// <param name="left"></param>
-		/// <param name="right"></param>
-		/// <returns><c>true</c> if the two objects are not equivalent</returns>
-		public static bool operator != (ColorScheme left, ColorScheme right)
+		public int GetHashCode (string obj)
 		{
 		{
-			return !(left == right);
+			return obj.ToLowerInvariant ().GetHashCode ();
 		}
 		}
 	}
 	}
 
 
+	static Colors ()
+	{
+		ColorSchemes = Create ();
+	}
+
 	/// <summary>
 	/// <summary>
-	/// The default <see cref="ColorScheme"/>s for the application.
+	/// Creates a new dictionary of new <see cref="ColorScheme"/> objects.
+	/// </summary>
+	public static Dictionary<string, ColorScheme> Create ()
+	{
+		// Use reflection to dynamically create the default set of ColorSchemes from the list defined 
+		// by the class. 
+		return typeof (Colors).GetProperties ()
+			.Where (p => p.PropertyType == typeof (ColorScheme))
+			.Select (p => new KeyValuePair<string, ColorScheme> (p.Name, new ColorScheme ()))
+			.ToDictionary (t => t.Key, t => t.Value, comparer: new SchemeNameComparerIgnoreCase ());
+	}
+
+	/// <summary>
+	/// The application Toplevel color scheme, for the default Toplevel views.
 	/// </summary>
 	/// </summary>
 	/// <remarks>
 	/// <remarks>
-	/// This property can be set in a Theme to change the default <see cref="Colors"/> for the application.
+	/// <para>
+	///	This API will be deprecated in the future. Use <see cref="Colors.ColorSchemes"/> instead (e.g. <c>edit.ColorScheme = Colors.ColorSchemes["TopLevel"];</c>
+	/// </para>
 	/// </remarks>
 	/// </remarks>
-	public static class Colors {
-		private class SchemeNameComparerIgnoreCase : IEqualityComparer<string> {
-			public bool Equals (string x, string y)
-			{
-				if (x != null && y != null) {
-					return string.Equals (x, y, StringComparison.InvariantCultureIgnoreCase);
-				}
-				return false;
-			}
+	public static ColorScheme TopLevel { get => GetColorScheme (); set => SetColorScheme (value); }
 
 
-			public int GetHashCode (string obj)
-			{
-				return obj.ToLowerInvariant ().GetHashCode ();
-			}
-		}
+	/// <summary>
+	/// The base color scheme, for the default Toplevel views.
+	/// </summary>
+	/// <remarks>
+	/// <para>
+	///	This API will be deprecated in the future. Use <see cref="Colors.ColorSchemes"/> instead (e.g. <c>edit.ColorScheme = Colors.ColorSchemes["Base"];</c>
+	/// </para>
+	/// </remarks>
+	public static ColorScheme Base { get => GetColorScheme (); set => SetColorScheme (value); }
 
 
-		static Colors ()
-		{
-			ColorSchemes = Create ();
-		}
+	/// <summary>
+	/// The dialog color scheme, for standard popup dialog boxes
+	/// </summary>
+	/// <remarks>
+	/// <para>
+	///	This API will be deprecated in the future. Use <see cref="Colors.ColorSchemes"/> instead (e.g. <c>edit.ColorScheme = Colors.ColorSchemes["Dialog"];</c>
+	/// </para>
+	/// </remarks>
+	public static ColorScheme Dialog { get => GetColorScheme (); set => SetColorScheme (value); }
 
 
-		/// <summary>
-		/// Creates a new dictionary of new <see cref="ColorScheme"/> objects.
-		/// </summary>
-		public static Dictionary<string, ColorScheme> Create ()
-		{
-			// Use reflection to dynamically create the default set of ColorSchemes from the list defined 
-			// by the class. 
-			return typeof (Colors).GetProperties ()
-				.Where (p => p.PropertyType == typeof (ColorScheme))
-				.Select (p => new KeyValuePair<string, ColorScheme> (p.Name, new ColorScheme ()))
-				.ToDictionary (t => t.Key, t => t.Value, comparer: new SchemeNameComparerIgnoreCase ());
-		}
+	/// <summary>
+	/// The menu bar color
+	/// </summary>
+	/// <remarks>
+	/// <para>
+	///	This API will be deprecated in the future. Use <see cref="Colors.ColorSchemes"/> instead (e.g. <c>edit.ColorScheme = Colors.ColorSchemes["Menu"];</c>
+	/// </para>
+	/// </remarks>
+	public static ColorScheme Menu { get => GetColorScheme (); set => SetColorScheme (value); }
 
 
-		/// <summary>
-		/// The application Toplevel color scheme, for the default Toplevel views.
-		/// </summary>
-		/// <remarks>
-		/// <para>
-		///	This API will be deprecated in the future. Use <see cref="Colors.ColorSchemes"/> instead (e.g. <c>edit.ColorScheme = Colors.ColorSchemes["TopLevel"];</c>
-		/// </para>
-		/// </remarks>
-		public static ColorScheme TopLevel { get => GetColorScheme (); set => SetColorScheme (value); }
-
-		/// <summary>
-		/// The base color scheme, for the default Toplevel views.
-		/// </summary>
-		/// <remarks>
-		/// <para>
-		///	This API will be deprecated in the future. Use <see cref="Colors.ColorSchemes"/> instead (e.g. <c>edit.ColorScheme = Colors.ColorSchemes["Base"];</c>
-		/// </para>
-		/// </remarks>
-		public static ColorScheme Base { get => GetColorScheme (); set => SetColorScheme (value); }
-
-		/// <summary>
-		/// The dialog color scheme, for standard popup dialog boxes
-		/// </summary>
-		/// <remarks>
-		/// <para>
-		///	This API will be deprecated in the future. Use <see cref="Colors.ColorSchemes"/> instead (e.g. <c>edit.ColorScheme = Colors.ColorSchemes["Dialog"];</c>
-		/// </para>
-		/// </remarks>
-		public static ColorScheme Dialog { get => GetColorScheme (); set => SetColorScheme (value); }
-
-		/// <summary>
-		/// The menu bar color
-		/// </summary>
-		/// <remarks>
-		/// <para>
-		///	This API will be deprecated in the future. Use <see cref="Colors.ColorSchemes"/> instead (e.g. <c>edit.ColorScheme = Colors.ColorSchemes["Menu"];</c>
-		/// </para>
-		/// </remarks>
-		public static ColorScheme Menu { get => GetColorScheme (); set => SetColorScheme (value); }
-
-		/// <summary>
-		/// The color scheme for showing errors.
-		/// </summary>
-		/// <remarks>
-		/// <para>
-		///	This API will be deprecated in the future. Use <see cref="Colors.ColorSchemes"/> instead (e.g. <c>edit.ColorScheme = Colors.ColorSchemes["Error"];</c>
-		/// </para>
-		/// </remarks>
-		public static ColorScheme Error { get => GetColorScheme (); set => SetColorScheme (value); }
-
-		static ColorScheme GetColorScheme ([CallerMemberName] string schemeBeingSet = null)
-		{
-			return ColorSchemes [schemeBeingSet];
-		}
+	/// <summary>
+	/// The color scheme for showing errors.
+	/// </summary>
+	/// <remarks>
+	/// <para>
+	///	This API will be deprecated in the future. Use <see cref="Colors.ColorSchemes"/> instead (e.g. <c>edit.ColorScheme = Colors.ColorSchemes["Error"];</c>
+	/// </para>
+	/// </remarks>
+	public static ColorScheme Error { get => GetColorScheme (); set => SetColorScheme (value); }
 
 
-		static void SetColorScheme (ColorScheme colorScheme, [CallerMemberName] string schemeBeingSet = null)
-		{
-			ColorSchemes [schemeBeingSet] = colorScheme;
-			colorScheme._schemeBeingSet = schemeBeingSet;
-		}
+	static ColorScheme GetColorScheme ([CallerMemberName] string schemeBeingSet = null)
+	{
+		return ColorSchemes [schemeBeingSet];
+	}
 
 
-		/// <summary>
-		/// Provides the defined <see cref="ColorScheme"/>s.
-		/// </summary>
-		[SerializableConfigurationProperty (Scope = typeof (ThemeScope), OmitClassName = true)]
-		[JsonConverter (typeof (DictionaryJsonConverter<ColorScheme>))]
-		public static Dictionary<string, ColorScheme> ColorSchemes { get; private set; }
+	static void SetColorScheme (ColorScheme colorScheme, [CallerMemberName] string schemeBeingSet = null)
+	{
+		ColorSchemes [schemeBeingSet] = colorScheme;
+		colorScheme._schemeBeingSet = schemeBeingSet;
 	}
 	}
 
 
+	/// <summary>
+	/// Provides the defined <see cref="ColorScheme"/>s.
+	/// </summary>
+	[SerializableConfigurationProperty (Scope = typeof (ThemeScope), OmitClassName = true)]
+	[JsonConverter (typeof (DictionaryJsonConverter<ColorScheme>))]
+	public static Dictionary<string, ColorScheme> ColorSchemes { get; private set; }
 }
 }

+ 5 - 5
Terminal.Gui/Views/ColorPicker.cs

@@ -81,7 +81,7 @@ namespace Terminal.Gui {
 
 
 			set {
 			set {
 				var colorIndex = value.Y * _cols + value.X;
 				var colorIndex = value.Y * _cols + value.X;
-				SelectedColor = (ColorNames)colorIndex;
+				SelectedColor = (ColorName)colorIndex;
 			}
 			}
 		}
 		}
 
 
@@ -93,13 +93,13 @@ namespace Terminal.Gui {
 		/// <summary>
 		/// <summary>
 		/// Selected color.
 		/// Selected color.
 		/// </summary>
 		/// </summary>
-		public ColorNames SelectedColor {
+		public ColorName SelectedColor {
 			get {
 			get {
-				return (ColorNames)_selectColorIndex;
+				return (ColorName)_selectColorIndex;
 			}
 			}
 
 
 			set {
 			set {
-				ColorNames prev = (ColorNames)_selectColorIndex;
+				ColorName prev = (ColorName)_selectColorIndex;
 				_selectColorIndex = (int)value;
 				_selectColorIndex = (int)value;
 				ColorChanged?.Invoke (this, new ColorEventArgs () {
 				ColorChanged?.Invoke (this, new ColorEventArgs () {
 					PreviousColor = new Color (prev),
 					PreviousColor = new Color (prev),
@@ -160,7 +160,7 @@ namespace Terminal.Gui {
 			for (var y = 0; y < (Bounds.Height / BoxHeight); y++) {
 			for (var y = 0; y < (Bounds.Height / BoxHeight); y++) {
 				for (var x = 0; x < (Bounds.Width / BoxWidth); x++) {
 				for (var x = 0; x < (Bounds.Width / BoxWidth); x++) {
 					var foregroundColorIndex = y == 0 ? colorIndex + _cols : colorIndex - _cols;
 					var foregroundColorIndex = y == 0 ? colorIndex + _cols : colorIndex - _cols;
-					Driver.SetAttribute (new Attribute ((ColorNames)foregroundColorIndex, (ColorNames)colorIndex));
+					Driver.SetAttribute (new Attribute ((ColorName)foregroundColorIndex, (ColorName)colorIndex));
 					var selected = x == Cursor.X && y == Cursor.Y;
 					var selected = x == Cursor.X && y == Cursor.Y;
 					DrawColorBox (x, y, selected);
 					DrawColorBox (x, y, selected);
 					colorIndex++;
 					colorIndex++;

+ 3 - 3
UICatalog/Scenarios/BasicColors.cs

@@ -10,10 +10,10 @@ namespace UICatalog.Scenarios {
 			var vx = 30;
 			var vx = 30;
 			var x = 30;
 			var x = 30;
 			var y = 14;
 			var y = 14;
-			var colors = System.Enum.GetValues (typeof (ColorNames));
+			var colors = System.Enum.GetValues (typeof (ColorName));
 
 
 		
 		
-			foreach (ColorNames bg in colors) {
+			foreach (ColorName bg in colors) {
 				Attribute attr = new Attribute (bg, colors.Length - 1 - bg);
 				Attribute attr = new Attribute (bg, colors.Length - 1 - bg);
 				var vl = new Label (bg.ToString (), TextDirection.TopBottom_LeftRight) {
 				var vl = new Label (bg.ToString (), TextDirection.TopBottom_LeftRight) {
 					X = vx,
 					X = vx,
@@ -34,7 +34,7 @@ namespace UICatalog.Scenarios {
 				};
 				};
 				Win.Add (hl);
 				Win.Add (hl);
 				vx++;
 				vx++;
-				foreach (ColorNames fg in colors) {
+				foreach (ColorName fg in colors) {
 					var c = new Attribute (fg, bg);
 					var c = new Attribute (fg, bg);
 					var t = x.ToString ();
 					var t = x.ToString ();
 					var l = new Label (x, y, t [t.Length - 1].ToString ()) {
 					var l = new Label (x, y, t [t.Length - 1].ToString ()) {

+ 1 - 1
UICatalog/Scenarios/GraphViewExample.cs

@@ -96,7 +96,7 @@ namespace UICatalog.Scenarios {
 
 
 			about.Text = "Housing Expenditures by income thirds 1996-2003";
 			about.Text = "Housing Expenditures by income thirds 1996-2003";
 
 
-			var fore = graphView.ColorScheme.Normal.Foreground == new Color(ColorNames.Black) ? new Color(ColorNames.White) : graphView.ColorScheme.Normal.Foreground;
+			var fore = graphView.ColorScheme.Normal.Foreground == new Color(ColorName.Black) ? new Color(ColorName.White) : graphView.ColorScheme.Normal.Foreground;
 			var black = new Attribute (fore, Color.Black);
 			var black = new Attribute (fore, Color.Black);
 			var cyan = new Attribute (Color.BrightCyan, Color.Black);
 			var cyan = new Attribute (Color.BrightCyan, Color.Black);
 			var magenta = new Attribute (Color.BrightMagenta, Color.Black);
 			var magenta = new Attribute (Color.BrightMagenta, Color.Black);

+ 1 - 1
UICatalog/Scenarios/InvertColors.cs

@@ -13,7 +13,7 @@ namespace UICatalog.Scenarios {
 			Win.ColorScheme = Colors.TopLevel;
 			Win.ColorScheme = Colors.TopLevel;
 
 
 			List<Label> labels = new List<Label> ();
 			List<Label> labels = new List<Label> ();
-			var foreColors = Enum.GetValues (typeof (ColorNames)).Cast<ColorNames> ().ToArray ();
+			var foreColors = Enum.GetValues (typeof (ColorName)).Cast<ColorName> ().ToArray ();
 			for (int y = 0; y < foreColors.Length; y++) {
 			for (int y = 0; y < foreColors.Length; y++) {
 
 
 				var fore = foreColors [y];
 				var fore = foreColors [y];

+ 20 - 20
UnitTests/Configuration/JsonConverterTests.cs

@@ -21,7 +21,7 @@ namespace Terminal.Gui.ConfigurationTests {
 		[InlineData ("Magenta", Color.Magenta)]
 		[InlineData ("Magenta", Color.Magenta)]
 		[InlineData ("Red", Color.Red)]
 		[InlineData ("Red", Color.Red)]
 		[InlineData ("White", Color.White)]
 		[InlineData ("White", Color.White)]
-		public void TestColorDeserializationFromHumanReadableColorNames (string colorName, ColorNames expectedColor)
+		public void TestColorDeserializationFromHumanReadableColorNames (string colorName, ColorName expectedColor)
 		{
 		{
 			// Arrange
 			// Arrange
 			string json = $"\"{colorName}\"";
 			string json = $"\"{colorName}\"";
@@ -34,23 +34,23 @@ namespace Terminal.Gui.ConfigurationTests {
 		}
 		}
 
 
 		[Theory]
 		[Theory]
-		[InlineData (ColorNames.Black, "Black")]
-		[InlineData (ColorNames.Blue, "Blue")]
-		[InlineData (ColorNames.Green, "Green")]
-		[InlineData (ColorNames.Cyan, "Cyan")]
-		[InlineData (ColorNames.Gray, "Gray")]
-		[InlineData (ColorNames.Red, "Red")]
-		[InlineData (ColorNames.Magenta, "Magenta")]
-		[InlineData (ColorNames.Yellow, "Yellow")]
-		[InlineData (ColorNames.DarkGray, "DarkGray")]
-		[InlineData (ColorNames.BrightBlue, "BrightBlue")]
-		[InlineData (ColorNames.BrightGreen, "BrightGreen")]
-		[InlineData (ColorNames.BrightCyan, "BrightCyan")]
-		[InlineData (ColorNames.BrightRed, "BrightRed")]
-		[InlineData (ColorNames.BrightMagenta, "BrightMagenta")]
-		[InlineData (ColorNames.BrightYellow, "BrightYellow")]
-		[InlineData (ColorNames.White, "White")]
-		public void SerializesEnumValuesAsStrings (ColorNames colorName, string expectedJson)
+		[InlineData (ColorName.Black, "Black")]
+		[InlineData (ColorName.Blue, "Blue")]
+		[InlineData (ColorName.Green, "Green")]
+		[InlineData (ColorName.Cyan, "Cyan")]
+		[InlineData (ColorName.Gray, "Gray")]
+		[InlineData (ColorName.Red, "Red")]
+		[InlineData (ColorName.Magenta, "Magenta")]
+		[InlineData (ColorName.Yellow, "Yellow")]
+		[InlineData (ColorName.DarkGray, "DarkGray")]
+		[InlineData (ColorName.BrightBlue, "BrightBlue")]
+		[InlineData (ColorName.BrightGreen, "BrightGreen")]
+		[InlineData (ColorName.BrightCyan, "BrightCyan")]
+		[InlineData (ColorName.BrightRed, "BrightRed")]
+		[InlineData (ColorName.BrightMagenta, "BrightMagenta")]
+		[InlineData (ColorName.BrightYellow, "BrightYellow")]
+		[InlineData (ColorName.White, "White")]
+		public void SerializesEnumValuesAsStrings (ColorName colorName, string expectedJson)
 		{
 		{
 			var converter = new ColorJsonConverter ();
 			var converter = new ColorJsonConverter ();
 			var options = new JsonSerializerOptions { Converters = { converter } };
 			var options = new JsonSerializerOptions { Converters = { converter } };
@@ -95,7 +95,7 @@ namespace Terminal.Gui.ConfigurationTests {
 		{
 		{
 			// Arrange
 			// Arrange
 			var json = "\"Black\"";
 			var json = "\"Black\"";
-			var expectedColor = new Color (ColorNames.Black);
+			var expectedColor = new Color (ColorName.Black);
 
 
 			// Act
 			// Act
 			var color = JsonSerializer.Deserialize<Color> (json, new JsonSerializerOptions {
 			var color = JsonSerializer.Deserialize<Color> (json, new JsonSerializerOptions {
@@ -111,7 +111,7 @@ namespace Terminal.Gui.ConfigurationTests {
 		{
 		{
 			// Arrange
 			// Arrange
 			var json = "\"BrightRed\"";
 			var json = "\"BrightRed\"";
-			var expectedColor = new Color (ColorNames.BrightRed);
+			var expectedColor = new Color (ColorName.BrightRed);
 
 
 			// Act
 			// Act
 			var color = JsonSerializer.Deserialize<Color> (json, new JsonSerializerOptions {
 			var color = JsonSerializer.Deserialize<Color> (json, new JsonSerializerOptions {

+ 7 - 7
UnitTests/Drawing/AttributeTests.cs

@@ -40,7 +40,7 @@ public class AttributeTests {
 	public void ColorNamesConstructor ()
 	public void ColorNamesConstructor ()
 	{
 	{
 		// Arrange & Act
 		// Arrange & Act
-		var attribute = new Attribute (ColorNames.Blue);
+		var attribute = new Attribute (ColorName.Blue);
 
 
 		// Assert
 		// Assert
 		Assert.Equal ((Color)Color.Blue, attribute.Foreground);
 		Assert.Equal ((Color)Color.Blue, attribute.Foreground);
@@ -65,7 +65,7 @@ public class AttributeTests {
 	{
 	{
 		// Arrange & Act
 		// Arrange & Act
 		var foregroundColor = new Color (0, 0, 255);
 		var foregroundColor = new Color (0, 0, 255);
-		var backgroundColorName = ColorNames.Black;
+		var backgroundColorName = ColorName.Black;
 		var attribute = new Attribute (foregroundColor, backgroundColorName);
 		var attribute = new Attribute (foregroundColor, backgroundColorName);
 
 
 		// Assert
 		// Assert
@@ -77,7 +77,7 @@ public class AttributeTests {
 	public void ColorNamesAndColorConstructor ()
 	public void ColorNamesAndColorConstructor ()
 	{
 	{
 		// Arrange & Act
 		// Arrange & Act
-		var foregroundColorName = ColorNames.BrightYellow;
+		var foregroundColorName = ColorName.BrightYellow;
 		var backgroundColor = new Color (128, 128, 128);
 		var backgroundColor = new Color (128, 128, 128);
 		var attribute = new Attribute (foregroundColorName, backgroundColor);
 		var attribute = new Attribute (foregroundColorName, backgroundColor);
 
 
@@ -149,8 +149,8 @@ public class AttributeTests {
 	public void MakeColorNamesAndColorNames_ForegroundAndBackgroundShouldMatchInput ()
 	public void MakeColorNamesAndColorNames_ForegroundAndBackgroundShouldMatchInput ()
 	{
 	{
 		// Arrange
 		// Arrange
-		var foregroundColorName = ColorNames.BrightYellow;
-		var backgroundColorName = ColorNames.Black;
+		var foregroundColorName = ColorName.BrightYellow;
+		var backgroundColorName = ColorName.Black;
 
 
 		// Act
 		// Act
 		var attribute = new Attribute (foregroundColorName, backgroundColorName);
 		var attribute = new Attribute (foregroundColorName, backgroundColorName);
@@ -164,7 +164,7 @@ public class AttributeTests {
 	public void MakeColorNamesAndColor_ForegroundAndBackgroundShouldMatchInput ()
 	public void MakeColorNamesAndColor_ForegroundAndBackgroundShouldMatchInput ()
 	{
 	{
 		// Arrange
 		// Arrange
-		var foregroundColorName = ColorNames.Green;
+		var foregroundColorName = ColorName.Green;
 		var backgroundColor = new Color (128, 128, 128);
 		var backgroundColor = new Color (128, 128, 128);
 
 
 		// Act
 		// Act
@@ -180,7 +180,7 @@ public class AttributeTests {
 	{
 	{
 		// Arrange
 		// Arrange
 		var foregroundColor = new Color (255, 0, 0);
 		var foregroundColor = new Color (255, 0, 0);
-		var backgroundColorName = ColorNames.White;
+		var backgroundColorName = ColorName.White;
 
 
 		// Act
 		// Act
 		var attribute = new Attribute (foregroundColor, backgroundColorName);
 		var attribute = new Attribute (foregroundColor, backgroundColorName);

+ 46 - 46
UnitTests/Drawing/ColorTests.cs

@@ -26,11 +26,11 @@ public class ColorTests {
 	[Fact]
 	[Fact]
 	public void TestAllColors ()
 	public void TestAllColors ()
 	{
 	{
-		var colorNames = Enum.GetValues (typeof (ColorNames)).Cast<int> ().Distinct ().ToList();
+		var colorNames = Enum.GetValues (typeof (ColorName)).Cast<int> ().Distinct ().ToList();
 		Attribute [] attrs = new Attribute [colorNames.Count];
 		Attribute [] attrs = new Attribute [colorNames.Count];
 
 
 		int idx = 0;
 		int idx = 0;
-		foreach (ColorNames bg in colorNames) {
+		foreach (ColorName bg in colorNames) {
 			attrs [idx] = new Attribute (bg, colorNames.Count - 1 - bg);
 			attrs [idx] = new Attribute (bg, colorNames.Count - 1 - bg);
 			idx++;
 			idx++;
 		}
 		}
@@ -56,28 +56,28 @@ public class ColorTests {
 	[Fact]
 	[Fact]
 	public void ColorNames_HasOnly16DistinctElements ()
 	public void ColorNames_HasOnly16DistinctElements ()
 	{
 	{
-		Assert.Equal (16, Enum.GetValues (typeof (ColorNames)).Cast<int> ().Distinct ().Count ());
+		Assert.Equal (16, Enum.GetValues (typeof (ColorName)).Cast<int> ().Distinct ().Count ());
 	}
 	}
 
 
 	[Fact]
 	[Fact]
 	public void ColorNames_HaveCorrectOrdinals ()
 	public void ColorNames_HaveCorrectOrdinals ()
 	{
 	{
-		Assert.Equal (0, (int)ColorNames.Black);
-		Assert.Equal (1, (int)ColorNames.Blue);
-		Assert.Equal (2, (int)ColorNames.Green);
-		Assert.Equal (3, (int)ColorNames.Cyan);
-		Assert.Equal (4, (int)ColorNames.Red);
-		Assert.Equal (5, (int)ColorNames.Magenta);
-		Assert.Equal (6, (int)ColorNames.Yellow);
-		Assert.Equal (7, (int)ColorNames.Gray);
-		Assert.Equal (8, (int)ColorNames.DarkGray);
-		Assert.Equal (9, (int)ColorNames.BrightBlue);
-		Assert.Equal (10, (int)ColorNames.BrightGreen);
-		Assert.Equal (11, (int)ColorNames.BrightCyan);
-		Assert.Equal (12, (int)ColorNames.BrightRed);
-		Assert.Equal (13, (int)ColorNames.BrightMagenta);
-		Assert.Equal (14, (int)ColorNames.BrightYellow);
-		Assert.Equal (15, (int)ColorNames.White);
+		Assert.Equal (0, (int)ColorName.Black);
+		Assert.Equal (1, (int)ColorName.Blue);
+		Assert.Equal (2, (int)ColorName.Green);
+		Assert.Equal (3, (int)ColorName.Cyan);
+		Assert.Equal (4, (int)ColorName.Red);
+		Assert.Equal (5, (int)ColorName.Magenta);
+		Assert.Equal (6, (int)ColorName.Yellow);
+		Assert.Equal (7, (int)ColorName.Gray);
+		Assert.Equal (8, (int)ColorName.DarkGray);
+		Assert.Equal (9, (int)ColorName.BrightBlue);
+		Assert.Equal (10, (int)ColorName.BrightGreen);
+		Assert.Equal (11, (int)ColorName.BrightCyan);
+		Assert.Equal (12, (int)ColorName.BrightRed);
+		Assert.Equal (13, (int)ColorName.BrightMagenta);
+		Assert.Equal (14, (int)ColorName.BrightYellow);
+		Assert.Equal (15, (int)ColorName.White);
 	}
 	}
 
 
 	[Fact]
 	[Fact]
@@ -137,7 +137,7 @@ public class ColorTests {
 	public void Color_Constructor_WithColorName ()
 	public void Color_Constructor_WithColorName ()
 	{
 	{
 		// Arrange
 		// Arrange
-		ColorNames colorName = ColorNames.Blue;
+		ColorName colorName = ColorName.Blue;
 		var expectedColor = new Color (0, 55, 218); // Blue
 		var expectedColor = new Color (0, 55, 218); // Blue
 
 
 		// Act
 		// Act
@@ -206,7 +206,7 @@ public class ColorTests {
 	public void Color_ImplicitOperator_FromColorNames ()
 	public void Color_ImplicitOperator_FromColorNames ()
 	{
 	{
 		// Arrange
 		// Arrange
-		ColorNames colorName = ColorNames.Blue;
+		ColorName colorName = ColorName.Blue;
 		var expectedColor = new Color (0, 55, 218); // Blue
 		var expectedColor = new Color (0, 55, 218); // Blue
 
 
 		// Act
 		// Act
@@ -221,10 +221,10 @@ public class ColorTests {
 	{
 	{
 		// Arrange
 		// Arrange
 		var color = new Color (0, 0, 0x80); // Blue
 		var color = new Color (0, 0, 0x80); // Blue
-		ColorNames expectedColorName = ColorNames.Blue;
+		ColorName expectedColorName = ColorName.Blue;
 
 
 		// Act
 		// Act
-		ColorNames colorName = (ColorNames)color;
+		ColorName colorName = (ColorName)color;
 
 
 		// Assert
 		// Assert
 		Assert.Equal (expectedColorName, colorName);
 		Assert.Equal (expectedColorName, colorName);
@@ -260,40 +260,40 @@ public class ColorTests {
 	public void Color_EqualityOperator_WithColorNamesAndColor ()
 	public void Color_EqualityOperator_WithColorNamesAndColor ()
 	{
 	{
 		// Arrange
 		// Arrange
-		var color1 = new Color (ColorNames.Red);
+		var color1 = new Color (ColorName.Red);
 		var color2 = new Color (197, 15, 31); // Red in RGB
 		var color2 = new Color (197, 15, 31); // Red in RGB
 
 
 		// Act & Assert
 		// Act & Assert
-		Assert.True (ColorNames.Red == color1);
-		Assert.False (ColorNames.Red != color1);
+		Assert.True (ColorName.Red == color1);
+		Assert.False (ColorName.Red != color1);
 
 
-		Assert.True (color1 == ColorNames.Red);
-		Assert.False (color1 != ColorNames.Red);
+		Assert.True (color1 == ColorName.Red);
+		Assert.False (color1 != ColorName.Red);
 
 
-		Assert.True (color2 == ColorNames.Red);
-		Assert.False (color2 != ColorNames.Red);
+		Assert.True (color2 == ColorName.Red);
+		Assert.False (color2 != ColorName.Red);
 	}
 	}
 
 
 	[Fact]
 	[Fact]
 	public void Color_InequalityOperator_WithColorNamesAndColor ()
 	public void Color_InequalityOperator_WithColorNamesAndColor ()
 	{
 	{
 		// Arrange
 		// Arrange
-		var color1 = new Color (ColorNames.Red);
+		var color1 = new Color (ColorName.Red);
 		var color2 = new Color (58, 150, 221); // Cyan in RGB
 		var color2 = new Color (58, 150, 221); // Cyan in RGB
 
 
 		// Act & Assert
 		// Act & Assert
-		Assert.False (ColorNames.Red == color2);
-		Assert.True (ColorNames.Red != color2);
+		Assert.False (ColorName.Red == color2);
+		Assert.True (ColorName.Red != color2);
 
 
-		Assert.False (color2 == ColorNames.Red);
-		Assert.True (color2 != ColorNames.Red);
+		Assert.False (color2 == ColorName.Red);
+		Assert.True (color2 != ColorName.Red);
 	}
 	}
 
 
 	[Fact]
 	[Fact]
 	public void Color_FromColorName_ConvertsColorNamesToColor ()
 	public void Color_FromColorName_ConvertsColorNamesToColor ()
 	{
 	{
 		// Arrange
 		// Arrange
-		var colorName = ColorNames.Red;
+		var colorName = ColorName.Red;
 		var expectedColor = new Color (197, 15, 31); // Red in RGB
 		var expectedColor = new Color (197, 15, 31); // Red in RGB
 
 
 		// Act
 		// Act
@@ -308,7 +308,7 @@ public class ColorTests {
 	{
 	{
 		// Arrange
 		// Arrange
 		var color = new Color (128, 64, 40); // Custom RGB color, closest to Yellow 
 		var color = new Color (128, 64, 40); // Custom RGB color, closest to Yellow 
-		var expectedColorName = ColorNames.Yellow;
+		var expectedColorName = ColorName.Yellow;
 
 
 		// Act
 		// Act
 		var colorName = color.ColorName;
 		var colorName = color.ColorName;
@@ -323,13 +323,13 @@ public class ColorTests {
 		// Test cases with RGB values and expected closest color names
 		// Test cases with RGB values and expected closest color names
 		var testCases = new []
 		var testCases = new []
 		{
 		{
-			(new Color(0, 0, 0), ColorNames.Black),
-			(new Color(255, 255, 255), ColorNames.White),
-			(new Color(5, 100, 255), ColorNames.BrightBlue),
-			(new Color(0, 255, 0), ColorNames.BrightGreen),
-			(new Color(255, 70, 8), ColorNames.BrightRed),
-			(new Color(0, 128, 128), ColorNames.Cyan),
-			(new Color(128, 64, 32), ColorNames.Yellow),
+			(new Color(0, 0, 0), ColorName.Black),
+			(new Color(255, 255, 255), ColorName.White),
+			(new Color(5, 100, 255), ColorName.BrightBlue),
+			(new Color(0, 255, 0), ColorName.BrightGreen),
+			(new Color(255, 70, 8), ColorName.BrightRed),
+			(new Color(0, 128, 128), ColorName.Cyan),
+			(new Color(128, 64, 32), ColorName.Yellow),
 		};
 		};
 
 
 		foreach (var testCase in testCases) {
 		foreach (var testCase in testCases) {
@@ -347,10 +347,10 @@ public class ColorTests {
 	{
 	{
 		// Arrange
 		// Arrange
 		var color = new Color (0, 0, 0); // Black
 		var color = new Color (0, 0, 0); // Black
-		var expectedColor = new Color (ColorNames.Magenta);
+		var expectedColor = new Color (ColorName.Magenta);
 
 
 		// Act
 		// Act
-		color.ColorName = ColorNames.Magenta;
+		color.ColorName = ColorName.Magenta;
 
 
 		// Assert
 		// Assert
 		Assert.Equal (expectedColor, color);
 		Assert.Equal (expectedColor, color);

+ 13 - 13
UnitTests/Views/ColorPickerTests.cs

@@ -11,7 +11,7 @@ namespace Terminal.Gui.ViewsTests {
 		public void Constructors ()
 		public void Constructors ()
 		{
 		{
 			var colorPicker = new ColorPicker ();
 			var colorPicker = new ColorPicker ();
-			Assert.Equal (ColorNames.Black, colorPicker.SelectedColor);
+			Assert.Equal (ColorName.Black, colorPicker.SelectedColor);
 			Assert.Equal (new Point (0, 0), colorPicker.Cursor);
 			Assert.Equal (new Point (0, 0), colorPicker.Cursor);
 			Assert.True (colorPicker.CanFocus);
 			Assert.True (colorPicker.CanFocus);
 
 
@@ -26,25 +26,25 @@ namespace Terminal.Gui.ViewsTests {
 		public void KeyBindings_Command ()
 		public void KeyBindings_Command ()
 		{
 		{
 			var colorPicker = new ColorPicker ();
 			var colorPicker = new ColorPicker ();
-			Assert.Equal (ColorNames.Black, colorPicker.SelectedColor);
+			Assert.Equal (ColorName.Black, colorPicker.SelectedColor);
 
 
 			Assert.True (colorPicker.ProcessKey (new KeyEvent (Key.CursorRight, new KeyModifiers ())));
 			Assert.True (colorPicker.ProcessKey (new KeyEvent (Key.CursorRight, new KeyModifiers ())));
-			Assert.Equal (ColorNames.Blue, colorPicker.SelectedColor);
+			Assert.Equal (ColorName.Blue, colorPicker.SelectedColor);
 
 
 			Assert.True (colorPicker.ProcessKey (new KeyEvent (Key.CursorDown, new KeyModifiers ())));
 			Assert.True (colorPicker.ProcessKey (new KeyEvent (Key.CursorDown, new KeyModifiers ())));
-			Assert.Equal (ColorNames.BrightBlue, colorPicker.SelectedColor);
+			Assert.Equal (ColorName.BrightBlue, colorPicker.SelectedColor);
 
 
 			Assert.True (colorPicker.ProcessKey (new KeyEvent (Key.CursorLeft, new KeyModifiers ())));
 			Assert.True (colorPicker.ProcessKey (new KeyEvent (Key.CursorLeft, new KeyModifiers ())));
-			Assert.Equal (ColorNames.DarkGray, colorPicker.SelectedColor);
+			Assert.Equal (ColorName.DarkGray, colorPicker.SelectedColor);
 
 
 			Assert.True (colorPicker.ProcessKey (new KeyEvent (Key.CursorUp, new KeyModifiers ())));
 			Assert.True (colorPicker.ProcessKey (new KeyEvent (Key.CursorUp, new KeyModifiers ())));
-			Assert.Equal (ColorNames.Black, colorPicker.SelectedColor);
+			Assert.Equal (ColorName.Black, colorPicker.SelectedColor);
 
 
 			Assert.True (colorPicker.ProcessKey (new KeyEvent (Key.CursorLeft, new KeyModifiers ())));
 			Assert.True (colorPicker.ProcessKey (new KeyEvent (Key.CursorLeft, new KeyModifiers ())));
-			Assert.Equal (ColorNames.Black, colorPicker.SelectedColor);
+			Assert.Equal (ColorName.Black, colorPicker.SelectedColor);
 
 
 			Assert.True (colorPicker.ProcessKey (new KeyEvent (Key.CursorUp, new KeyModifiers ())));
 			Assert.True (colorPicker.ProcessKey (new KeyEvent (Key.CursorUp, new KeyModifiers ())));
-			Assert.Equal (ColorNames.Black, colorPicker.SelectedColor);
+			Assert.Equal (ColorName.Black, colorPicker.SelectedColor);
 		}
 		}
 
 
 		[Fact]
 		[Fact]
@@ -57,14 +57,14 @@ namespace Terminal.Gui.ViewsTests {
 				Height = 4,
 				Height = 4,
 				Width = 32
 				Width = 32
 			};
 			};
-			Assert.Equal (ColorNames.Black, colorPicker.SelectedColor);
+			Assert.Equal (ColorName.Black, colorPicker.SelectedColor);
 			Application.Top.Add (colorPicker);
 			Application.Top.Add (colorPicker);
 			Application.Begin (Application.Top);
 			Application.Begin (Application.Top);
 
 
 			Assert.False (colorPicker.MouseEvent (new MouseEvent ()));
 			Assert.False (colorPicker.MouseEvent (new MouseEvent ()));
 
 
 			Assert.True (colorPicker.MouseEvent (new MouseEvent () { Flags = MouseFlags.Button1Clicked, X = 4, Y = 1 }));
 			Assert.True (colorPicker.MouseEvent (new MouseEvent () { Flags = MouseFlags.Button1Clicked, X = 4, Y = 1 }));
-			Assert.Equal (ColorNames.Blue, colorPicker.SelectedColor);
+			Assert.Equal (ColorName.Blue, colorPicker.SelectedColor);
 		}
 		}
 
 
 		[Fact]
 		[Fact]
@@ -72,7 +72,7 @@ namespace Terminal.Gui.ViewsTests {
 		public void SelectedColorAndCursor ()
 		public void SelectedColorAndCursor ()
 		{
 		{
 			var colorPicker = new ColorPicker ();
 			var colorPicker = new ColorPicker ();
-			colorPicker.SelectedColor = ColorNames.White;
+			colorPicker.SelectedColor = ColorName.White;
 			Assert.Equal (7, colorPicker.Cursor.X);
 			Assert.Equal (7, colorPicker.Cursor.X);
 			Assert.Equal (1, colorPicker.Cursor.Y);
 			Assert.Equal (1, colorPicker.Cursor.Y);
 
 
@@ -81,10 +81,10 @@ namespace Terminal.Gui.ViewsTests {
 			Assert.Equal (0, colorPicker.Cursor.Y);
 			Assert.Equal (0, colorPicker.Cursor.Y);
 
 
 			colorPicker.Cursor = new Point (7, 1);
 			colorPicker.Cursor = new Point (7, 1);
-			Assert.Equal (ColorNames.White, colorPicker.SelectedColor);
+			Assert.Equal (ColorName.White, colorPicker.SelectedColor);
 
 
 			colorPicker.Cursor = new Point (0, 0);
 			colorPicker.Cursor = new Point (0, 0);
-			Assert.Equal (ColorNames.Black, colorPicker.SelectedColor);
+			Assert.Equal (ColorName.Black, colorPicker.SelectedColor);
 		}
 		}
 	}
 	}
 }
 }