Răsfoiți Sursa

WIP - Everything seems to work

Tigger Kindel 1 an în urmă
părinte
comite
760ab804f0

+ 2 - 18
Terminal.Gui/Configuration/AttributeJsonConverter.cs

@@ -32,11 +32,9 @@ namespace Terminal.Gui {
 			Attribute attribute = new Attribute ();
 			Attribute attribute = new Attribute ();
 			Color foreground = (Color)(-1);
 			Color foreground = (Color)(-1);
 			Color background = (Color)(-1);
 			Color background = (Color)(-1);
-			TrueColor? trueColorForeground = null;
-			TrueColor? trueColorBackground = null;
 			while (reader.Read ()) {
 			while (reader.Read ()) {
 				if (reader.TokenType == JsonTokenType.EndObject) {
 				if (reader.TokenType == JsonTokenType.EndObject) {
-					if (!attribute.TrueColorForeground.HasValue || !attribute.TrueColorBackground.HasValue) {
+					if (attribute.Foreground.Value == -1 || attribute.Foreground.Value == -1) {
 						throw new JsonException ($"Both Foreground and Background colors must be provided.");
 						throw new JsonException ($"Both Foreground and Background colors must be provided.");
 					}
 					}
 					return attribute;
 					return attribute;
@@ -57,12 +55,6 @@ namespace Terminal.Gui {
 				case "background":
 				case "background":
 					background = JsonSerializer.Deserialize<Color> (color, options);
 					background = JsonSerializer.Deserialize<Color> (color, options);
 					break;
 					break;
-				case "truecolorforeground":
-					trueColorForeground = JsonSerializer.Deserialize<TrueColor> (color, options);
-					break;
-				case "truecolorbackground":
-					trueColorBackground = JsonSerializer.Deserialize<TrueColor> (color, options);
-					break;
 				//case "bright":
 				//case "bright":
 				//case "bold":
 				//case "bold":
 				//	attribute.Bright = reader.GetBoolean ();
 				//	attribute.Bright = reader.GetBoolean ();
@@ -92,9 +84,6 @@ namespace Terminal.Gui {
 				if (foreground != (Color)(-1) && background != (Color)(-1)) {
 				if (foreground != (Color)(-1) && background != (Color)(-1)) {
 					attribute = new Attribute (foreground, background);
 					attribute = new Attribute (foreground, background);
 				}
 				}
-				if (trueColorForeground.HasValue && trueColorBackground.HasValue) {
-					attribute = new Attribute (trueColorForeground, trueColorBackground);
-				}
 			}
 			}
 			throw new JsonException ();
 			throw new JsonException ();
 		}
 		}
@@ -106,12 +95,7 @@ namespace Terminal.Gui {
 			ColorJsonConverter.Instance.Write (writer, value.Foreground, options);
 			ColorJsonConverter.Instance.Write (writer, value.Foreground, options);
 			writer.WritePropertyName (nameof (Attribute.Background));
 			writer.WritePropertyName (nameof (Attribute.Background));
 			ColorJsonConverter.Instance.Write (writer, value.Background, options);
 			ColorJsonConverter.Instance.Write (writer, value.Background, options);
-			if (value.TrueColorForeground.HasValue && value.TrueColorBackground.HasValue) {
-				writer.WritePropertyName (nameof (Attribute.TrueColorForeground));
-				TrueColorJsonConverter.Instance.Write (writer, value.TrueColorForeground.Value, options);
-				writer.WritePropertyName (nameof (Attribute.TrueColorBackground));
-				TrueColorJsonConverter.Instance.Write (writer, value.TrueColorBackground.Value, options);
-			}
+			
 			writer.WriteEndObject ();
 			writer.WriteEndObject ();
 		}
 		}
 	}
 	}

+ 0 - 47
Terminal.Gui/Configuration/TrueColorJsonConverter.cs

@@ -1,47 +0,0 @@
-using System;
-using System.Text.Json;
-using System.Text.Json.Serialization;
-
-namespace Terminal.Gui {
-	/// <summary>
-	/// <see cref="JsonConverter{T}"/> for <see cref="TrueColor"/>.
-	/// </summary>
-	internal class TrueColorJsonConverter : JsonConverter<TrueColor> {
-		private static TrueColorJsonConverter instance;
-
-		/// <summary>
-		/// Singleton
-		/// </summary>
-		public static TrueColorJsonConverter Instance {
-			get {
-				if (instance == null) {
-					instance = new TrueColorJsonConverter ();
-				}
-
-				return instance;
-			}
-		}
-
-		public override TrueColor Read (ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
-		{
-			// Check if the value is a string
-			if (reader.TokenType == JsonTokenType.String) {
-				// Get the color string
-				var colorString = reader.GetString ();
-
-				if (!TrueColor.TryParse (colorString, out TrueColor? trueColor)) {
-					throw new JsonException ($"Invalid TrueColor: '{colorString}'");
-				}
-
-				return trueColor.Value;
-			} else {
-				throw new JsonException ($"Unexpected token when parsing TrueColor: {reader.TokenType}");
-			}
-		}
-
-		public override void Write (Utf8JsonWriter writer, TrueColor value, JsonSerializerOptions options)
-		{
-			writer.WriteStringValue (value.ToString ());
-		}
-	}
-}

+ 1 - 1
Terminal.Gui/ConsoleDrivers/ConsoleDriver.cs

@@ -441,7 +441,7 @@ public abstract class ConsoleDriver {
 	/// <param name="value">The platform-dependent color value.</param>
 	/// <param name="value">The platform-dependent color value.</param>
 	/// <param name="foreground">The foreground.</param>
 	/// <param name="foreground">The foreground.</param>
 	/// <param name="background">The background.</param>
 	/// <param name="background">The background.</param>
-	internal abstract void GetColors (int value, out Color foreground, out Color background);
+	internal abstract void GetColors (int value, out ColorNames foreground, out ColorNames background);
 
 
 	/// <summary>
 	/// <summary>
 	/// Gets the current <see cref="Attribute"/>.
 	/// Gets the current <see cref="Attribute"/>.

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

@@ -77,7 +77,7 @@ internal class CursesDriver : ConsoleDriver {
 		// TODO: for TrueColor - Use InitExtendedPair
 		// TODO: for TrueColor - Use InitExtendedPair
 		Curses.InitColorPair (v, foreground, background);
 		Curses.InitColorPair (v, foreground, background);
 		return new Attribute (
 		return new Attribute (
-			value: Curses.ColorPair (v),
+			platformColor: Curses.ColorPair (v),
 			foreground: CursesColorNumberToColor (foreground),
 			foreground: CursesColorNumberToColor (foreground),
 			background: CursesColorNumberToColor (background));
 			background: CursesColorNumberToColor (background));
 	}
 	}
@@ -94,7 +94,7 @@ internal class CursesDriver : ConsoleDriver {
 			return MakeColor (ColorNameToCursesColorNumber (fore), ColorNameToCursesColorNumber (back));
 			return MakeColor (ColorNameToCursesColorNumber (fore), ColorNameToCursesColorNumber (back));
 		} else {
 		} else {
 			return new Attribute (
 			return new Attribute (
-				value: 0,
+				platformColor: 0,
 				foreground: ColorNameToCursesColorNumber (fore),
 				foreground: ColorNameToCursesColorNumber (fore),
 				background: ColorNameToCursesColorNumber (back));
 				background: ColorNameToCursesColorNumber (back));
 		}
 		}
@@ -103,10 +103,10 @@ internal class CursesDriver : ConsoleDriver {
 	public override Attribute MakeColor (Color foreground, Color background)
 	public override Attribute MakeColor (Color foreground, Color background)
 	{
 	{
 		if (!RunningUnitTests) {
 		if (!RunningUnitTests) {
-			return MakeColor (foreground, background);
+			return MakeColor (foreground.ColorName, background.ColorName);
 		} else {
 		} else {
 			return new Attribute (
 			return new Attribute (
-				value: 0,
+				platformColor: 0,
 				foreground: foreground,
 				foreground: foreground,
 				background: background);
 				background: background);
 		}
 		}
@@ -151,41 +151,41 @@ internal class CursesDriver : ConsoleDriver {
 		throw new ArgumentException ("Invalid color code");
 		throw new ArgumentException ("Invalid color code");
 	}
 	}
 
 
-	static Color CursesColorNumberToColor (short color)
+	static ColorNames CursesColorNumberToColor (short color)
 	{
 	{
 		switch (color) {
 		switch (color) {
 		case Curses.COLOR_BLACK:
 		case Curses.COLOR_BLACK:
-			return new Color (Color.Black);
+			return Color.Black;
 		case Curses.COLOR_BLUE:
 		case Curses.COLOR_BLUE:
-			return new Color (Color.Blue);
+			return Color.Blue;
 		case Curses.COLOR_GREEN:
 		case Curses.COLOR_GREEN:
-			return (Color)Color.Green;
+			return Color.Green;
 		case Curses.COLOR_CYAN:
 		case Curses.COLOR_CYAN:
-			return (Color)Color.Cyan;
+			return Color.Cyan;
 		case Curses.COLOR_RED:
 		case Curses.COLOR_RED:
-			return (Color)Color.Red;
+			return Color.Red;
 		case Curses.COLOR_MAGENTA:
 		case Curses.COLOR_MAGENTA:
-			return (Color)Color.Magenta;
+			return Color.Magenta;
 		case Curses.COLOR_YELLOW:
 		case Curses.COLOR_YELLOW:
-			return (Color)Color.Brown;
+			return Color.Brown;
 		case Curses.COLOR_WHITE:
 		case Curses.COLOR_WHITE:
-			return (Color)Color.Gray;
+			return Color.Gray;
 		case Curses.COLOR_GRAY:
 		case Curses.COLOR_GRAY:
-			return (Color)Color.DarkGray;
+			return Color.DarkGray;
 		case Curses.COLOR_BLUE | Curses.COLOR_GRAY:
 		case Curses.COLOR_BLUE | Curses.COLOR_GRAY:
-			return (Color)Color.BrightBlue;
+			return Color.BrightBlue;
 		case Curses.COLOR_GREEN | Curses.COLOR_GRAY:
 		case Curses.COLOR_GREEN | Curses.COLOR_GRAY:
-			return (Color)Color.BrightGreen;
+			return Color.BrightGreen;
 		case Curses.COLOR_CYAN | Curses.COLOR_GRAY:
 		case Curses.COLOR_CYAN | Curses.COLOR_GRAY:
-			return (Color)Color.BrightCyan;
+			return Color.BrightCyan;
 		case Curses.COLOR_RED | Curses.COLOR_GRAY:
 		case Curses.COLOR_RED | Curses.COLOR_GRAY:
-			return (Color)Color.BrightRed;
+			return Color.BrightRed;
 		case Curses.COLOR_MAGENTA | Curses.COLOR_GRAY:
 		case Curses.COLOR_MAGENTA | Curses.COLOR_GRAY:
-			return (Color)Color.BrightMagenta;
+			return Color.BrightMagenta;
 		case Curses.COLOR_YELLOW | Curses.COLOR_GRAY:
 		case Curses.COLOR_YELLOW | Curses.COLOR_GRAY:
-			return (Color)Color.BrightYellow;
+			return Color.BrightYellow;
 		case Curses.COLOR_WHITE | Curses.COLOR_GRAY:
 		case Curses.COLOR_WHITE | Curses.COLOR_GRAY:
-			return (Color)Color.White;
+			return Color.White;
 		}
 		}
 		throw new ArgumentException ("Invalid curses color code");
 		throw new ArgumentException ("Invalid curses color code");
 	}
 	}
@@ -196,7 +196,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>
-	internal override void GetColors (int value, out Color foreground, out Color background)
+	internal override void GetColors (int value, out ColorNames foreground, out ColorNames background)
 	{
 	{
 		// Assume a 4-bit encoded value for both foreground and background colors.
 		// Assume a 4-bit encoded value for both foreground and background colors.
 		foreground = CursesColorNumberToColor ((short)((value >> 4) & 0xF));
 		foreground = CursesColorNumberToColor ((short)((value >> 4) & 0xF));

+ 4 - 4
Terminal.Gui/ConsoleDrivers/FakeDriver/FakeDriver.cs

@@ -207,11 +207,11 @@ public class FakeDriver : ConsoleDriver {
 	/// Extracts the foreground and background colors from the encoded value.
 	/// Extracts the foreground and background colors from the encoded value.
 	/// Assumes a 4-bit encoded value for both foreground and background colors.
 	/// Assumes a 4-bit encoded value for both foreground and background colors.
 	/// </remarks>
 	/// </remarks>
-	internal override void GetColors (int value, out Color foreground, out Color background)
+	internal override void GetColors (int value, out ColorNames foreground, out ColorNames background)
 	{
 	{
 		// Assume a 4-bit encoded value for both foreground and background colors.
 		// Assume a 4-bit encoded value for both foreground and background colors.
-		foreground = (Color)((value >> 16) & 0xF);
-		background = (Color)(value & 0xF);
+		foreground = (ColorNames)((value >> 16) & 0xF);
+		background = (ColorNames)(value & 0xF);
 	}
 	}
 
 
 	/// <remarks>
 	/// <remarks>
@@ -223,7 +223,7 @@ public class FakeDriver : ConsoleDriver {
 	{
 	{
 		// Encode the colors into the int value.
 		// Encode the colors into the int value.
 		return new Attribute (
 		return new Attribute (
-			value: ((((int)foreground) & 0xffff) << 16) | (((int)background) & 0xffff),
+			platformColor: ((((int)foreground) & 0xffff) << 16) | (((int)background) & 0xffff),
 			foreground: foreground,
 			foreground: foreground,
 			background: background
 			background: background
 		);
 		);

+ 8 - 8
Terminal.Gui/ConsoleDrivers/NetDriver.cs

@@ -795,8 +795,8 @@ internal class NetDriver : ConsoleDriver {
 							output.Append (EscSeqUtils.CSI_SetGraphicsRendition (
 							output.Append (EscSeqUtils.CSI_SetGraphicsRendition (
 								MapColors ((ConsoleColor)attr.Background.Value, false), MapColors ((ConsoleColor)attr.Foreground.Value, true)));
 								MapColors ((ConsoleColor)attr.Background.Value, false), MapColors ((ConsoleColor)attr.Foreground.Value, true)));
 						} else {
 						} else {
-							output.Append (EscSeqUtils.CSI_SetForegroundColorRGB (attr.TrueColorForeground.Value.Red, attr.TrueColorForeground.Value.Green, attr.TrueColorForeground.Value.Blue));
-							output.Append (EscSeqUtils.CSI_SetBackgroundColorRGB (attr.TrueColorBackground.Value.Red, attr.TrueColorBackground.Value.Green, attr.TrueColorBackground.Value.Blue));
+							output.Append (EscSeqUtils.CSI_SetForegroundColorRGB (attr.Foreground.R, attr.Foreground.G, attr.Foreground.B));
+							output.Append (EscSeqUtils.CSI_SetBackgroundColorRGB (attr.Background.R, attr.Background.G, attr.Background.B));
 						}
 						}
 
 
 					}
 					}
@@ -867,11 +867,11 @@ internal class NetDriver : ConsoleDriver {
 	/// Extracts the foreground and background colors from the encoded value.
 	/// Extracts the foreground and background colors from the encoded value.
 	/// Assumes a 4-bit encoded value for both foreground and background colors.
 	/// Assumes a 4-bit encoded value for both foreground and background colors.
 	/// </remarks>
 	/// </remarks>
-	internal override void GetColors (int value, out Color foreground, out Color background)
+	internal override void GetColors (int value, out ColorNames foreground, out ColorNames background)
 	{
 	{
 		// Assume a 4-bit encoded value for both foreground and background colors.
 		// Assume a 4-bit encoded value for both foreground and background colors.
-		foreground = (Color)((value >> 16) & 0xF);
-		background = (Color)(value & 0xF);
+		foreground = (ColorNames)((value >> 16) & 0xF);
+		background = (ColorNames)(value & 0xF);
 	}
 	}
 
 
 	/// <remarks>
 	/// <remarks>
@@ -883,9 +883,9 @@ internal class NetDriver : ConsoleDriver {
 	{
 	{
 		// Encode the colors into the int value.
 		// Encode the colors into the int value.
 		return new Attribute (
 		return new Attribute (
-		    value: ((((int)foreground) & 0xffff) << 16) | (((int)background) & 0xffff),
-		    foreground: foreground,
-		    background: background
+			platformColor: ((((int)foreground) & 0xffff) << 16) | (((int)background) & 0xffff),
+			foreground: foreground,
+			background: background
 		);
 		);
 	}
 	}
 
 

+ 8 - 8
Terminal.Gui/ConsoleDrivers/WindowsDriver.cs

@@ -85,8 +85,8 @@ internal class WindowsConsole {
 
 
 				if (attr != prev) {
 				if (attr != prev) {
 					prev = attr;
 					prev = attr;
-					_stringBuilder.Append (EscSeqUtils.CSI_SetForegroundColorRGB (attr.TrueColorForeground.Value.Red, attr.TrueColorForeground.Value.Green, attr.TrueColorForeground.Value.Blue));
-					_stringBuilder.Append (EscSeqUtils.CSI_SetBackgroundColorRGB (attr.TrueColorBackground.Value.Red, attr.TrueColorBackground.Value.Green, attr.TrueColorBackground.Value.Blue));
+					_stringBuilder.Append (EscSeqUtils.CSI_SetForegroundColorRGB (attr.Foreground.R, attr.Foreground.G, attr.Foreground.B));
+					_stringBuilder.Append (EscSeqUtils.CSI_SetBackgroundColorRGB (attr.Background.R, attr.Background.G, attr.Background.B));
 				}
 				}
 
 
 				if (info.Char != '\x1b') {
 				if (info.Char != '\x1b') {
@@ -1649,9 +1649,9 @@ internal class WindowsDriver : ConsoleDriver {
 	{
 	{
 		// Encode the colors into the int value.
 		// Encode the colors into the int value.
 		return new Attribute (
 		return new Attribute (
-		    value: (((int)foreground) | ((int)background << 4)),
-		    foreground: foreground,
-		    background: background
+			platformColor: (((int)foreground.ColorName) | ((int)background.ColorName << 4)),
+			foreground: foreground,
+			background: background
 		);
 		);
 	}
 	}
 	public override Attribute MakeColor (ColorNames foreground, ColorNames background)
 	public override Attribute MakeColor (ColorNames foreground, ColorNames background)
@@ -1663,11 +1663,11 @@ internal class WindowsDriver : ConsoleDriver {
 	/// Extracts the foreground and background colors from the encoded value.
 	/// Extracts the foreground and background colors from the encoded value.
 	/// Assumes a 4-bit encoded value for both foreground and background colors.
 	/// Assumes a 4-bit encoded value for both foreground and background colors.
 	/// </summary>
 	/// </summary>
-	internal override void GetColors (int value, out Color foreground, out Color background)
+	internal override void GetColors (int value, out ColorNames foreground, out ColorNames background)
 	{
 	{
 		// Assume a 4-bit encoded value for both foreground and background colors.
 		// Assume a 4-bit encoded value for both foreground and background colors.
-		foreground = (Color)((value >> 16) & 0xF);
-		background = (Color)(value & 0xF);
+		foreground = (ColorNames)((value >> 16) & 0xF);
+		background = (ColorNames)(value & 0xF);
 	}
 	}
 
 
 	#endregion
 	#endregion

+ 246 - 308
Terminal.Gui/Drawing/Color.cs

@@ -192,11 +192,11 @@ namespace Terminal.Gui {
 			{ new Color (0, 0, 0x80),ColorNames.Blue },
 			{ new Color (0, 0, 0x80),ColorNames.Blue },
 			{ new Color (0, 0x80, 0),ColorNames.Green},
 			{ new Color (0, 0x80, 0),ColorNames.Green},
 			{ new Color (0, 0x80, 0x80),ColorNames.Cyan},
 			{ new Color (0, 0x80, 0x80),ColorNames.Cyan},
-			{ new Color (0x80, 0, 0),ColorNames.Red},
-			{ new Color (0x80, 0, 0x80),ColorNames.Magenta},
+			{ new Color (0xE0, 0, 0),ColorNames.Red},
+			{ new Color (0xE0, 0, 0xE0),ColorNames.Magenta},
 			{ new Color (0xC1, 0x9C, 0x00),ColorNames.Brown},
 			{ new Color (0xC1, 0x9C, 0x00),ColorNames.Brown},
 			{ new Color (0xC0, 0xC0, 0xC0),ColorNames.Gray},
 			{ new Color (0xC0, 0xC0, 0xC0),ColorNames.Gray},
-			{ new Color (0x80, 0x80, 0x80),ColorNames.DarkGray},
+			{ new Color (0xA0, 0xA0, 0xA0),ColorNames.DarkGray},
 			{ new Color (0, 0, 0xFF),ColorNames.BrightBlue},
 			{ new Color (0, 0, 0xFF),ColorNames.BrightBlue},
 			{ new Color (0, 0xFF, 0),ColorNames.BrightGreen},
 			{ new Color (0, 0xFF, 0),ColorNames.BrightGreen},
 			{ new Color (0, 0xFF, 0xFF),ColorNames.BrightCyan},
 			{ new Color (0, 0xFF, 0xFF),ColorNames.BrightCyan},
@@ -558,214 +558,214 @@ namespace Terminal.Gui {
 		}
 		}
 	}
 	}
 
 
-	/// <summary>
-	/// Indicates the RGB for true colors.
-	/// </summary>
-	[JsonConverter (typeof (TrueColorJsonConverter))]
-	public readonly struct TrueColor : IEquatable<TrueColor> {
-		private static readonly ImmutableDictionary<TrueColor, ColorNames> TrueColorToConsoleColorMap = new Dictionary<TrueColor, ColorNames> () {
-			{ new TrueColor (0,0,0),Color.Black },
-			{ new TrueColor (0, 0, 0x80),Color.Blue },
-			{ new TrueColor (0, 0x80, 0),Color.Green},
-			{ new TrueColor (0, 0x80, 0x80),Color.Cyan},
-			{ new TrueColor (0x80, 0, 0),Color.Red},
-			{ new TrueColor (0x80, 0, 0x80),Color.Magenta},
-			{ new TrueColor (0xC1, 0x9C, 0x00),Color.Brown},  // TODO confirm this
-			{ new TrueColor (0xC0, 0xC0, 0xC0),Color.Gray},
-			{ new TrueColor (0x80, 0x80, 0x80),Color.DarkGray},
-			{ new TrueColor (0, 0, 0xFF),Color.BrightBlue},
-			{ new TrueColor (0, 0xFF, 0),Color.BrightGreen},
-			{ new TrueColor (0, 0xFF, 0xFF),Color.BrightCyan},
-			{ new TrueColor (0xFF, 0, 0),Color.BrightRed},
-			{ new TrueColor (0xFF, 0, 0xFF),Color.BrightMagenta },
-			{ new TrueColor (0xFF, 0xFF, 0),Color.BrightYellow},
-			{ new TrueColor (0xFF, 0xFF, 0xFF),Color.White},
-		}.ToImmutableDictionary ();
-
-		/// <summary>
-		/// Red color component.
-		/// </summary>
-		public int Red { get; }
-		/// <summary>
-		/// Green color component.
-		/// </summary>
-		public int Green { get; }
-		/// <summary>
-		/// Blue color component.
-		/// </summary>
-		public int Blue { get; }
-
-		/// <summary>
-		/// Blue color component.
-		/// </summary>
-		/// <remarks>
-		/// Not currently supported; here for completeness. 
-		/// </remarks>
-		public int Alpha { get; }
-
-		/// <summary>
-		/// Initializes a new instance of the <see cref="Color"/> class.
-		/// </summary>
-		/// <param name="red"></param>
-		/// <param name="green"></param>
-		/// <param name="blue"></param>
-		public TrueColor (int red, int green, int blue)
-		{
-			Red = red;
-			Green = green;
-			Blue = blue;
-		}
-
-		/// <summary>
-		/// Converts the provided text to a new <see cref="Color"/> instance.
-		/// </summary>
-		/// <param name="text">The text to analyze.</param>
-		/// <param name="color">The parsed value.</param>
-		/// <returns>A boolean value indicating whether it was successful.</returns>
-		public static bool TryParse (string text, [NotNullWhen (true)] out TrueColor? color)
-		{
-			// empty color
-			if ((text == null) || (text.Length == 0)) {
-				color = null;
-				return false;
-			}
-
-			// #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 TrueColor (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 TrueColor (r, g, b);
-				}
-				return true;
-			}
-
-
-			// rgb(XX,YY,ZZ)
-			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 TrueColor (r, g, b);
-				return true;
-			}
-
-			color = null;
-			return false;
-		}
-
-		/// <summary>
-		/// Converts a <see cref="Color"/> to a <see cref="TrueColor"/> using a default mapping.
-		/// </summary>
-		/// <param name="consoleColor">The <see cref="Color"/> to convert.</param>
-		/// <returns></returns>
-		public static TrueColor? FromColorName (ColorNames consoleColor)
-		{
-			return consoleColor switch {
-				ColorNames.Black => new TrueColor (0, 0, 0),
-				ColorNames.Blue => new TrueColor (0, 0, 0x80),
-				ColorNames.Green => new TrueColor (0, 0x80, 0),
-				ColorNames.Cyan => new TrueColor (0, 0x80, 0x80),
-				ColorNames.Red => new TrueColor (0x80, 0, 0),
-				ColorNames.Magenta => new TrueColor (0x80, 0, 0x80),
-				ColorNames.Brown => new TrueColor (0xC1, 0x9C, 0x00) // TODO confirm this
-				,
-				ColorNames.Gray => new TrueColor (0xC0, 0xC0, 0xC0),
-				ColorNames.DarkGray => new TrueColor (0x80, 0x80, 0x80),
-				ColorNames.BrightBlue => new TrueColor (0, 0, 0xFF),
-				ColorNames.BrightGreen => new TrueColor (0, 0xFF, 0),
-				ColorNames.BrightCyan => new TrueColor (0, 0xFF, 0xFF),
-				ColorNames.BrightRed => new TrueColor (0xFF, 0, 0),
-				ColorNames.BrightMagenta => new TrueColor (0xFF, 0, 0xFF),
-				ColorNames.BrightYellow => new TrueColor (0xFF, 0xFF, 0),
-				ColorNames.White => new TrueColor (0xFF, 0xFF, 0xFF),
-				var _ => null
-			};
-		}
-
-		/// <summary>
-		/// Converts a <see cref="Color"/> to a <see cref="TrueColor"/> using a default mapping.
-		/// </summary>
-		/// <param name="consoleColor">The <see cref="Color"/> to convert.</param>
-		/// <returns></returns>
-		public static TrueColor? FromColorName (int color16)
-		{
-			return FromColorName ((ColorNames)color16);
-		}
-
-		/// <summary>
-		/// Converts the provided <see cref="TrueColor"/> to <see cref="Color"/> using a default mapping.
-		/// </summary>
-		/// <param name="trueColor"></param>
-		/// <returns></returns>
-		public static Color ToConsoleColor (TrueColor? trueColor)
-		{
-			if (trueColor.HasValue) {
-				return new Color (TrueColorToConsoleColorMap.MinBy (kv => CalculateDistance (kv.Key, trueColor.Value)).Value);
-			} else {
-				return (Color)(-1);
-			}
-		}
-
-		private static float CalculateDistance (TrueColor color1, TrueColor color2)
-		{
-			// use RGB distance
-			return
-				Math.Abs (color1.Red - color2.Red) +
-				Math.Abs (color1.Green - color2.Green) +
-				Math.Abs (color1.Blue - color2.Blue);
-		}
-
-		/// <inheritdoc/>
-		public static bool operator == (TrueColor left, TrueColor right)
-		{
-			return left.Equals (right);
-		}
-
-		/// <inheritdoc/>
-		public static bool operator != (TrueColor left, TrueColor right)
-		{
-			return !left.Equals (right);
-		}
-
-		/// <inheritdoc/>
-		public override bool Equals (object obj)
-		{
-			return obj is TrueColor other && Equals (other);
-		}
-
-		/// <inheritdoc/>
-		public bool Equals (TrueColor other)
-		{
-			return
-				Red == other.Red &&
-				Green == other.Green &&
-				Blue == other.Blue;
-		}
-
-		/// <inheritdoc/>
-		public override int GetHashCode ()
-		{
-			return HashCode.Combine (Red, Green, Blue);
-		}
-
-		/// <inheritdoc/>
-		public override string ToString ()
-		{
-			return $"#{Red:X2}{Green:X2}{Blue:X2}";
-		}
-	}
+	///// <summary>
+	///// Indicates the RGB for true colors.
+	///// </summary>
+	//[JsonConverter (typeof (TrueColorJsonConverter))]
+	//public readonly struct TrueColor : IEquatable<TrueColor> {
+	//	private static readonly ImmutableDictionary<TrueColor, ColorNames> TrueColorToConsoleColorMap = new Dictionary<TrueColor, ColorNames> () {
+	//		{ new TrueColor (0,0,0),Color.Black },
+	//		{ new TrueColor (0, 0, 0x80),Color.Blue },
+	//		{ new TrueColor (0, 0x80, 0),Color.Green},
+	//		{ new TrueColor (0, 0x80, 0x80),Color.Cyan},
+	//		{ new TrueColor (0x80, 0, 0),Color.Red},
+	//		{ new TrueColor (0x80, 0, 0x80),Color.Magenta},
+	//		{ new TrueColor (0xC1, 0x9C, 0x00),Color.Brown},  // TODO confirm this
+	//		{ new TrueColor (0xC0, 0xC0, 0xC0),Color.Gray},
+	//		{ new TrueColor (0x80, 0x80, 0x80),Color.DarkGray},
+	//		{ new TrueColor (0, 0, 0xFF),Color.BrightBlue},
+	//		{ new TrueColor (0, 0xFF, 0),Color.BrightGreen},
+	//		{ new TrueColor (0, 0xFF, 0xFF),Color.BrightCyan},
+	//		{ new TrueColor (0xFF, 0, 0),Color.BrightRed},
+	//		{ new TrueColor (0xFF, 0, 0xFF),Color.BrightMagenta },
+	//		{ new TrueColor (0xFF, 0xFF, 0),Color.BrightYellow},
+	//		{ new TrueColor (0xFF, 0xFF, 0xFF),Color.White},
+	//	}.ToImmutableDictionary ();
+
+	//	/// <summary>
+	//	/// Red color component.
+	//	/// </summary>
+	//	public int Red { get; }
+	//	/// <summary>
+	//	/// Green color component.
+	//	/// </summary>
+	//	public int Green { get; }
+	//	/// <summary>
+	//	/// Blue color component.
+	//	/// </summary>
+	//	public int Blue { get; }
+
+	//	/// <summary>
+	//	/// Blue color component.
+	//	/// </summary>
+	//	/// <remarks>
+	//	/// Not currently supported; here for completeness. 
+	//	/// </remarks>
+	//	public int Alpha { get; }
+
+	//	/// <summary>
+	//	/// Initializes a new instance of the <see cref="Color"/> class.
+	//	/// </summary>
+	//	/// <param name="red"></param>
+	//	/// <param name="green"></param>
+	//	/// <param name="blue"></param>
+	//	public TrueColor (int red, int green, int blue)
+	//	{
+	//		Red = red;
+	//		Green = green;
+	//		Blue = blue;
+	//	}
+
+	//	/// <summary>
+	//	/// Converts the provided text to a new <see cref="Color"/> instance.
+	//	/// </summary>
+	//	/// <param name="text">The text to analyze.</param>
+	//	/// <param name="color">The parsed value.</param>
+	//	/// <returns>A boolean value indicating whether it was successful.</returns>
+	//	public static bool TryParse (string text, [NotNullWhen (true)] out TrueColor? color)
+	//	{
+	//		// empty color
+	//		if ((text == null) || (text.Length == 0)) {
+	//			color = null;
+	//			return false;
+	//		}
+
+	//		// #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 TrueColor (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 TrueColor (r, g, b);
+	//			}
+	//			return true;
+	//		}
+
+
+	//		// rgb(XX,YY,ZZ)
+	//		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 TrueColor (r, g, b);
+	//			return true;
+	//		}
+
+	//		color = null;
+	//		return false;
+	//	}
+
+	//	/// <summary>
+	//	/// Converts a <see cref="Color"/> to a <see cref="TrueColor"/> using a default mapping.
+	//	/// </summary>
+	//	/// <param name="consoleColor">The <see cref="Color"/> to convert.</param>
+	//	/// <returns></returns>
+	//	public static TrueColor? FromColorName (ColorNames consoleColor)
+	//	{
+	//		return consoleColor switch {
+	//			ColorNames.Black => new TrueColor (0, 0, 0),
+	//			ColorNames.Blue => new TrueColor (0, 0, 0x80),
+	//			ColorNames.Green => new TrueColor (0, 0x80, 0),
+	//			ColorNames.Cyan => new TrueColor (0, 0x80, 0x80),
+	//			ColorNames.Red => new TrueColor (0x80, 0, 0),
+	//			ColorNames.Magenta => new TrueColor (0x80, 0, 0x80),
+	//			ColorNames.Brown => new TrueColor (0xC1, 0x9C, 0x00) // TODO confirm this
+	//			,
+	//			ColorNames.Gray => new TrueColor (0xC0, 0xC0, 0xC0),
+	//			ColorNames.DarkGray => new TrueColor (0x80, 0x80, 0x80),
+	//			ColorNames.BrightBlue => new TrueColor (0, 0, 0xFF),
+	//			ColorNames.BrightGreen => new TrueColor (0, 0xFF, 0),
+	//			ColorNames.BrightCyan => new TrueColor (0, 0xFF, 0xFF),
+	//			ColorNames.BrightRed => new TrueColor (0xFF, 0, 0),
+	//			ColorNames.BrightMagenta => new TrueColor (0xFF, 0, 0xFF),
+	//			ColorNames.BrightYellow => new TrueColor (0xFF, 0xFF, 0),
+	//			ColorNames.White => new TrueColor (0xFF, 0xFF, 0xFF),
+	//			var _ => null
+	//		};
+	//	}
+
+	//	/// <summary>
+	//	/// Converts a <see cref="Color"/> to a <see cref="TrueColor"/> using a default mapping.
+	//	/// </summary>
+	//	/// <param name="consoleColor">The <see cref="Color"/> to convert.</param>
+	//	/// <returns></returns>
+	//	public static TrueColor? FromColorName (int color16)
+	//	{
+	//		return FromColorName ((ColorNames)color16);
+	//	}
+
+	//	/// <summary>
+	//	/// Converts the provided <see cref="TrueColor"/> to <see cref="Color"/> using a default mapping.
+	//	/// </summary>
+	//	/// <param name="trueColor"></param>
+	//	/// <returns></returns>
+	//	public static Color ToConsoleColor (TrueColor? trueColor)
+	//	{
+	//		if (trueColor.HasValue) {
+	//			return new Color (TrueColorToConsoleColorMap.MinBy (kv => CalculateDistance (kv.Key, trueColor.Value)).Value);
+	//		} else {
+	//			return (Color)(-1);
+	//		}
+	//	}
+
+	//	private static float CalculateDistance (TrueColor color1, TrueColor color2)
+	//	{
+	//		// use RGB distance
+	//		return
+	//			Math.Abs (color1.Red - color2.Red) +
+	//			Math.Abs (color1.Green - color2.Green) +
+	//			Math.Abs (color1.Blue - color2.Blue);
+	//	}
+
+	//	/// <inheritdoc/>
+	//	public static bool operator == (TrueColor left, TrueColor right)
+	//	{
+	//		return left.Equals (right);
+	//	}
+
+	//	/// <inheritdoc/>
+	//	public static bool operator != (TrueColor left, TrueColor right)
+	//	{
+	//		return !left.Equals (right);
+	//	}
+
+	//	/// <inheritdoc/>
+	//	public override bool Equals (object obj)
+	//	{
+	//		return obj is TrueColor other && Equals (other);
+	//	}
+
+	//	/// <inheritdoc/>
+	//	public bool Equals (TrueColor other)
+	//	{
+	//		return
+	//			Red == other.Red &&
+	//			Green == other.Green &&
+	//			Blue == other.Blue;
+	//	}
+
+	//	/// <inheritdoc/>
+	//	public override int GetHashCode ()
+	//	{
+	//		return HashCode.Combine (Red, Green, Blue);
+	//	}
+
+	//	/// <inheritdoc/>
+	//	public override string ToString ()
+	//	{
+	//		return $"#{Red:X2}{Green:X2}{Blue:X2}";
+	//	}
+	//}
 
 
 	/// <summary>
 	/// <summary>
 	/// Attributes represent how text is styled when displayed in the terminal. 
 	/// Attributes represent how text is styled when displayed in the terminal. 
@@ -804,36 +804,22 @@ namespace Terminal.Gui {
 		public Color Background { get; private init; }
 		public Color Background { get; private init; }
 
 
 		/// <summary>
 		/// <summary>
-		/// Gets the TrueColor foreground color.
-		/// </summary>
-		[JsonConverter (typeof (TrueColorJsonConverter))]
-		public TrueColor? TrueColorForeground { get; private init; }
-
-		/// <summary>
-		/// Gets the TrueColor background color.
-		/// </summary>
-		[JsonConverter (typeof (TrueColorJsonConverter))]
-		public TrueColor? TrueColorBackground { get; private init; }
-
-		/// <summary>
-		/// Initializes a new instance with a 24-bit rgb value.
+		/// Initializes a new instance with platform specific color value.
 		/// </summary>
 		/// </summary>
 		/// <param name="value">Value.</param>
 		/// <param name="value">Value.</param>
-		internal Attribute (int argb)
+		internal Attribute (int platformColor)
 		{
 		{
-			Color foreground = default;
-			Color background = default;
+			ColorNames foreground = default;
+			ColorNames background = default;
 
 
 			Initialized = false;
 			Initialized = false;
 			if (Application.Driver != null) {
 			if (Application.Driver != null) {
-				Application.Driver.GetColors (argb, out foreground, out background);
+				Application.Driver.GetColors (platformColor, out foreground, out background);
 				Initialized = true;
 				Initialized = true;
 			}
 			}
-			Value = argb;
-			Foreground = foreground;
-			Background = background;
-			//TrueColorForeground = TrueColor.FromColorName (foreground);
-			//TrueColorBackground = TrueColor.FromColorName (background);
+			Value = platformColor;
+			Foreground = (Color)foreground;
+			Background = (Color)background;
 		}
 		}
 
 
 		/// <summary>
 		/// <summary>
@@ -842,34 +828,44 @@ namespace Terminal.Gui {
 		/// <param name="value">Value.</param>
 		/// <param name="value">Value.</param>
 		internal Attribute (ColorNames colorName)
 		internal Attribute (ColorNames colorName)
 		{
 		{
-			Color foreground = default;
-			Color background = default;
+			ColorNames foreground = default;
+			ColorNames background = default;
 
 
 			Initialized = false;
 			Initialized = false;
 			if (Application.Driver != null) {
 			if (Application.Driver != null) {
-				Application.Driver.GetColors (((Color)colorName).Value, out foreground, out background);
+				Application.Driver.GetColors ((int)colorName, out foreground, out background);
 				Initialized = true;
 				Initialized = true;
 			}
 			}
 			Value = ((Color)colorName).Value;
 			Value = ((Color)colorName).Value;
-			Foreground = foreground;
-			Background = background;
-			//TrueColorForeground = TrueColor.FromColorName (foreground);
-			//TrueColorBackground = TrueColor.FromColorName (background);
+			Foreground = (Color)foreground;
+			Background = (Color)background;
 		}
 		}
 
 
 		/// <summary>
 		/// <summary>
 		/// Initializes a new instance of the <see cref="Attribute"/> struct.
 		/// Initializes a new instance of the <see cref="Attribute"/> struct.
 		/// </summary>
 		/// </summary>
-		/// <param name="value">platform-dependent color value.</param>
+		/// <param name="platformColor">platform-dependent color value.</param>
 		/// <param name="foreground">Foreground</param>
 		/// <param name="foreground">Foreground</param>
 		/// <param name="background">Background</param>
 		/// <param name="background">Background</param>
-		public Attribute (int value, Color foreground, Color background)
+		public Attribute (int platformColor, Color foreground, Color background)
 		{
 		{
 			Foreground = foreground;
 			Foreground = foreground;
 			Background = background;
 			Background = background;
-			TrueColorForeground = TrueColor.FromColorName ((ColorNames)foreground.Value);
-			TrueColorBackground = TrueColor.FromColorName ((ColorNames)background.Value);
-			Value = value;
+			Value = platformColor;
+			Initialized = true;
+		}
+
+		/// <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>
+		public Attribute (int platformColor, ColorNames foreground, ColorNames background)
+		{
+			Foreground = (Color)foreground;
+			Background = (Color)background;
+			Value = platformColor;
 			Initialized = true;
 			Initialized = true;
 		}
 		}
 
 
@@ -882,8 +878,6 @@ namespace Terminal.Gui {
 		{
 		{
 			Foreground = foreground;
 			Foreground = foreground;
 			Background = background;
 			Background = background;
-			TrueColorForeground = TrueColor.FromColorName ((ColorNames)foreground.Value);
-			TrueColorBackground = TrueColor.FromColorName ((ColorNames)background.Value);
 
 
 			var make = Make (foreground, background);
 			var make = Make (foreground, background);
 			Initialized = make.Initialized;
 			Initialized = make.Initialized;
@@ -899,8 +893,6 @@ namespace Terminal.Gui {
 		{
 		{
 			Foreground = new Color (foreground);
 			Foreground = new Color (foreground);
 			Background = new Color (background);
 			Background = new Color (background);
-			TrueColorForeground = TrueColor.FromColorName (foreground);
-			TrueColorBackground = TrueColor.FromColorName (background);
 
 
 			var make = Make (foreground, background);
 			var make = Make (foreground, background);
 			Initialized = make.Initialized;
 			Initialized = make.Initialized;
@@ -917,8 +909,6 @@ namespace Terminal.Gui {
 		{
 		{
 			Foreground = new Color (foreground);
 			Foreground = new Color (foreground);
 			Background = background;
 			Background = background;
-			TrueColorForeground = TrueColor.FromColorName (foreground);
-			TrueColorBackground = TrueColor.FromColorName (background.ColorName);
 
 
 			var make = Make (foreground, background);
 			var make = Make (foreground, background);
 			Initialized = make.Initialized;
 			Initialized = make.Initialized;
@@ -934,58 +924,12 @@ namespace Terminal.Gui {
 		{
 		{
 			Foreground = foreground;
 			Foreground = foreground;
 			Background = new Color (background);
 			Background = new Color (background);
-			TrueColorForeground = TrueColor.FromColorName (foreground.ColorName);
-			TrueColorBackground = TrueColor.FromColorName (background);
 
 
 			var make = Make (foreground, background);
 			var make = Make (foreground, background);
 			Initialized = make.Initialized;
 			Initialized = make.Initialized;
 			Value = make.Value;
 			Value = make.Value;
 		}
 		}
 
 
-		/// <summary>
-		/// Initializes a new instance of the <see cref="Attribute"/> class.  Populates
-		/// <see cref="TrueColorBackground"/> and <see cref="TrueColorForeground"/>. Also computes
-		/// <see cref="Foreground"/> and <see cref="Background"/> (basic console colors) in case
-		/// driver does not support true color rendering.
-		/// </summary>
-		/// <param name="trueColorForeground"></param>
-		/// <param name="trueColorBackground"></param>
-		public Attribute (TrueColor? trueColorForeground, TrueColor? trueColorBackground)
-		{
-			Foreground = TrueColor.ToConsoleColor (trueColorForeground);
-			Background = TrueColor.ToConsoleColor (trueColorBackground);
-			TrueColorForeground = trueColorForeground;
-			TrueColorBackground = trueColorBackground;
-			var make = Make (Foreground, Background);
-			Value = make.Value;
-			Initialized = make.Initialized;
-		}
-
-		/// <summary>
-		/// <para>
-		/// Initializes a new instance of the <see cref="Attribute"/> class.  Populates
-		/// <see cref="TrueColorBackground"/> and <see cref="TrueColorForeground"/> with explicit
-		/// fallback values for <see cref="Foreground"/> and <see cref="Background"/> (in case
-		/// driver does not support true color rendering). 
-		/// </para>
-		/// <remarks>If you do not want to manually specify the fallback colors use <see cref="Attribute(TrueColor?,TrueColor?)"/>
-		/// instead which auto calculates these.</remarks>
-		/// </summary>
-		/// <param name="trueColorForeground">True color RGB values you would like to use.</param>
-		/// <param name="trueColorBackground">True color RGB values you would like to use.</param>
-		/// <param name="foreground">Simple console color replacement if driver does not support true color.</param>
-		/// <param name="background">Simple console color replacement if driver does not support true color.</param>
-		public Attribute (TrueColor trueColorForeground, TrueColor trueColorBackground, Color foreground, Color background)
-		{
-			Foreground = foreground;
-			Background = background;
-			TrueColorForeground = trueColorForeground;
-			TrueColorBackground = trueColorBackground;
-			var make = Make (Foreground, Background);
-			Value = make.Value;
-			Initialized = make.Initialized;
-		}
-
 		/// <summary>
 		/// <summary>
 		/// Initializes a new instance of the <see cref="Attribute"/> struct
 		/// Initializes a new instance of the <see cref="Attribute"/> struct
 		///  with the same colors for the foreground and background.
 		///  with the same colors for the foreground and background.
@@ -1019,19 +963,13 @@ namespace Terminal.Gui {
 		/// <inheritdoc />
 		/// <inheritdoc />
 		public bool Equals (Attribute other)
 		public bool Equals (Attribute other)
 		{
 		{
-			if (TrueColorForeground.HasValue || TrueColorBackground.HasValue) {
-				return
-					TrueColorForeground == other.TrueColorForeground &&
-					TrueColorBackground == other.TrueColorBackground;
-			}
-
 			return Value == other.Value &&
 			return Value == other.Value &&
 				Foreground == other.Foreground &&
 				Foreground == other.Foreground &&
 				Background == other.Background;
 				Background == other.Background;
 		}
 		}
 
 
 		/// <inheritdoc />
 		/// <inheritdoc />
-		public override int GetHashCode () => HashCode.Combine (Value, Foreground, Background, TrueColorForeground, TrueColorBackground);
+		public override int GetHashCode () => HashCode.Combine (Value, Foreground, Background);
 
 
 		/// <summary>
 		/// <summary>
 		/// Creates an <see cref="Attribute"/> from the specified foreground and background colors.
 		/// Creates an <see cref="Attribute"/> from the specified foreground and background colors.
@@ -1053,7 +991,7 @@ namespace Terminal.Gui {
 					Background = background
 					Background = background
 				};
 				};
 			}
 			}
-			return new Attribute (foreground, background);
+			return Application.Driver.MakeAttribute (foreground, background);
 		}
 		}
 
 
 
 
@@ -1077,7 +1015,7 @@ namespace Terminal.Gui {
 					Background = new Color (background)
 					Background = new Color (background)
 				};
 				};
 			}
 			}
-			return new Attribute (foreground, background);
+			return Application.Driver.MakeAttribute (foreground, background);
 		}
 		}
 
 
 		/// <summary>
 		/// <summary>
@@ -1100,7 +1038,7 @@ namespace Terminal.Gui {
 					Background = background
 					Background = background
 				};
 				};
 			}
 			}
-			return new Attribute (new Color (foreground), background);
+			return Application.Driver.MakeAttribute (new Color (foreground), background);
 		}
 		}
 
 
 		/// <summary>
 		/// <summary>
@@ -1123,7 +1061,7 @@ namespace Terminal.Gui {
 					Background = new Color (background)
 					Background = new Color (background)
 				};
 				};
 			}
 			}
-			return new Attribute (foreground, new Color (background));
+			return Application.Driver.MakeAttribute (foreground, new Color (background));
 		}
 		}
 
 
 		/// <summary>
 		/// <summary>

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

@@ -32,6 +32,7 @@ namespace Terminal.Gui {
 	public class ColorPicker : View {
 	public class ColorPicker : View {
 		private int _selectColorIndex = (int)Color.Black;
 		private int _selectColorIndex = (int)Color.Black;
 
 
+
 		/// <summary>
 		/// <summary>
 		/// Columns of color boxes
 		/// Columns of color boxes
 		/// </summary>
 		/// </summary>
@@ -50,7 +51,7 @@ namespace Terminal.Gui {
 			set {
 			set {
 				if (_boxWidth != value) {
 				if (_boxWidth != value) {
 					_boxWidth = value;
 					_boxWidth = value;
-					SetNeedsLayout ();
+					Bounds = new Rect (Bounds.Location, new Size (_cols * BoxWidth, _rows * BoxHeight));
 				}
 				}
 			}
 			}
 		}
 		}
@@ -64,7 +65,7 @@ namespace Terminal.Gui {
 			set {
 			set {
 				if (_boxHeight != value) {
 				if (_boxHeight != value) {
 					_boxHeight = value;
 					_boxHeight = value;
-					SetNeedsLayout ();
+					Bounds = new Rect (Bounds.Location, new Size (_cols * BoxWidth, _rows * BoxHeight));
 				}
 				}
 			}
 			}
 		}
 		}
@@ -101,8 +102,8 @@ namespace Terminal.Gui {
 				ColorNames prev = (ColorNames)_selectColorIndex;
 				ColorNames prev = (ColorNames)_selectColorIndex;
 				_selectColorIndex = (int)value;
 				_selectColorIndex = (int)value;
 				ColorChanged?.Invoke (this, new ColorEventArgs () {
 				ColorChanged?.Invoke (this, new ColorEventArgs () {
-					PreviousColor = new Color(prev),
-					Color = new Color(value),
+					PreviousColor = new Color (prev),
+					Color = new Color (value),
 				});
 				});
 				SetNeedsDisplay ();
 				SetNeedsDisplay ();
 			}
 			}
@@ -116,6 +117,8 @@ namespace Terminal.Gui {
 			SetInitialProperties ();
 			SetInitialProperties ();
 		}
 		}
 
 
+		bool laidOut = false;
+
 		private void SetInitialProperties ()
 		private void SetInitialProperties ()
 		{
 		{
 			CanFocus = true;
 			CanFocus = true;
@@ -159,7 +162,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 (Driver.MakeAttribute ((Color)foregroundColorIndex, (Color)colorIndex));
+					Driver.SetAttribute (new Attribute ((ColorNames)foregroundColorIndex, (ColorNames)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++;

+ 2 - 3
Terminal.Gui/Views/FileDialog.cs

@@ -1197,9 +1197,8 @@ namespace Terminal.Gui {
 			}
 			}
 
 
 
 
-			var color = Style.ColorProvider.GetTrueColor (stats.FileSystemInfo)
-			?? TrueColor.FromColorName (Color.White);
-			var black = TrueColor.FromColorName (Color.Black);
+			var color = Style.ColorProvider.GetTrueColor (stats.FileSystemInfo) ?? Color.FromColorName (Color.White);
+			var black = Color.FromColorName (Color.Black);
 
 
 			// TODO: Add some kind of cache for this
 			// TODO: Add some kind of cache for this
 			return new ColorScheme {
 			return new ColorScheme {

+ 6 - 6
Terminal.Gui/Views/FileSystemColorProvider.cs

@@ -14,7 +14,7 @@ namespace Terminal.Gui {
 		/// </summary>
 		/// </summary>
 		/// <param name="file"></param>
 		/// <param name="file"></param>
 		/// <returns></returns>
 		/// <returns></returns>
-		public TrueColor? GetTrueColor (IFileSystemInfo file)
+		public Color? GetTrueColor (IFileSystemInfo file)
 		{
 		{
 			if (FilenameToColor.ContainsKey (file.Name)) {
 			if (FilenameToColor.ContainsKey (file.Name)) {
 				return FilenameToColor [file.Name];
 				return FilenameToColor [file.Name];
@@ -30,7 +30,7 @@ namespace Terminal.Gui {
 		/// <summary>
 		/// <summary>
 		/// Mapping of file/dir name to color.
 		/// Mapping of file/dir name to color.
 		/// </summary>
 		/// </summary>
-		public Dictionary<string, TrueColor> FilenameToColor { get; set; } = new ()
+		public Dictionary<string, Color> FilenameToColor { get; set; } = new ()
 		{
 		{
 	    {"docs",StringToColor("#00BFFF")},
 	    {"docs",StringToColor("#00BFFF")},
 	    {"documents",StringToColor("#00BFFF")},
 	    {"documents",StringToColor("#00BFFF")},
@@ -157,7 +157,7 @@ namespace Terminal.Gui {
 		/// <summary>
 		/// <summary>
 		/// Mapping of file extension to color.
 		/// Mapping of file extension to color.
 		/// </summary>
 		/// </summary>
-		public Dictionary<string, TrueColor> ExtensionToColor = new ()
+		public Dictionary<string, Color> ExtensionToColor = new ()
 	{
 	{
 			{".7z",StringToColor("#DAA520")},
 			{".7z",StringToColor("#DAA520")},
 	    {".bz",StringToColor("#DAA520")},
 	    {".bz",StringToColor("#DAA520")},
@@ -441,10 +441,10 @@ namespace Terminal.Gui {
 	};
 	};
 
 
 
 
-		private static TrueColor StringToColor (string str)
+		private static Color StringToColor (string str)
 		{
 		{
-			TrueColor.TryParse (str, out var c);
-			return c ?? throw new System.Exception ("Failed to parse TrueColor from " + str);
+			Color.TryParse (str, out var c);
+			return c ?? throw new System.Exception ("Failed to parse Color from " + str);
 		}
 		}
 	}
 	}
 }
 }

+ 1 - 1
Terminal.Gui/Views/TableView/TableView.cs

@@ -687,7 +687,7 @@ namespace Terminal.Gui {
 
 
 				if (render.Length > 0) {
 				if (render.Length > 0) {
 					// invert the color of the current cell for the first character
 					// invert the color of the current cell for the first character
-					Driver.SetAttribute (Driver.MakeAttribute (cellColor.Background, cellColor.Foreground));
+					Driver.SetAttribute (new Attribute (cellColor.Background, cellColor.Foreground));
 					Driver.AddRune ((Rune)render [0]);
 					Driver.AddRune ((Rune)render [0]);
 
 
 					if (render.Length > 1) {
 					if (render.Length > 1) {

+ 2 - 2
Terminal.Gui/Views/TextView.cs

@@ -2516,9 +2516,9 @@ namespace Terminal.Gui {
 		{
 		{
 			// BUGBUG: (v2 truecolor) This code depends on 8-bit color names; disabling for now
 			// BUGBUG: (v2 truecolor) This code depends on 8-bit color names; disabling for now
 			//if ((colorScheme!.HotNormal.Foreground & colorScheme.Focus.Background) == colorScheme.Focus.Foreground) {
 			//if ((colorScheme!.HotNormal.Foreground & colorScheme.Focus.Background) == colorScheme.Focus.Foreground) {
-			//	Driver.SetAttribute (new Attribute (colorScheme.Focus.Background, colorScheme.Focus.Foreground));
+				Driver.SetAttribute (new Attribute (colorScheme.Focus.Background, colorScheme.Focus.Foreground));
 			//} else {
 			//} else {
-			//	Driver.SetAttribute (new Attribute (colorScheme!.HotNormal.Foreground & colorScheme.Focus.Background, colorScheme.Focus.Foreground));
+				//Driver.SetAttribute (new Attribute (colorScheme!.HotNormal.Foreground & colorScheme.Focus.Background, colorScheme.Focus.Foreground));
 			//}
 			//}
 		}
 		}
 
 

+ 1 - 1
UICatalog/Scenarios/BasicColors.cs

@@ -33,7 +33,7 @@ namespace UICatalog.Scenarios {
 				};
 				};
 				Win.Add (hl);
 				Win.Add (hl);
 				vx++;
 				vx++;
-				foreach (Color fg in colors) {
+				foreach (ColorNames 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 ()) {

+ 4 - 7
UICatalog/Scenarios/ColorPicker.cs

@@ -61,6 +61,7 @@ namespace UICatalog.Scenarios {
 			backgroundColorPicker = new ColorPicker () { 
 			backgroundColorPicker = new ColorPicker () { 
 				Title = "Background Color",
 				Title = "Background Color",
 				Y = 0,
 				Y = 0,
+				X = 0,
 				BoxHeight = 1,
 				BoxHeight = 1,
 				BoxWidth = 4,
 				BoxWidth = 4,
 				BorderStyle = LineStyle.Single
 				BorderStyle = LineStyle.Single
@@ -68,7 +69,6 @@ namespace UICatalog.Scenarios {
 			backgroundColorPicker.X = Pos.AnchorEnd () - (Pos.Right (backgroundColorPicker) - Pos.Left (backgroundColorPicker));
 			backgroundColorPicker.X = Pos.AnchorEnd () - (Pos.Right (backgroundColorPicker) - Pos.Left (backgroundColorPicker));
 			backgroundColorPicker.ColorChanged += BackgroundColor_ColorChanged;
 			backgroundColorPicker.ColorChanged += BackgroundColor_ColorChanged;
 			Win.Add (backgroundColorPicker);
 			Win.Add (backgroundColorPicker);
-
 			_backgroundColorLabel = new Label ();
 			_backgroundColorLabel = new Label ();
 			_backgroundColorLabel.X = Pos.AnchorEnd () - (Pos.Right (_backgroundColorLabel) - Pos.Left (_backgroundColorLabel));
 			_backgroundColorLabel.X = Pos.AnchorEnd () - (Pos.Right (_backgroundColorLabel) - Pos.Left (_backgroundColorLabel));
 			_backgroundColorLabel.Y = Pos.Bottom (backgroundColorPicker) + 1;
 			_backgroundColorLabel.Y = Pos.Bottom (backgroundColorPicker) + 1;
@@ -89,9 +89,8 @@ namespace UICatalog.Scenarios {
 			Win.Add (_demoView);
 			Win.Add (_demoView);
 
 
 			// Set default colors.
 			// Set default colors.
-			// BUGBUG: (v2 truecolor) This code depends on 8-bit color names; disabling for now
-			//backgroundColorPicker.SelectedColor = _demoView.SuperView.ColorScheme.Normal.Background;
-			//foregroundColorPicker.SelectedColor = _demoView.SuperView.ColorScheme.Normal.Foreground;
+			foregroundColorPicker.SelectedColor = _demoView.SuperView.ColorScheme.Normal.Foreground.ColorName;
+			backgroundColorPicker.SelectedColor = _demoView.SuperView.ColorScheme.Normal.Background.ColorName;
 		}
 		}
 
 
 		/// <summary>
 		/// <summary>
@@ -125,9 +124,7 @@ namespace UICatalog.Scenarios {
 		/// Update Demo Label.
 		/// Update Demo Label.
 		/// </summary>
 		/// </summary>
 		private void UpdateDemoLabel () => _demoView.ColorScheme = new ColorScheme () {
 		private void UpdateDemoLabel () => _demoView.ColorScheme = new ColorScheme () {
-			// BUGBUG: (v2 truecolor) This code depends on 8-bit color names; disabling for now
-
-			//Normal = new Terminal.Gui.Attribute (foregroundColorPicker.SelectedColor, backgroundColorPicker.SelectedColor)
+			Normal = new Attribute (foregroundColorPicker.SelectedColor, backgroundColorPicker.SelectedColor)
 		};
 		};
 	}
 	}
 }
 }

+ 8 - 11
UICatalog/Scenarios/Frames.cs

@@ -116,10 +116,9 @@ namespace UICatalog.Scenarios {
 					BorderStyle = LineStyle.Single,
 					BorderStyle = LineStyle.Single,
 					SuperViewRendersLineCanvas = true
 					SuperViewRendersLineCanvas = true
 				};
 				};
-				// BUGBUG: (v2 truecolor) This code depends on 8-bit color names; disabling for now
-				//_foregroundColorPicker.ColorChanged += (o, a) =>
-				//	AttributeChanged?.Invoke (this,
-				//		new Terminal.Gui.Attribute (_foregroundColorPicker.SelectedColor, _backgroundColorPicker.SelectedColor));
+				_foregroundColorPicker.ColorChanged += (o, a) =>
+					AttributeChanged?.Invoke (this,
+						new Attribute (_foregroundColorPicker.SelectedColor, _backgroundColorPicker.SelectedColor));
 				Add (_foregroundColorPicker);
 				Add (_foregroundColorPicker);
 
 
 				// Background ColorPicker.
 				// Background ColorPicker.
@@ -133,12 +132,11 @@ namespace UICatalog.Scenarios {
 					SuperViewRendersLineCanvas = true
 					SuperViewRendersLineCanvas = true
 				};
 				};
 
 
-				// BUGBUG: (v2 truecolor) This code depends on 8-bit color names; disabling for now
-				//_backgroundColorPicker.ColorChanged += (o, a) =>
-				//	AttributeChanged?.Invoke (this,
-				//		new Terminal.Gui.Attribute (
-				//			_foregroundColorPicker.SelectedColor,
-				//			_backgroundColorPicker.SelectedColor));
+				_backgroundColorPicker.ColorChanged += (o, a) =>
+					AttributeChanged?.Invoke (this,
+						new Terminal.Gui.Attribute (
+							_foregroundColorPicker.SelectedColor,
+							_backgroundColorPicker.SelectedColor));
 				Add (_backgroundColorPicker);
 				Add (_backgroundColorPicker);
 
 
 				_topEdit.Text = $"{Thickness.Top}";
 				_topEdit.Text = $"{Thickness.Top}";
@@ -224,7 +222,6 @@ namespace UICatalog.Scenarios {
 				Add (_borderEditor);
 				Add (_borderEditor);
 
 
 				viewToEdit.Padding.ColorScheme = new ColorScheme (Colors.ColorSchemes ["Error"]);
 				viewToEdit.Padding.ColorScheme = new ColorScheme (Colors.ColorSchemes ["Error"]);
-				var colorEnum = Enum.GetValues (typeof (Color)).Cast<Color> ().ToList ();
 
 
 				var borderStyleEnum = Enum.GetValues (typeof (LineStyle)).Cast<LineStyle> ().ToList ();
 				var borderStyleEnum = Enum.GetValues (typeof (LineStyle)).Cast<LineStyle> ().ToList ();
 				var rbBorderStyle = new RadioGroup (borderStyleEnum.Select (
 				var rbBorderStyle = new RadioGroup (borderStyleEnum.Select (

+ 0 - 1
UICatalog/Scenarios/GraphViewExample.cs

@@ -95,7 +95,6 @@ namespace UICatalog.Scenarios {
 
 
 			about.Text = "Housing Expenditures by income thirds 1996-2003";
 			about.Text = "Housing Expenditures by income thirds 1996-2003";
 
 
-			// BUGBUG: (v2 truecolor) This code depends on 8-bit color names; refactor
 			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(ColorNames.Black) ? new Color(ColorNames.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);

+ 2 - 1
UICatalog/Scenarios/Images.cs

@@ -5,6 +5,7 @@ using System;
 using System.Collections.Concurrent;
 using System.Collections.Concurrent;
 using System.IO;
 using System.IO;
 using Terminal.Gui;
 using Terminal.Gui;
+using Color = Terminal.Gui.Color;
 
 
 namespace UICatalog.Scenarios {
 namespace UICatalog.Scenarios {
 	[ScenarioMetadata (Name: "Images", Description: "Demonstration of how to render an image with/without true color support.")]
 	[ScenarioMetadata (Name: "Images", Description: "Demonstration of how to render an image with/without true color support.")]
@@ -121,7 +122,7 @@ namespace UICatalog.Scenarios {
 					for (int x = 0; x < bounds.Width; x++) {
 					for (int x = 0; x < bounds.Width; x++) {
 						var rgb = matchSize [x, y];
 						var rgb = matchSize [x, y];
 
 
-						var attr = cache.GetOrAdd (rgb, (rgb) => new Attribute (new TrueColor (), new TrueColor (rgb.R, rgb.G, rgb.B)));
+						var attr = cache.GetOrAdd (rgb, (rgb) => new Attribute (new Color (), new Color (rgb.R, rgb.G, rgb.B)));
 
 
 						Driver.SetAttribute (attr);
 						Driver.SetAttribute (attr);
 						AddRune (x, y, (System.Text.Rune)' ');
 						AddRune (x, y, (System.Text.Rune)' ');

+ 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 (Color)).Cast<Color> ().ToArray ();
+			var foreColors = Enum.GetValues (typeof (ColorNames)).Cast<ColorNames> ().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];

+ 12 - 12
UICatalog/Scenarios/TrueColors.cs

@@ -41,13 +41,13 @@ namespace UICatalog.Scenarios {
 			Win.Add (cbUseTrueColor);
 			Win.Add (cbUseTrueColor);
 
 
 			y += 2;
 			y += 2;
-			SetupGradient ("Red gradient", x, ref y, (i) => new TrueColor (i, 0, 0));
-			SetupGradient ("Green gradient", x, ref y, (i) => new TrueColor (0, i, 0));
-			SetupGradient ("Blue gradient", x, ref y, (i) => new TrueColor (0, 0, i));
-			SetupGradient ("Yellow gradient", x, ref y, (i) => new TrueColor (i, i, 0));
-			SetupGradient ("Magenta gradient", x, ref y, (i) => new TrueColor (i, 0, i));
-			SetupGradient ("Cyan gradient", x, ref y, (i) => new TrueColor (0, i, i));
-			SetupGradient ("Gray gradient", x, ref y, (i) => new TrueColor (i, i, i));
+			SetupGradient ("Red gradient", x, ref y, (i) => new Color (i, 0, 0));
+			SetupGradient ("Green gradient", x, ref y, (i) => new Color (0, i, 0));
+			SetupGradient ("Blue gradient", x, ref y, (i) => new Color (0, 0, i));
+			SetupGradient ("Yellow gradient", x, ref y, (i) => new Color (i, i, 0));
+			SetupGradient ("Magenta gradient", x, ref y, (i) => new Color (i, 0, i));
+			SetupGradient ("Cyan gradient", x, ref y, (i) => new Color (0, i, i));
+			SetupGradient ("Gray gradient", x, ref y, (i) => new Color (i, i, i));
 
 
 			Win.Add (new Label ("Mouse over to get the gradient view color:") {
 			Win.Add (new Label ("Mouse over to get the gradient view color:") {
 				X = Pos.AnchorEnd (44),
 				X = Pos.AnchorEnd (44),
@@ -81,18 +81,18 @@ namespace UICatalog.Scenarios {
 				Y = 6
 				Y = 6
 			};
 			};
 			Win.Add (lblBlue);
 			Win.Add (lblBlue);
-
+			
 			Application.RootMouseEvent = (e) => {
 			Application.RootMouseEvent = (e) => {
 				if (e.View != null) {
 				if (e.View != null) {
 					var normal = e.View.GetNormalColor ();
 					var normal = e.View.GetNormalColor ();
-					lblRed.Text = normal.TrueColorForeground.Value.Red.ToString ();
-					lblGreen.Text = normal.TrueColorForeground.Value.Green.ToString ();
-					lblBlue.Text = normal.TrueColorForeground.Value.Blue.ToString ();
+					lblRed.Text = normal.Foreground.R.ToString ();
+					lblGreen.Text = normal.Foreground.G.ToString ();
+					lblBlue.Text = normal.Foreground.B.ToString ();
 				}
 				}
 			};
 			};
 		}
 		}
 
 
-		private void SetupGradient (string name, int x, ref int y, Func<int, TrueColor> colorFunc)
+		private void SetupGradient (string name, int x, ref int y, Func<int, Color> colorFunc)
 		{
 		{
 			var gradient = new Label (name) {
 			var gradient = new Label (name) {
 				X = x,
 				X = x,

+ 8 - 8
UnitTests/Configuration/JsonConverterTests.cs

@@ -131,8 +131,8 @@ namespace Terminal.Gui.ConfigurationTests {
 			// Arrange
 			// Arrange
 
 
 			// Act
 			// Act
-			var actual = JsonSerializer.Serialize (new TrueColor (r, g, b), new JsonSerializerOptions {
-				Converters = { new TrueColorJsonConverter () }
+			var actual = JsonSerializer.Serialize (new Color (r, g, b), new JsonSerializerOptions {
+				Converters = { new ColorJsonConverter () }
 			});
 			});
 
 
 			//Assert
 			//Assert
@@ -145,11 +145,11 @@ namespace Terminal.Gui.ConfigurationTests {
 		public void DeserializesFromHexCode (string hexCode, int r, int g, int b)
 		public void DeserializesFromHexCode (string hexCode, int r, int g, int b)
 		{
 		{
 			// Arrange
 			// Arrange
-			TrueColor expected = new TrueColor (r, g, b);
+			Color expected = new Color (r, g, b);
 
 
 			// Act
 			// Act
-			var actual = JsonSerializer.Deserialize<TrueColor> (hexCode, new JsonSerializerOptions {
-				Converters = { new TrueColorJsonConverter () }
+			var actual = JsonSerializer.Deserialize<Color> (hexCode, new JsonSerializerOptions {
+				Converters = { new ColorJsonConverter () }
 			});
 			});
 
 
 			//Assert
 			//Assert
@@ -161,11 +161,11 @@ namespace Terminal.Gui.ConfigurationTests {
 		public void DeserializesFromRgb (string rgb, int r, int g, int b)
 		public void DeserializesFromRgb (string rgb, int r, int g, int b)
 		{
 		{
 			// Arrange
 			// Arrange
-			TrueColor expected = new TrueColor (r, g, b);
+			Color expected = new Color (r, g, b);
 
 
 			// Act
 			// Act
-			var actual = JsonSerializer.Deserialize<TrueColor> (rgb, new JsonSerializerOptions {
-				Converters = { new TrueColorJsonConverter () }
+			var actual = JsonSerializer.Deserialize<Color> (rgb, new JsonSerializerOptions {
+				Converters = { new ColorJsonConverter () }
 			});
 			});
 
 
 			//Assert
 			//Assert

+ 3 - 3
UnitTests/ConsoleDrivers/AttributeTests.cs

@@ -172,10 +172,10 @@ namespace Terminal.Gui.DriverTests {
 		{
 		{
 			var driver = Application.Driver;
 			var driver = Application.Driver;
 			var attrValue = new Attribute (Color.Red, Color.Green).Value;
 			var attrValue = new Attribute (Color.Red, Color.Green).Value;
-			driver.GetColors (attrValue, out Color fg, out Color bg);
+			driver.GetColors (attrValue, out ColorNames fg, out ColorNames bg);
 
 
-			Assert.Equal ((Color)Color.Red, fg);
-			Assert.Equal ((Color)Color.Green, bg);
+			Assert.Equal ((Color)Color.Red, (Color)fg);
+			Assert.Equal ((Color)Color.Green, (Color)bg);
 		}
 		}
 
 
 		[Fact]
 		[Fact]