浏览代码

Addressed review feedback.
Renamed ColorName to ColorName16 to make it clear it's purpose.
Added related TODOs.

Tig 10 月之前
父节点
当前提交
05ae84382d
共有 35 个文件被更改,包括 292 次插入409 次删除
  1. 1 1
      Terminal.Gui/Application/Application.Driver.cs
  2. 0 2
      Terminal.Gui/Application/Application.Mouse.cs
  3. 1 1
      Terminal.Gui/Configuration/ColorJsonConverter.cs
  4. 1 1
      Terminal.Gui/Configuration/SourceGenerationContext.cs
  5. 39 39
      Terminal.Gui/ConsoleDrivers/CursesDriver/CursesDriver.cs
  6. 2 2
      Terminal.Gui/ConsoleDrivers/FakeDriver/FakeDriver.cs
  7. 2 2
      Terminal.Gui/ConsoleDrivers/NetDriver.cs
  8. 1 1
      Terminal.Gui/ConsoleDrivers/WindowsDriver.cs
  9. 6 6
      Terminal.Gui/Drawing/Attribute.cs
  10. 32 29
      Terminal.Gui/Drawing/Color.ColorExtensions.cs
  11. 2 2
      Terminal.Gui/Drawing/Color.ColorName.cs
  12. 5 9
      Terminal.Gui/Drawing/Color.Formatting.cs
  13. 3 3
      Terminal.Gui/Drawing/Color.Operators.cs
  14. 40 38
      Terminal.Gui/Drawing/Color.cs
  15. 5 5
      Terminal.Gui/Views/ColorPicker16.cs
  16. 2 2
      UICatalog/Scenarios/AdornmentEditor.cs
  17. 0 116
      UICatalog/Scenarios/BasicColors.cs
  18. 2 2
      UICatalog/Scenarios/ColorPicker.cs
  19. 2 2
      UICatalog/Scenarios/GraphViewExample.cs
  20. 3 3
      UICatalog/Scenarios/InvertColors.cs
  21. 1 1
      UICatalog/Scenarios/Sliders.cs
  22. 6 6
      UICatalog/Scenarios/TextEffectsScenario.cs
  23. 23 23
      UnitTests/Configuration/JsonConverterTests.cs
  24. 7 7
      UnitTests/Drawing/AttributeTests.cs
  25. 19 19
      UnitTests/Drawing/ColorTests.Constructors.cs
  26. 19 19
      UnitTests/Drawing/ColorTests.Operators.cs
  27. 1 1
      UnitTests/Drawing/ColorTests.ParsingAndFormatting.cs
  28. 20 20
      UnitTests/Drawing/ColorTests.TypeChecks.cs
  29. 16 16
      UnitTests/Drawing/ColorTests.cs
  30. 10 10
      UnitTests/Text/TextFormatterTests.cs
  31. 4 4
      UnitTests/View/Adornment/BorderTests.cs
  32. 2 2
      UnitTests/View/Adornment/MarginTests.cs
  33. 1 1
      UnitTests/View/Adornment/PaddingTests.cs
  34. 1 1
      UnitTests/View/Mouse/MouseTests.cs
  35. 13 13
      UnitTests/Views/ColorPicker16Tests.cs

+ 1 - 1
Terminal.Gui/Application/Application.Driver.cs

@@ -10,7 +10,7 @@ public static partial class Application // Driver abstractions
 
     /// <summary>
     ///     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
+    ///     <see cref="ColorName16"/>. The default is <see langword="false"/>, meaning 24-bit (TrueColor) colors will be output
     ///     as long as the selected <see cref="ConsoleDriver"/> supports TrueColor.
     /// </summary>
     [SerializableConfigurationProperty (Scope = typeof (SettingsScope))]

+ 0 - 2
Terminal.Gui/Application/Application.Mouse.cs

@@ -1,8 +1,6 @@
 #nullable enable
 using System.ComponentModel;
 using System.Diagnostics;
-using Microsoft.CodeAnalysis;
-using Microsoft.CodeAnalysis.VisualBasic.Syntax;
 
 namespace Terminal.Gui;
 

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

@@ -37,7 +37,7 @@ internal class ColorJsonConverter : JsonConverter<Color>
                 return new (color1);
             }
 
-            if (Enum.TryParse (colorString, true, out ColorName color))
+            if (Enum.TryParse (colorString, true, out ColorName16 color))
             {
                 // Return the parsed color
                 return new (in color);

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

@@ -17,7 +17,7 @@ namespace Terminal.Gui;
 [JsonSerializable (typeof (ShadowStyle))]
 [JsonSerializable (typeof (HighlightStyle))]
 [JsonSerializable (typeof (bool?))]
-[JsonSerializable (typeof (Dictionary<ColorName, string>))]
+[JsonSerializable (typeof (Dictionary<ColorName16, string>))]
 [JsonSerializable (typeof (Dictionary<string, ThemeScope>))]
 [JsonSerializable (typeof (Dictionary<string, ColorScheme>))]
 internal partial class SourceGenerationContext : JsonSerializerContext

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

@@ -374,7 +374,7 @@ internal class CursesDriver : ConsoleDriver
                                                            );
         }
 
-        CurrentAttribute = new Attribute (ColorName.White, ColorName.Black);
+        CurrentAttribute = new Attribute (ColorName16.White, ColorName16.Black);
 
         if (Environment.OSVersion.Platform == PlatformID.Win32NT)
         {
@@ -859,8 +859,8 @@ internal class CursesDriver : ConsoleDriver
 
         return new Attribute (
                               Curses.ColorPair (v),
-                              CursesColorNumberToColorName (foreground),
-                              CursesColorNumberToColorName (background)
+                              CursesColorNumberToColorName16 (foreground),
+                              CursesColorNumberToColorName16 (background)
                              );
     }
 
@@ -875,8 +875,8 @@ internal class CursesDriver : ConsoleDriver
         if (!RunningUnitTests)
         {
             return MakeColor (
-                              ColorNameToCursesColorNumber (foreground.GetClosestNamedColor ()),
-                              ColorNameToCursesColorNumber (background.GetClosestNamedColor ())
+                              ColorNameToCursesColorNumber (foreground.GetClosestNamedColor16 ()),
+                              ColorNameToCursesColorNumber (background.GetClosestNamedColor16 ())
                              );
         }
 
@@ -887,83 +887,83 @@ internal class CursesDriver : ConsoleDriver
                              );
     }
 
-    private static short ColorNameToCursesColorNumber (ColorName color)
+    private static short ColorNameToCursesColorNumber (ColorName16 color)
     {
         switch (color)
         {
-            case ColorName.Black:
+            case ColorName16.Black:
                 return Curses.COLOR_BLACK;
-            case ColorName.Blue:
+            case ColorName16.Blue:
                 return Curses.COLOR_BLUE;
-            case ColorName.Green:
+            case ColorName16.Green:
                 return Curses.COLOR_GREEN;
-            case ColorName.Cyan:
+            case ColorName16.Cyan:
                 return Curses.COLOR_CYAN;
-            case ColorName.Red:
+            case ColorName16.Red:
                 return Curses.COLOR_RED;
-            case ColorName.Magenta:
+            case ColorName16.Magenta:
                 return Curses.COLOR_MAGENTA;
-            case ColorName.Yellow:
+            case ColorName16.Yellow:
                 return Curses.COLOR_YELLOW;
-            case ColorName.Gray:
+            case ColorName16.Gray:
                 return Curses.COLOR_WHITE;
-            case ColorName.DarkGray:
+            case ColorName16.DarkGray:
                 return Curses.COLOR_GRAY;
-            case ColorName.BrightBlue:
+            case ColorName16.BrightBlue:
                 return Curses.COLOR_BLUE | Curses.COLOR_GRAY;
-            case ColorName.BrightGreen:
+            case ColorName16.BrightGreen:
                 return Curses.COLOR_GREEN | Curses.COLOR_GRAY;
-            case ColorName.BrightCyan:
+            case ColorName16.BrightCyan:
                 return Curses.COLOR_CYAN | Curses.COLOR_GRAY;
-            case ColorName.BrightRed:
+            case ColorName16.BrightRed:
                 return Curses.COLOR_RED | Curses.COLOR_GRAY;
-            case ColorName.BrightMagenta:
+            case ColorName16.BrightMagenta:
                 return Curses.COLOR_MAGENTA | Curses.COLOR_GRAY;
-            case ColorName.BrightYellow:
+            case ColorName16.BrightYellow:
                 return Curses.COLOR_YELLOW | Curses.COLOR_GRAY;
-            case ColorName.White:
+            case ColorName16.White:
                 return Curses.COLOR_WHITE | Curses.COLOR_GRAY;
         }
 
         throw new ArgumentException ("Invalid color code");
     }
 
-    private static ColorName CursesColorNumberToColorName (short color)
+    private static ColorName16 CursesColorNumberToColorName16 (short color)
     {
         switch (color)
         {
             case Curses.COLOR_BLACK:
-                return ColorName.Black;
+                return ColorName16.Black;
             case Curses.COLOR_BLUE:
-                return ColorName.Blue;
+                return ColorName16.Blue;
             case Curses.COLOR_GREEN:
-                return ColorName.Green;
+                return ColorName16.Green;
             case Curses.COLOR_CYAN:
-                return ColorName.Cyan;
+                return ColorName16.Cyan;
             case Curses.COLOR_RED:
-                return ColorName.Red;
+                return ColorName16.Red;
             case Curses.COLOR_MAGENTA:
-                return ColorName.Magenta;
+                return ColorName16.Magenta;
             case Curses.COLOR_YELLOW:
-                return ColorName.Yellow;
+                return ColorName16.Yellow;
             case Curses.COLOR_WHITE:
-                return ColorName.Gray;
+                return ColorName16.Gray;
             case Curses.COLOR_GRAY:
-                return ColorName.DarkGray;
+                return ColorName16.DarkGray;
             case Curses.COLOR_BLUE | Curses.COLOR_GRAY:
-                return ColorName.BrightBlue;
+                return ColorName16.BrightBlue;
             case Curses.COLOR_GREEN | Curses.COLOR_GRAY:
-                return ColorName.BrightGreen;
+                return ColorName16.BrightGreen;
             case Curses.COLOR_CYAN | Curses.COLOR_GRAY:
-                return ColorName.BrightCyan;
+                return ColorName16.BrightCyan;
             case Curses.COLOR_RED | Curses.COLOR_GRAY:
-                return ColorName.BrightRed;
+                return ColorName16.BrightRed;
             case Curses.COLOR_MAGENTA | Curses.COLOR_GRAY:
-                return ColorName.BrightMagenta;
+                return ColorName16.BrightMagenta;
             case Curses.COLOR_YELLOW | Curses.COLOR_GRAY:
-                return ColorName.BrightYellow;
+                return ColorName16.BrightYellow;
             case Curses.COLOR_WHITE | Curses.COLOR_GRAY:
-                return ColorName.White;
+                return ColorName16.White;
         }
 
         throw new ArgumentException ("Invalid curses color code");

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

@@ -165,8 +165,8 @@ public class FakeDriver : ConsoleDriver
                     if (attr != redrawAttr)
                     {
                         redrawAttr = attr;
-                        FakeConsole.ForegroundColor = (ConsoleColor)attr.Foreground.GetClosestNamedColor ();
-                        FakeConsole.BackgroundColor = (ConsoleColor)attr.Background.GetClosestNamedColor ();
+                        FakeConsole.ForegroundColor = (ConsoleColor)attr.Foreground.GetClosestNamedColor16 ();
+                        FakeConsole.BackgroundColor = (ConsoleColor)attr.Background.GetClosestNamedColor16 ();
                     }
 
                     outputWidth++;

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

@@ -961,10 +961,10 @@ internal class NetDriver : ConsoleDriver
                             output.Append (
                                            EscSeqUtils.CSI_SetGraphicsRendition (
                                                                                  MapColors (
-                                                                                            (ConsoleColor)attr.Background.GetClosestNamedColor (),
+                                                                                            (ConsoleColor)attr.Background.GetClosestNamedColor16 (),
                                                                                             false
                                                                                            ),
-                                                                                 MapColors ((ConsoleColor)attr.Foreground.GetClosestNamedColor ())
+                                                                                 MapColors ((ConsoleColor)attr.Foreground.GetClosestNamedColor16 ())
                                                                                 )
                                           );
                         }

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

@@ -72,7 +72,7 @@ internal class WindowsConsole
                 {
                     Char = new CharUnion { UnicodeChar = info.Char },
                     Attributes =
-                        (ushort)((int)info.Attribute.Foreground.GetClosestNamedColor () | ((int)info.Attribute.Background.GetClosestNamedColor () << 4))
+                        (ushort)((int)info.Attribute.Foreground.GetClosestNamedColor16 () | ((int)info.Attribute.Background.GetClosestNamedColor16 () << 4))
                 };
             }
 

+ 6 - 6
Terminal.Gui/Drawing/Attribute.cs

@@ -15,7 +15,7 @@ public readonly record struct Attribute : IEqualityOperators<Attribute, Attribut
 {
     /// <summary>Default empty attribute.</summary>
     [JsonIgnore]
-    public static Attribute Default => new (Color.White, ColorName.Black);
+    public static Attribute Default => new (Color.White, Color.Black);
 
     /// <summary>The <see cref="ConsoleDriver"/>-specific color value.</summary>
     [JsonIgnore (Condition = JsonIgnoreCondition.Always)]
@@ -65,28 +65,28 @@ public readonly record struct Attribute : IEqualityOperators<Attribute, Attribut
     }
 
     /// <summary>
-    ///     Initializes a new instance with a <see cref="ColorName"/> value. Both <see cref="Foreground"/> and
+    ///     Initializes a new instance with a <see cref="ColorName16"/> value. Both <see cref="Foreground"/> and
     ///     <see cref="Background"/> will be set to the specified color.
     /// </summary>
     /// <param name="colorName">Value.</param>
-    internal Attribute (in ColorName colorName) : this (in colorName, in colorName) { }
+    internal Attribute (in ColorName16 colorName) : this (in colorName, in 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 (in ColorName foregroundName, in ColorName backgroundName)
+    public Attribute (in ColorName16 foregroundName, in ColorName16 backgroundName)
         : this (new Color (in foregroundName), new Color (in 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 (in ColorName foregroundName, in Color background) : this (new Color (in foregroundName), in background) { }
+    public Attribute (in ColorName16 foregroundName, in Color background) : this (new Color (in foregroundName), in 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 (in Color foreground, in ColorName backgroundName) : this (in foreground, new Color (in backgroundName)) { }
+    public Attribute (in Color foreground, in ColorName16 backgroundName) : this (in foreground, new Color (in backgroundName)) { }
 
     /// <summary>
     ///     Initializes a new instance of the <see cref="Attribute"/> struct with the same colors for the foreground and

+ 32 - 29
Terminal.Gui/Drawing/Color.ColorExtensions.cs

@@ -4,59 +4,62 @@ namespace Terminal.Gui;
 
 internal static class ColorExtensions
 {
-    private static FrozenDictionary<Color, ColorName> colorToNameMap;
+    // TODO: This should be refactored to support all W3CColors (`ColorStrings` and this should be merged).
+    // TODO: ColorName and AnsiColorCode are only needed when a driver is in Force16Color mode and we
+    // TODO: should be able to remove these from any non-Driver-specific usages.
+    private static FrozenDictionary<Color, ColorName16> colorToNameMap;
 
     static ColorExtensions ()
     {
-        Dictionary<ColorName, AnsiColorCode> nameToCodeMap = new ()
+        Dictionary<ColorName16, AnsiColorCode> nameToCodeMap = new ()
         {
-            { ColorName.Black, AnsiColorCode.BLACK },
-            { ColorName.Blue, AnsiColorCode.BLUE },
-            { ColorName.Green, AnsiColorCode.GREEN },
-            { ColorName.Cyan, AnsiColorCode.CYAN },
-            { ColorName.Red, AnsiColorCode.RED },
-            { ColorName.Magenta, AnsiColorCode.MAGENTA },
-            { ColorName.Yellow, AnsiColorCode.YELLOW },
-            { ColorName.Gray, AnsiColorCode.WHITE },
-            { ColorName.DarkGray, AnsiColorCode.BRIGHT_BLACK },
-            { ColorName.BrightBlue, AnsiColorCode.BRIGHT_BLUE },
-            { ColorName.BrightGreen, AnsiColorCode.BRIGHT_GREEN },
-            { ColorName.BrightCyan, AnsiColorCode.BRIGHT_CYAN },
-            { ColorName.BrightRed, AnsiColorCode.BRIGHT_RED },
-            { ColorName.BrightMagenta, AnsiColorCode.BRIGHT_MAGENTA },
-            { ColorName.BrightYellow, AnsiColorCode.BRIGHT_YELLOW },
-            { ColorName.White, AnsiColorCode.BRIGHT_WHITE }
+            { ColorName16.Black, AnsiColorCode.BLACK },
+            { ColorName16.Blue, AnsiColorCode.BLUE },
+            { ColorName16.Green, AnsiColorCode.GREEN },
+            { ColorName16.Cyan, AnsiColorCode.CYAN },
+            { ColorName16.Red, AnsiColorCode.RED },
+            { ColorName16.Magenta, AnsiColorCode.MAGENTA },
+            { ColorName16.Yellow, AnsiColorCode.YELLOW },
+            { ColorName16.Gray, AnsiColorCode.WHITE },
+            { ColorName16.DarkGray, AnsiColorCode.BRIGHT_BLACK },
+            { ColorName16.BrightBlue, AnsiColorCode.BRIGHT_BLUE },
+            { ColorName16.BrightGreen, AnsiColorCode.BRIGHT_GREEN },
+            { ColorName16.BrightCyan, AnsiColorCode.BRIGHT_CYAN },
+            { ColorName16.BrightRed, AnsiColorCode.BRIGHT_RED },
+            { ColorName16.BrightMagenta, AnsiColorCode.BRIGHT_MAGENTA },
+            { ColorName16.BrightYellow, AnsiColorCode.BRIGHT_YELLOW },
+            { ColorName16.White, AnsiColorCode.BRIGHT_WHITE }
         };
-        ColorNameToAnsiColorMap = nameToCodeMap.ToFrozenDictionary ();
+        ColorName16ToAnsiColorMap = nameToCodeMap.ToFrozenDictionary ();
 
-        var colorToNameDict = new Dictionary<Color, ColorName> ();
+        var colorToNameDict = new Dictionary<Color, ColorName16> ();
 
-        foreach (ColorName colorName in Enum.GetValues<ColorName> ())
+        foreach (ColorName16 colorName in Enum.GetValues<ColorName16> ())
         {
-            if (ColorStrings.TryParseW3CColorName (Enum.GetName<ColorName> (colorName), out Color color))
+            if (ColorStrings.TryParseW3CColorName (Enum.GetName<ColorName16> (colorName), out Color color))
             {
                 colorToNameDict [color] = colorName;
             }
         }
 
-        ColorToNameMap = colorToNameDict.ToFrozenDictionary ();
+        ColorToName16Map = colorToNameDict.ToFrozenDictionary ();
     }
 
     /// <summary>Defines the 16 legacy color names and their corresponding ANSI color codes.</summary>
-    internal static FrozenDictionary<ColorName, AnsiColorCode> ColorNameToAnsiColorMap { get; }
+    internal static FrozenDictionary<ColorName16, AnsiColorCode> ColorName16ToAnsiColorMap { get; }
 
-    /// <summary>Reverse mapping for <see cref="ColorToNameMap"/>.</summary>
-    internal static FrozenDictionary<ColorName, Color> ColorNameToColorMap { get; private set; }
+    /// <summary>Reverse mapping for <see cref="ColorToName16Map"/>.</summary>
+    internal static FrozenDictionary<ColorName16, Color> ColorName16ToColorMap { get; private set; }
 
     /// <summary>
     ///     Gets or sets a <see cref="FrozenDictionary{TKey,TValue}"/> that maps legacy 16-color values to the
-    ///     corresponding <see cref="ColorName"/>.
+    ///     corresponding <see cref="ColorName16"/>.
     /// </summary>
     /// <remarks>
     ///     Setter should be called as infrequently as possible, as <see cref="FrozenDictionary{TKey,TValue}"/> is
     ///     expensive to create.
     /// </remarks>
-    internal static FrozenDictionary<Color, ColorName> ColorToNameMap
+    internal static FrozenDictionary<Color, ColorName16> ColorToName16Map
     {
         get => colorToNameMap;
         set
@@ -64,7 +67,7 @@ internal static class ColorExtensions
             colorToNameMap = value;
 
             //Also be sure to set the reverse mapping
-            ColorNameToColorMap = value.ToFrozenDictionary (static kvp => kvp.Value, static kvp => kvp.Key);
+            ColorName16ToColorMap = value.ToFrozenDictionary (static kvp => kvp.Value, static kvp => kvp.Key);
         }
     }
 }

+ 2 - 2
Terminal.Gui/Drawing/Color.ColorName.cs

@@ -8,10 +8,10 @@ namespace Terminal.Gui;
 ///     <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.
+///         configured using the <see cref="Color.Colors16"/> property.
 ///     </para>
 /// </remarks>
-public enum ColorName
+public enum ColorName16
 {
     /// <summary>The black color. ANSI escape sequence: <c>\u001b[30m</c>.</summary>
     Black,

+ 5 - 9
Terminal.Gui/Drawing/Color.Formatting.cs

@@ -205,7 +205,7 @@ public readonly partial record struct Color
     /// <summary>Converts the provided <see langword="string"/> to a new <see cref="Color"/> value.</summary>
     /// <param name="text">
     ///     The text to analyze. Formats supported are "#RGB", "#RRGGBB", "#ARGB", "#AARRGGBB", "rgb(r,g,b)",
-    ///     "rgb(r,g,b,a)", "rgba(r,g,b)", "rgba(r,g,b,a)", and any of the <see cref="Gui.ColorName"/> string values.
+    ///     "rgb(r,g,b,a)", "rgba(r,g,b)", "rgba(r,g,b,a)", and any of the <see cref="ColorName16"/> string values.
     /// </param>
     /// <param name="formatProvider">
     ///     If specified and not <see langword="null"/>, will be passed to
@@ -246,7 +246,7 @@ public readonly partial record struct Color
     /// </summary>
     /// <param name="text">
     ///     The text to analyze. Formats supported are "#RGB", "#RRGGBB", "#RGBA", "#AARRGGBB", "rgb(r,g,b)",
-    ///     "rgb(r,g,b,a)", "rgba(r,g,b)", "rgba(r,g,b,a)", and any of the <see cref="Gui.ColorName"/> string values.
+    ///     "rgb(r,g,b,a)", "rgba(r,g,b)", "rgba(r,g,b,a)", and any of the <see cref="ColorName16"/> string values.
     /// </param>
     /// <param name="formatProvider">
     ///     Optional <see cref="IFormatProvider"/> to provide parsing services for the input text.
@@ -351,10 +351,6 @@ public readonly partial record struct Color
             { } when char.IsLetter (text [0]) && ColorStrings.TryParseW3CColorName (text.ToString (), out Color color) =>
                 new Color (color),
 
-            // Attempt to parse as a named color from the ColorName enum
-            { } when char.IsLetter (text [0]) && Enum.TryParse (text, true, out ColorName colorName) =>
-                new Color (colorName),
-
             // Any other input
             _ => throw new ColorParseException (in text, "Text did not match any expected format.", in text, [])
         };
@@ -475,7 +471,7 @@ public readonly partial record struct Color
     /// <summary>Converts the provided <see langword="string"/> to a new <see cref="Color"/> value.</summary>
     /// <param name="text">
     ///     The text to analyze. Formats supported are "#RGB", "#RRGGBB", "#ARGB", "#AARRGGBB", "rgb(r,g,b)",
-    ///     "rgb(r,g,b,a)", "rgba(r,g,b)", "rgba(r,g,b,a)", and any of the <see cref="GetClosestNamedColor (Color)"/> string
+    ///     "rgb(r,g,b,a)", "rgba(r,g,b)", "rgba(r,g,b,a)", and any of the <see cref="GetClosestNamedColor16(Terminal.Gui.Color)"/> string
     ///     values.
     /// </param>
     /// <param name="formatProvider">
@@ -505,7 +501,7 @@ public readonly partial record struct Color
     /// </summary>
     /// <param name="text">
     ///     The text to analyze. Formats supported are "#RGB", "#RRGGBB", "#ARGB", "#AARRGGBB", "rgb(r,g,b)",
-    ///     "rgb(r,g,b,a)", "rgba(r,g,b)", "rgba(r,g,b,a)", and any of the <see cref="GetClosestNamedColor (Color)"/> string
+    ///     "rgb(r,g,b,a)", "rgba(r,g,b)", "rgba(r,g,b,a)", and any of the <see cref="GetClosestNamedColor16(Terminal.Gui.Color)"/> string
     ///     values.
     /// </param>
     /// <param name="formatProvider">
@@ -602,7 +598,7 @@ public readonly partial record struct Color
     /// <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", "#ARGB", "#AARRGGBB", "rgb(r,g,b)",
-    ///     "rgb(r,g,b,a)", "rgba(r,g,b)", "rgba(r,g,b,a)", and any of the <see cref="Gui.ColorName"/> string values.
+    ///     "rgb(r,g,b,a)", "rgba(r,g,b)", "rgba(r,g,b,a)", and any of the <see cref="ColorName16"/> string values.
     /// </param>
     /// <param name="color">The parsed value.</param>
     /// <returns>A boolean value indicating whether parsing was successful.</returns>

+ 3 - 3
Terminal.Gui/Drawing/Color.Operators.cs

@@ -53,11 +53,11 @@ public readonly partial record struct Color
     public static implicit operator Color (uint u) { return new Color (u); }
 
     /// <summary>
-    ///     Implicit conversion from <see cref="GetClosestNamedColor (Color)"/> to <see cref="Color"/> via lookup from
-    ///     <see cref="ColorExtensions.ColorNameToColorMap"/>.
+    ///     Implicit conversion from <see cref="GetClosestNamedColor16(Terminal.Gui.Color)"/> to <see cref="Color"/> via lookup from
+    ///     <see cref="ColorExtensions.ColorName16ToColorMap"/>.
     /// </summary>
     [Pure]
-    public static implicit operator Color (ColorName colorName) { return ColorExtensions.ColorNameToColorMap [colorName]; }
+    public static implicit operator Color (ColorName16 colorName) { return ColorExtensions.ColorName16ToColorMap [colorName]; }
 
     /// <summary>
     ///     Implicit conversion from <see cref="Vector4"/> to <see cref="Color"/>, where (<see cref="Vector4.X"/>,

+ 40 - 38
Terminal.Gui/Drawing/Color.cs

@@ -17,7 +17,7 @@ namespace Terminal.Gui;
 /// </summary>
 /// <seealso cref="Attribute"/>
 /// <seealso cref="ColorExtensions"/>
-/// <seealso cref="ColorName"/>
+/// <seealso cref="ColorName16"/>
 [JsonConverter (typeof (ColorJsonConverter))]
 [StructLayout (LayoutKind.Explicit)]
 public readonly partial record struct Color : ISpanParsable<Color>, IUtf8SpanParsable<Color>, ISpanFormattable,
@@ -109,9 +109,9 @@ public readonly partial record struct Color : ISpanParsable<Color>, IUtf8SpanPar
 
     /// <summary>Initializes a new instance of the <see cref="Color"/> color from a legacy 16-color named value.</summary>
     /// <param name="colorName">The 16-color value.</param>
-    public Color (in ColorName colorName)
+    public Color (in ColorName16 colorName)
     {
-        string? name = Enum.GetName<ColorName> (colorName);
+        string? name = Enum.GetName<ColorName16> (colorName);
 
         if (name is null)
         {
@@ -144,26 +144,28 @@ public readonly partial record struct Color : ISpanParsable<Color>, IUtf8SpanPar
     /// <summary>Initializes a new instance of the <see cref="Color"/> with all channels set to 0.</summary>
     public Color () { Argb = 0u; }
 
+    // TODO: ColorName and AnsiColorCode are only needed when a driver is in Force16Color mode and we
+    // TODO: should be able to remove these from any non-Driver-specific usages.
     /// <summary>Gets or sets the 3-byte/6-character hexadecimal value for each of the legacy 16-color values.</summary>
     [SerializableConfigurationProperty (Scope = typeof (SettingsScope), OmitClassName = true)]
-    public static Dictionary<ColorName, string> Colors
+    public static Dictionary<ColorName16, string> Colors16
     {
         get =>
 
             // Transform _colorToNameMap into a Dictionary<ColorNames,string>
-            ColorExtensions.ColorToNameMap.ToDictionary (static kvp => kvp.Value, static kvp => kvp.Key.ToString ("g"));
+            ColorExtensions.ColorToName16Map.ToDictionary (static kvp => kvp.Value, static kvp => kvp.Key.ToString ("g"));
         set
         {
             // Transform Dictionary<ColorNames,string> into _colorToNameMap
-            ColorExtensions.ColorToNameMap = value.ToFrozenDictionary (GetColorToNameMapKey, GetColorToNameMapValue);
+            ColorExtensions.ColorToName16Map = value.ToFrozenDictionary (GetColorToNameMapKey, GetColorToNameMapValue);
 
             return;
 
-            static Color GetColorToNameMapKey (KeyValuePair<ColorName, string> kvp) { return new Color (kvp.Value); }
+            static Color GetColorToNameMapKey (KeyValuePair<ColorName16, string> kvp) { return new Color (kvp.Value); }
 
-            static ColorName GetColorToNameMapValue (KeyValuePair<ColorName, string> kvp)
+            static ColorName16 GetColorToNameMapValue (KeyValuePair<ColorName16, string> kvp)
             {
-                return Enum.TryParse (kvp.Key.ToString (), true, out ColorName colorName)
+                return Enum.TryParse (kvp.Key.ToString (), true, out ColorName16 colorName)
                            ? colorName
                            : throw new ArgumentException ($"Invalid color name: {kvp.Key}");
             }
@@ -171,31 +173,31 @@ public readonly partial record struct Color : ISpanParsable<Color>, IUtf8SpanPar
     }
 
     /// <summary>
-    ///     Gets the <see cref="Color"/> using a legacy 16-color <see cref="ColorName"/> value. <see langword="get"/> will
+    ///     Gets the <see cref="Color"/> using a legacy 16-color <see cref="ColorName16"/> value. <see langword="get"/> will
     ///     return the closest 16 color match to the true color when no exact value is found.
     /// </summary>
     /// <remarks>
-    ///     Get returns the <see cref="GetClosestNamedColor (Color)"/> of the closest 24-bit color value. Set sets the RGB
+    ///     Get returns the <see cref="GetClosestNamedColor16(Color)"/> of the closest 24-bit color value. Set sets the RGB
     ///     value using a hard-coded map.
     /// </remarks>
-    public AnsiColorCode GetAnsiColorCode () { return ColorExtensions.ColorNameToAnsiColorMap [GetClosestNamedColor ()]; }
+    public AnsiColorCode GetAnsiColorCode () { return ColorExtensions.ColorName16ToAnsiColorMap [GetClosestNamedColor16 ()]; }
 
     /// <summary>
-    ///     Gets the <see cref="Color"/> using a legacy 16-color <see cref="Gui.ColorName"/> value. <see langword="get"/>
+    ///     Gets the <see cref="Color"/> using a legacy 16-color <see cref="ColorName16"/> value. <see langword="get"/>
     ///     will return the closest 16 color match to the true color when no exact value is found.
     /// </summary>
     /// <remarks>
-    ///     Get returns the <see cref="GetClosestNamedColor (Color)"/> of the closest 24-bit color value. Set sets the RGB
+    ///     Get returns the <see cref="GetClosestNamedColor16(Terminal.Gui.Color)"/> of the closest 24-bit color value. Set sets the RGB
     ///     value using a hard-coded map.
     /// </remarks>
-    public ColorName GetClosestNamedColor () { return GetClosestNamedColor (this); }
+    public ColorName16 GetClosestNamedColor16 () { return GetClosestNamedColor16 (this); }
 
     /// <summary>
     ///     Determines if the closest named <see cref="Color"/> to <see langword="this"/> is the provided
     ///     <paramref name="namedColor"/>.
     /// </summary>
     /// <param name="namedColor">
-    ///     The <see cref="GetClosestNamedColor (Color)"/> to check if this <see cref="Color"/> is closer
+    ///     The <see cref="GetClosestNamedColor16(Terminal.Gui.Color)"/> to check if this <see cref="Color"/> is closer
     ///     to than any other configured named color.
     /// </param>
     /// <returns>
@@ -208,18 +210,18 @@ public readonly partial record struct Color : ISpanParsable<Color>, IUtf8SpanPar
     /// </remarks>
     [Pure]
     [MethodImpl (MethodImplOptions.AggressiveInlining)]
-    public bool IsClosestToNamedColor (in ColorName namedColor) { return GetClosestNamedColor () == namedColor; }
+    public bool IsClosestToNamedColor16 (in ColorName16 namedColor) { return GetClosestNamedColor16 () == namedColor; }
 
     /// <summary>
     ///     Determines if the closest named <see cref="Color"/> to <paramref name="color"/>/> is the provided
     ///     <paramref name="namedColor"/>.
     /// </summary>
     /// <param name="color">
-    ///     The color to test against the <see cref="GetClosestNamedColor (Color)"/> value in
+    ///     The color to test against the <see cref="GetClosestNamedColor16(Terminal.Gui.Color)"/> value in
     ///     <paramref name="namedColor"/>.
     /// </param>
     /// <param name="namedColor">
-    ///     The <see cref="GetClosestNamedColor (Color)"/> to check if this <see cref="Color"/> is closer
+    ///     The <see cref="GetClosestNamedColor16(Terminal.Gui.Color)"/> to check if this <see cref="Color"/> is closer
     ///     to than any other configured named color.
     /// </param>
     /// <returns>
@@ -233,7 +235,7 @@ public readonly partial record struct Color : ISpanParsable<Color>, IUtf8SpanPar
     /// </remarks>
     [Pure]
     [MethodImpl (MethodImplOptions.AggressiveInlining)]
-    public static bool IsColorClosestToNamedColor (in Color color, in ColorName namedColor) { return color.IsClosestToNamedColor (in namedColor); }
+    public static bool IsColorClosestToNamedColor16 (in Color color, in ColorName16 namedColor) { return color.IsClosestToNamedColor16 (in namedColor); }
 
     /// <summary>Gets the "closest" named color to this <see cref="Color"/> value.</summary>
     /// <param name="inputColor"></param>
@@ -244,9 +246,9 @@ public readonly partial record struct Color : ISpanParsable<Color>, IUtf8SpanPar
     /// </remarks>
     /// <returns></returns>
     [SkipLocalsInit]
-    internal static ColorName GetClosestNamedColor (Color inputColor)
+    internal static ColorName16 GetClosestNamedColor16 (Color inputColor)
     {
-        return ColorExtensions.ColorToNameMap.MinBy (pair => CalculateColorDistance (inputColor, pair.Key)).Value;
+        return ColorExtensions.ColorToName16Map.MinBy (pair => CalculateColorDistance (inputColor, pair.Key)).Value;
     }
 
     [SkipLocalsInit]
@@ -297,52 +299,52 @@ public readonly partial record struct Color : ISpanParsable<Color>, IUtf8SpanPar
     #region Legacy Color Names
 
     /// <summary>The black color.</summary>
-    public const ColorName Black = ColorName.Black;
+    public const ColorName16 Black = ColorName16.Black;
 
     /// <summary>The blue color.</summary>
-    public const ColorName Blue = ColorName.Blue;
+    public const ColorName16 Blue = ColorName16.Blue;
 
     /// <summary>The green color.</summary>
-    public const ColorName Green = ColorName.Green;
+    public const ColorName16 Green = ColorName16.Green;
 
     /// <summary>The cyan color.</summary>
-    public const ColorName Cyan = ColorName.Cyan;
+    public const ColorName16 Cyan = ColorName16.Cyan;
 
     /// <summary>The red color.</summary>
-    public const ColorName Red = ColorName.Red;
+    public const ColorName16 Red = ColorName16.Red;
 
     /// <summary>The magenta color.</summary>
-    public const ColorName Magenta = ColorName.Magenta;
+    public const ColorName16 Magenta = ColorName16.Magenta;
 
     /// <summary>The yellow color.</summary>
-    public const ColorName Yellow = ColorName.Yellow;
+    public const ColorName16 Yellow = ColorName16.Yellow;
 
     /// <summary>The gray color.</summary>
-    public const ColorName Gray = ColorName.Gray;
+    public const ColorName16 Gray = ColorName16.Gray;
 
     /// <summary>The dark gray color.</summary>
-    public const ColorName DarkGray = ColorName.DarkGray;
+    public const ColorName16 DarkGray = ColorName16.DarkGray;
 
     /// <summary>The bright bBlue color.</summary>
-    public const ColorName BrightBlue = ColorName.BrightBlue;
+    public const ColorName16 BrightBlue = ColorName16.BrightBlue;
 
     /// <summary>The bright green color.</summary>
-    public const ColorName BrightGreen = ColorName.BrightGreen;
+    public const ColorName16 BrightGreen = ColorName16.BrightGreen;
 
     /// <summary>The bright cyan color.</summary>
-    public const ColorName BrightCyan = ColorName.BrightCyan;
+    public const ColorName16 BrightCyan = ColorName16.BrightCyan;
 
     /// <summary>The bright red color.</summary>
-    public const ColorName BrightRed = ColorName.BrightRed;
+    public const ColorName16 BrightRed = ColorName16.BrightRed;
 
     /// <summary>The bright magenta color.</summary>
-    public const ColorName BrightMagenta = ColorName.BrightMagenta;
+    public const ColorName16 BrightMagenta = ColorName16.BrightMagenta;
 
     /// <summary>The bright yellow color.</summary>
-    public const ColorName BrightYellow = ColorName.BrightYellow;
+    public const ColorName16 BrightYellow = ColorName16.BrightYellow;
 
     /// <summary>The White color.</summary>
-    public const ColorName White = ColorName.White;
+    public const ColorName16 White = ColorName16.White;
 
     #endregion
 }

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

@@ -61,7 +61,7 @@ public class ColorPicker16 : View
         set
         {
             int colorIndex = value.Y * _cols + value.X;
-            SelectedColor = (ColorName)colorIndex;
+            SelectedColor = (ColorName16)colorIndex;
         }
     }
 
@@ -132,7 +132,7 @@ public class ColorPicker16 : View
                     continue;
                 }
 
-                Driver.SetAttribute (new ((ColorName)foregroundColorIndex, (ColorName)colorIndex));
+                Driver.SetAttribute (new ((ColorName16)foregroundColorIndex, (ColorName16)colorIndex));
                 bool selected = x == Cursor.X && y == Cursor.Y;
                 DrawColorBox (x, y, selected);
                 colorIndex++;
@@ -141,12 +141,12 @@ public class ColorPicker16 : View
     }
 
     /// <summary>Selected color.</summary>
-    public ColorName SelectedColor
+    public ColorName16 SelectedColor
     {
-        get => (ColorName)_selectColorIndex;
+        get => (ColorName16)_selectColorIndex;
         set
         {
-            if (value == (ColorName)_selectColorIndex)
+            if (value == (ColorName16)_selectColorIndex)
             {
                 return;
             }

+ 2 - 2
UICatalog/Scenarios/AdornmentEditor.cs

@@ -61,8 +61,8 @@ public class AdornmentEditor : View
                 _adornment.Initialized += (sender, args) =>
                                           {
                                               var cs = _adornment.ColorScheme;
-                                              _foregroundColorPicker.SelectedColor = cs.Normal.Foreground.GetClosestNamedColor ();
-                                              _backgroundColorPicker.SelectedColor = cs.Normal.Background.GetClosestNamedColor ();
+                                              _foregroundColorPicker.SelectedColor = cs.Normal.Foreground.GetClosestNamedColor16 ();
+                                              _backgroundColorPicker.SelectedColor = cs.Normal.Background.GetClosestNamedColor16 ();
 
                                           };
             }

+ 0 - 116
UICatalog/Scenarios/BasicColors.cs

@@ -1,116 +0,0 @@
-using System;
-using Terminal.Gui;
-
-namespace UICatalog.Scenarios;
-
-[ScenarioMetadata ("Basic Colors", "Show all basic colors.")]
-[ScenarioCategory ("Colors")]
-[ScenarioCategory ("Text and Formatting")]
-public class BasicColors : Scenario
-{
-    public override void Main ()
-    {
-        Application.Init ();
-
-        Window app = new ()
-        {
-            Title = GetQuitKeyAndName (),
-        };
-
-        var vx = 30;
-        var x = 30;
-        var y = 14;
-        Array colors = Enum.GetValues (typeof (ColorName));
-
-        foreach (ColorName bg in colors)
-        {
-            var attr = new Attribute (bg, colors.Length - 1 - bg);
-
-            var vl = new Label
-            {
-                X = vx,
-                Y = 0,
-                Width = 1,
-                Height = 13,
-                VerticalTextAlignment = Alignment.End,
-                ColorScheme = new ColorScheme { Normal = attr },
-                Text = bg.ToString (),
-                TextDirection = TextDirection.TopBottom_LeftRight
-            };
-            app.Add (vl);
-
-            var hl = new Label
-            {
-                X = 15,
-                Y = y,
-                Width = 13,
-                Height = 1,
-                TextAlignment = Alignment.End,
-                ColorScheme = new ColorScheme { Normal = attr },
-                Text = bg.ToString ()
-            };
-            app.Add (hl);
-            vx++;
-
-            foreach (ColorName fg in colors)
-            {
-                var c = new Attribute (fg, bg);
-                var t = x.ToString ();
-
-                var l = new Label
-                {
-                    ColorScheme = new ColorScheme { Normal = c }, X = x, Y = y, Text = t [^1].ToString ()
-                };
-                app.Add (l);
-                x++;
-            }
-
-            x = 30;
-            y++;
-        }
-
-        app.Add (
-                 new Label { X = Pos.AnchorEnd (36), Text = "Mouse over to get the Attribute:" }
-                );
-        app.Add (new Label { X = Pos.AnchorEnd (35), Y = 2, Text = "Foreground:" });
-
-        var lblForeground = new Label { X = Pos.AnchorEnd (23), Y = 2 };
-        app.Add (lblForeground);
-
-        var viewForeground = new View { X = Pos.AnchorEnd (2), Y = 2, ColorScheme = new ColorScheme (), Text = "  " };
-        app.Add (viewForeground);
-
-        app.Add (new Label { X = Pos.AnchorEnd (35), Y = 4, Text = "Background:" });
-
-        var lblBackground = new Label { X = Pos.AnchorEnd (23), Y = 4 };
-        app.Add (lblBackground);
-
-        var viewBackground = new View { X = Pos.AnchorEnd (2), Y = 4, ColorScheme = new ColorScheme (), Text = "  " };
-        app.Add (viewBackground);
-
-        Application.MouseEvent += (s, e) =>
-                                  {
-                                      if (e.View != null)
-                                      {
-                                          Color fore = e.View.GetNormalColor ().Foreground;
-                                          Color back = e.View.GetNormalColor ().Background;
-
-                                          lblForeground.Text =
-                                              $"#{fore.R:X2}{fore.G:X2}{fore.B:X2} {fore.GetClosestNamedColor ()} ";
-
-                                          viewForeground.ColorScheme =
-                                              new ColorScheme (viewForeground.ColorScheme) { Normal = new Attribute (fore, fore) };
-
-                                          lblBackground.Text =
-                                              $"#{back.R:X2}{back.G:X2}{back.B:X2} {back.GetClosestNamedColor ()} ";
-
-                                          viewBackground.ColorScheme =
-                                              new ColorScheme (viewBackground.ColorScheme) { Normal = new Attribute (back, back) };
-                                      }
-                                  };
-
-        Application.Run (app);
-        app.Dispose ();
-        Application.Shutdown ();
-    }
-}

+ 2 - 2
UICatalog/Scenarios/ColorPicker.cs

@@ -216,8 +216,8 @@ public class ColorPickers : Scenario
         app.Add (cbShowName);
 
         // Set default colors.
-        foregroundColorPicker.SelectedColor = _demoView.SuperView.ColorScheme.Normal.Foreground.GetClosestNamedColor ();
-        backgroundColorPicker.SelectedColor = _demoView.SuperView.ColorScheme.Normal.Background.GetClosestNamedColor ();
+        foregroundColorPicker.SelectedColor = _demoView.SuperView.ColorScheme.Normal.Foreground.GetClosestNamedColor16 ();
+        backgroundColorPicker.SelectedColor = _demoView.SuperView.ColorScheme.Normal.Background.GetClosestNamedColor16 ();
         app.Initialized += (s, e) => app.LayoutSubviews ();
 
         Application.Run (app);

+ 2 - 2
UICatalog/Scenarios/GraphViewExample.cs

@@ -239,8 +239,8 @@ public class GraphViewExample : Scenario
 
         _about.Text = "Housing Expenditures by income thirds 1996-2003";
 
-        Color fore = _graphView.ColorScheme.Normal.Foreground == new Color (ColorName.Black)
-                         ? new (ColorName.White)
+        Color fore = _graphView.ColorScheme.Normal.Foreground == Color.Black
+                         ? Color.White
                          : _graphView.ColorScheme.Normal.Foreground;
         var black = new Attribute (fore, Color.Black);
         var cyan = new Attribute (Color.BrightCyan, Color.Black);

+ 3 - 3
UICatalog/Scenarios/InvertColors.cs

@@ -20,12 +20,12 @@ public class InvertColors : Scenario
         };
 
         List<Label> labels = new ();
-        ColorName [] foreColors = Enum.GetValues (typeof (ColorName)).Cast<ColorName> ().ToArray ();
+        ColorName16 [] foreColors = Enum.GetValues (typeof (ColorName16)).Cast<ColorName16> ().ToArray ();
 
         for (var y = 0; y < foreColors.Length; y++)
         {
-            ColorName fore = foreColors [y];
-            ColorName back = foreColors [(y + 1) % foreColors.Length];
+            ColorName16 fore = foreColors [y];
+            ColorName16 back = foreColors [(y + 1) % foreColors.Length];
             var color = new Attribute (fore, back);
 
             var label = new Label { ColorScheme = new ColorScheme (), Y = y, Text = $"{fore} on {back}" };

+ 1 - 1
UICatalog/Scenarios/Sliders.cs

@@ -468,7 +468,7 @@ public class Sliders : Scenario
 
         List<SliderOption<(Color, Color)>> colorOptions = new ();
 
-        foreach (ColorName colorIndex in Enum.GetValues<ColorName> ())
+        foreach (ColorName16 colorIndex in Enum.GetValues<ColorName16> ())
         {
             var colorName = colorIndex.ToString ();
 

+ 6 - 6
UICatalog/Scenarios/TextEffectsScenario.cs

@@ -38,11 +38,11 @@ public class TextEffectsScenario : Scenario
 
         w.ColorScheme = new ()
         {
-            Normal = new (ColorName.White, ColorName.Black),
-            Focus = new (ColorName.Black, ColorName.White),
-            HotNormal = new (ColorName.White, ColorName.Black),
-            HotFocus = new (ColorName.White, ColorName.Black),
-            Disabled = new (ColorName.Gray, ColorName.Black)
+            Normal = new (ColorName16.White, ColorName16.Black),
+            Focus = new (ColorName16.Black, ColorName16.White),
+            HotNormal = new (ColorName16.White, ColorName16.Black),
+            HotFocus = new (ColorName16.White, ColorName16.Black),
+            Disabled = new (ColorName16.Gray, ColorName16.Black)
         };
 
         // Creates a window that occupies the entire terminal with a title.
@@ -100,7 +100,7 @@ public class TextEffectsScenario : Scenario
                                      new (0, 0, size.Width, size.Height),
                                      g,
                                      GradientDirection.Diagonal);
-        var back = new SolidFill (new (ColorName.Black));
+        var back = new SolidFill (new (ColorName16.Black));
 
         w.LineCanvas.Fill = new (
                                  fore,

+ 23 - 23
UnitTests/Configuration/JsonConverterTests.cs

@@ -41,23 +41,23 @@ public class ColorJsonConverterTests
     }
 
     [Theory]
-    [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)
+    [InlineData (ColorName16.Black, "Black")]
+    [InlineData (ColorName16.Blue, "Blue")]
+    [InlineData (ColorName16.Green, "Green")]
+    [InlineData (ColorName16.Cyan, "Cyan")]
+    [InlineData (ColorName16.Gray, "Gray")]
+    [InlineData (ColorName16.Red, "Red")]
+    [InlineData (ColorName16.Magenta, "Magenta")]
+    [InlineData (ColorName16.Yellow, "Yellow")]
+    [InlineData (ColorName16.DarkGray, "DarkGray")]
+    [InlineData (ColorName16.BrightBlue, "BrightBlue")]
+    [InlineData (ColorName16.BrightGreen, "BrightGreen")]
+    [InlineData (ColorName16.BrightCyan, "BrightCyan")]
+    [InlineData (ColorName16.BrightRed, "BrightRed")]
+    [InlineData (ColorName16.BrightMagenta, "BrightMagenta")]
+    [InlineData (ColorName16.BrightYellow, "BrightYellow")]
+    [InlineData (ColorName16.White, "White")]
+    public void SerializesEnumValuesAsStrings (ColorName16 colorName, string expectedJson)
     {
         var converter = new ColorJsonConverter ();
         var options = new JsonSerializerOptions { Converters = { converter } };
@@ -101,7 +101,7 @@ public class ColorJsonConverterTests
     [InlineData ("Magenta", Color.Magenta)]
     [InlineData ("Red", Color.Red)]
     [InlineData ("White", Color.White)]
-    public void TestColorDeserializationFromHumanReadableColorNames (string colorName, ColorName expectedColor)
+    public void TestColorDeserializationFromHumanReadableColorName16 (string colorName, ColorName16 expectedColor)
     {
         // Arrange
         var json = $"\"{colorName}\"";
@@ -135,7 +135,7 @@ public class ColorJsonConverterTests
     {
         // Arrange
         var json = "\"BrightRed\"";
-        var expectedColor = new Color (ColorName.BrightRed);
+        var expectedColor = Color.BrightRed;
 
         // Act
         var color = JsonSerializer.Deserialize<Color> (
@@ -188,14 +188,14 @@ public class AttributeJsonConverterTests
         // Test deserializing from human-readable color names
         var json = "{\"Foreground\":\"Blue\",\"Background\":\"Green\"}";
         var attribute = JsonSerializer.Deserialize<Attribute> (json, ConfigurationManagerTests._jsonOptions);
-        Assert.Equal (Color.Blue, attribute.Foreground.GetClosestNamedColor ());
-        Assert.Equal (Color.Green, attribute.Background.GetClosestNamedColor ());
+        Assert.Equal (Color.Blue, attribute.Foreground.GetClosestNamedColor16 ());
+        Assert.Equal (Color.Green, attribute.Background.GetClosestNamedColor16 ());
 
         // Test deserializing from RGB values
         json = "{\"Foreground\":\"rgb(255,0,0)\",\"Background\":\"rgb(0,255,0)\"}";
         attribute = JsonSerializer.Deserialize<Attribute> (json, ConfigurationManagerTests._jsonOptions);
-        Assert.Equal (Color.Red, attribute.Foreground.GetClosestNamedColor ());
-        Assert.Equal (Color.BrightGreen, attribute.Background.GetClosestNamedColor ());
+        Assert.Equal (Color.Red, attribute.Foreground.GetClosestNamedColor16 ());
+        Assert.Equal (Color.BrightGreen, attribute.Background.GetClosestNamedColor16 ());
     }
 
     [Fact]

+ 7 - 7
UnitTests/Drawing/AttributeTests.cs

@@ -16,7 +16,7 @@ public class AttributeTests
     {
         // Arrange & Act
         var foregroundColor = new Color (0, 0, 255);
-        var backgroundColorName = ColorName.Black;
+        var backgroundColorName = ColorName16.Black;
         var attribute = new Attribute (foregroundColor, backgroundColorName);
 
         // Assert
@@ -41,7 +41,7 @@ public class AttributeTests
     public void ColorNamesAndColorConstructor ()
     {
         // Arrange & Act
-        var foregroundColorName = ColorName.BrightYellow;
+        var foregroundColorName = ColorName16.BrightYellow;
         var backgroundColor = new Color (128, 128, 128);
         var attribute = new Attribute (foregroundColorName, backgroundColor);
 
@@ -54,7 +54,7 @@ public class AttributeTests
     public void ColorNamesConstructor ()
     {
         // Arrange & Act
-        var attribute = new Attribute (ColorName.Blue);
+        var attribute = new Attribute (ColorName16.Blue);
 
         // Assert
         Assert.Equal (new Color (Color.Blue), attribute.Foreground);
@@ -278,7 +278,7 @@ public class AttributeTests
     {
         // Arrange
         var foregroundColor = new Color (255, 0);
-        var backgroundColorName = ColorName.White;
+        var backgroundColorName = ColorName16.White;
 
         // Act
         var attribute = new Attribute (foregroundColor, backgroundColorName);
@@ -292,7 +292,7 @@ public class AttributeTests
     public void MakeColorNamesAndColor_ForegroundAndBackgroundShouldMatchInput ()
     {
         // Arrange
-        var foregroundColorName = ColorName.Green;
+        var foregroundColorName = ColorName16.Green;
         var backgroundColor = new Color (128, 128, 128);
 
         // Act
@@ -307,8 +307,8 @@ public class AttributeTests
     public void MakeColorNamesAndColorNames_ForegroundAndBackgroundShouldMatchInput ()
     {
         // Arrange
-        var foregroundColorName = ColorName.BrightYellow;
-        var backgroundColorName = ColorName.Black;
+        var foregroundColorName = ColorName16.BrightYellow;
+        var backgroundColorName = ColorName16.Black;
 
         // Act
         var attribute = new Attribute (foregroundColorName, backgroundColorName);

+ 19 - 19
UnitTests/Drawing/ColorTests.Constructors.cs

@@ -72,7 +72,7 @@ public partial class ColorTests
                     MemberType = typeof (ColorTestsTheoryDataGenerators)
                 )]
     public void Constructor_WithColorName_AllChannelsCorrect (
-        ColorName cname,
+        ColorName16 cname,
         ValueTuple<byte, byte, byte> expectedColorValues
     )
     {
@@ -195,25 +195,25 @@ public partial class ColorTests
 
 public static partial class ColorTestsTheoryDataGenerators
 {
-    public static TheoryData<ColorName, ValueTuple<byte, byte, byte>> Constructor_WithColorName_AllChannelsCorrect ()
+    public static TheoryData<ColorName16, ValueTuple<byte, byte, byte>> Constructor_WithColorName_AllChannelsCorrect ()
     {
-        TheoryData<ColorName, ValueTuple<byte, byte, byte>> data = [];
-        data.Add (ColorName.Black, new ValueTuple<byte, byte, byte> (12, 12, 12));
-        data.Add (ColorName.Blue, new ValueTuple<byte, byte, byte> (0, 55, 218));
-        data.Add (ColorName.Green, new ValueTuple<byte, byte, byte> (19, 161, 14));
-        data.Add (ColorName.Cyan, new ValueTuple<byte, byte, byte> (58, 150, 221));
-        data.Add (ColorName.Red, new ValueTuple<byte, byte, byte> (197, 15, 31));
-        data.Add (ColorName.Magenta, new ValueTuple<byte, byte, byte> (136, 23, 152));
-        data.Add (ColorName.Yellow, new ValueTuple<byte, byte, byte> (128, 64, 32));
-        data.Add (ColorName.Gray, new ValueTuple<byte, byte, byte> (204, 204, 204));
-        data.Add (ColorName.DarkGray, new ValueTuple<byte, byte, byte> (118, 118, 118));
-        data.Add (ColorName.BrightBlue, new ValueTuple<byte, byte, byte> (59, 120, 255));
-        data.Add (ColorName.BrightGreen, new ValueTuple<byte, byte, byte> (22, 198, 12));
-        data.Add (ColorName.BrightCyan, new ValueTuple<byte, byte, byte> (97, 214, 214));
-        data.Add (ColorName.BrightRed, new ValueTuple<byte, byte, byte> (231, 72, 86));
-        data.Add (ColorName.BrightMagenta, new ValueTuple<byte, byte, byte> (180, 0, 158));
-        data.Add (ColorName.BrightYellow, new ValueTuple<byte, byte, byte> (249, 241, 165));
-        data.Add (ColorName.White, new ValueTuple<byte, byte, byte> (242, 242, 242));
+        TheoryData<ColorName16, ValueTuple<byte, byte, byte>> data = [];
+        data.Add (ColorName16.Black, new ValueTuple<byte, byte, byte> (12, 12, 12));
+        data.Add (ColorName16.Blue, new ValueTuple<byte, byte, byte> (0, 55, 218));
+        data.Add (ColorName16.Green, new ValueTuple<byte, byte, byte> (19, 161, 14));
+        data.Add (ColorName16.Cyan, new ValueTuple<byte, byte, byte> (58, 150, 221));
+        data.Add (ColorName16.Red, new ValueTuple<byte, byte, byte> (197, 15, 31));
+        data.Add (ColorName16.Magenta, new ValueTuple<byte, byte, byte> (136, 23, 152));
+        data.Add (ColorName16.Yellow, new ValueTuple<byte, byte, byte> (128, 64, 32));
+        data.Add (ColorName16.Gray, new ValueTuple<byte, byte, byte> (204, 204, 204));
+        data.Add (ColorName16.DarkGray, new ValueTuple<byte, byte, byte> (118, 118, 118));
+        data.Add (ColorName16.BrightBlue, new ValueTuple<byte, byte, byte> (59, 120, 255));
+        data.Add (ColorName16.BrightGreen, new ValueTuple<byte, byte, byte> (22, 198, 12));
+        data.Add (ColorName16.BrightCyan, new ValueTuple<byte, byte, byte> (97, 214, 214));
+        data.Add (ColorName16.BrightRed, new ValueTuple<byte, byte, byte> (231, 72, 86));
+        data.Add (ColorName16.BrightMagenta, new ValueTuple<byte, byte, byte> (180, 0, 158));
+        data.Add (ColorName16.BrightYellow, new ValueTuple<byte, byte, byte> (249, 241, 165));
+        data.Add (ColorName16.White, new ValueTuple<byte, byte, byte> (242, 242, 242));
 
         return data;
     }

+ 19 - 19
UnitTests/Drawing/ColorTests.Operators.cs

@@ -64,7 +64,7 @@ public partial class ColorTests
                     nameof (ColorTestsTheoryDataGenerators.ExplicitOperator_FromColorName_RoundTripsCorrectly),
                     MemberType = typeof (ColorTestsTheoryDataGenerators)
                 )]
-    public void ImplicitOperator_FromColorName_ReturnsCorrectColorValue (ColorName cname, Color expectedColor)
+    public void ImplicitOperator_FromColorName_ReturnsCorrectColorValue (ColorName16 cname, Color expectedColor)
     {
         Color color = cname;
 
@@ -182,26 +182,26 @@ public partial class ColorTests
 
 public static partial class ColorTestsTheoryDataGenerators
 {
-    public static TheoryData<ColorName, Color> ExplicitOperator_FromColorName_RoundTripsCorrectly ()
+    public static TheoryData<ColorName16, Color> ExplicitOperator_FromColorName_RoundTripsCorrectly ()
     {
-        TheoryData<ColorName, Color> data = []
+        TheoryData<ColorName16, Color> data = []
             ;
-        data.Add (ColorName.Black, new Color (12, 12, 12));
-        data.Add (ColorName.Blue, new Color (0, 55, 218));
-        data.Add (ColorName.Green, new Color (19, 161, 14));
-        data.Add (ColorName.Cyan, new Color (58, 150, 221));
-        data.Add (ColorName.Red, new Color (197, 15, 31));
-        data.Add (ColorName.Magenta, new Color (136, 23, 152));
-        data.Add (ColorName.Yellow, new Color (128, 64, 32));
-        data.Add (ColorName.Gray, new Color (204, 204, 204));
-        data.Add (ColorName.DarkGray, new Color (118, 118, 118));
-        data.Add (ColorName.BrightBlue, new Color (59, 120, 255));
-        data.Add (ColorName.BrightGreen, new Color (22, 198, 12));
-        data.Add (ColorName.BrightCyan, new Color (97, 214, 214));
-        data.Add (ColorName.BrightRed, new Color (231, 72, 86));
-        data.Add (ColorName.BrightMagenta, new Color (180, 0, 158));
-        data.Add (ColorName.BrightYellow, new Color (249, 241, 165));
-        data.Add (ColorName.White, new Color (242, 242, 242));
+        data.Add (ColorName16.Black, new Color (12, 12, 12));
+        data.Add (ColorName16.Blue, new Color (0, 55, 218));
+        data.Add (ColorName16.Green, new Color (19, 161, 14));
+        data.Add (ColorName16.Cyan, new Color (58, 150, 221));
+        data.Add (ColorName16.Red, new Color (197, 15, 31));
+        data.Add (ColorName16.Magenta, new Color (136, 23, 152));
+        data.Add (ColorName16.Yellow, new Color (128, 64, 32));
+        data.Add (ColorName16.Gray, new Color (204, 204, 204));
+        data.Add (ColorName16.DarkGray, new Color (118, 118, 118));
+        data.Add (ColorName16.BrightBlue, new Color (59, 120, 255));
+        data.Add (ColorName16.BrightGreen, new Color (22, 198, 12));
+        data.Add (ColorName16.BrightCyan, new Color (97, 214, 214));
+        data.Add (ColorName16.BrightRed, new Color (231, 72, 86));
+        data.Add (ColorName16.BrightMagenta, new Color (180, 0, 158));
+        data.Add (ColorName16.BrightYellow, new Color (249, 241, 165));
+        data.Add (ColorName16.White, new Color (242, 242, 242));
 
         return data;
     }

+ 1 - 1
UnitTests/Drawing/ColorTests.ParsingAndFormatting.cs

@@ -10,7 +10,7 @@ public partial class ColorTests
     public void Color_ToString_WithNamedColor ()
     {
         // Arrange
-        var color = new Color (ColorName.Blue);// Blue
+        var color = new Color (ColorName16.Blue);// Blue
 
         // Act
         var colorString = color.ToString ();

+ 20 - 20
UnitTests/Drawing/ColorTests.TypeChecks.cs

@@ -8,7 +8,7 @@ public partial class ColorTests
     [Fact]
     [Trait ("Category", "Type Checks")]
     [Trait ("Category", "Change Control")]
-    public void ColorName_Has_Exactly_16_Defined_Values () { Assert.Equal (16, Enum.GetValues<ColorName> ().DistinctBy (static cname => (int)cname).Count ()); }
+    public void ColorName_Has_Exactly_16_Defined_Values () { Assert.Equal (16, Enum.GetValues<ColorName16> ().DistinctBy (static cname => (int)cname).Count ()); }
 
     [Theory]
     [Trait ("Category", "Type Checks")]
@@ -17,7 +17,7 @@ public partial class ColorTests
                     nameof (ColorTestsTheoryDataGenerators.ColorName_HasCorrectOrdinals),
                     MemberType = typeof (ColorTestsTheoryDataGenerators)
                 )]
-    public void ColorName_HasCorrectOrdinals (ColorName cname, int ordinal) { Assert.Equal ((int)cname, ordinal); }
+    public void ColorName_HasCorrectOrdinals (ColorName16 cname, int ordinal) { Assert.Equal ((int)cname, ordinal); }
 
     [Fact]
     [Trait ("Category", "Type Checks")]
@@ -117,26 +117,26 @@ public partial class ColorTests
 
 public static partial class ColorTestsTheoryDataGenerators
 {
-    public static TheoryData<ColorName, int> ColorName_HasCorrectOrdinals ()
+    public static TheoryData<ColorName16, int> ColorName_HasCorrectOrdinals ()
     {
-        TheoryData<ColorName, int> data = []
+        TheoryData<ColorName16, int> data = []
             ;
-        data.Add (ColorName.Black, 0);
-        data.Add (ColorName.Blue, 1);
-        data.Add (ColorName.Green, 2);
-        data.Add (ColorName.Cyan, 3);
-        data.Add (ColorName.Red, 4);
-        data.Add (ColorName.Magenta, 5);
-        data.Add (ColorName.Yellow, 6);
-        data.Add (ColorName.Gray, 7);
-        data.Add (ColorName.DarkGray, 8);
-        data.Add (ColorName.BrightBlue, 9);
-        data.Add (ColorName.BrightGreen, 10);
-        data.Add (ColorName.BrightCyan, 11);
-        data.Add (ColorName.BrightRed, 12);
-        data.Add (ColorName.BrightMagenta, 13);
-        data.Add (ColorName.BrightYellow, 14);
-        data.Add (ColorName.White, 15);
+        data.Add (ColorName16.Black, 0);
+        data.Add (ColorName16.Blue, 1);
+        data.Add (ColorName16.Green, 2);
+        data.Add (ColorName16.Cyan, 3);
+        data.Add (ColorName16.Red, 4);
+        data.Add (ColorName16.Magenta, 5);
+        data.Add (ColorName16.Yellow, 6);
+        data.Add (ColorName16.Gray, 7);
+        data.Add (ColorName16.DarkGray, 8);
+        data.Add (ColorName16.BrightBlue, 9);
+        data.Add (ColorName16.BrightGreen, 10);
+        data.Add (ColorName16.BrightCyan, 11);
+        data.Add (ColorName16.BrightRed, 12);
+        data.Add (ColorName16.BrightMagenta, 13);
+        data.Add (ColorName16.BrightYellow, 14);
+        data.Add (ColorName16.White, 15);
 
         return data;
     }

+ 16 - 16
UnitTests/Drawing/ColorTests.cs

@@ -26,10 +26,10 @@ public partial class ColorTests
     {
         // Arrange
         var color = new Color (128, 64, 40); // Custom RGB color, closest to Yellow
-        var expectedColorName = ColorName.Yellow;
+        var expectedColorName = ColorName16.Yellow;
 
         // Act
-        ColorName colorName = color.GetClosestNamedColor ();
+        ColorName16 colorName = color.GetClosestNamedColor16 ();
 
         // Assert
         Assert.Equal (expectedColorName, colorName);
@@ -39,12 +39,12 @@ public partial class ColorTests
     public void Color_IsClosestToNamedColor_ReturnsExpectedValue ()
     {
         // Arrange
-        var color1 = new Color (ColorName.Red);
+        var color1 = new Color (ColorName16.Red);
         var color2 = new Color (197, 15, 31); // Red in RGB
 
-        Assert.True (color1.IsClosestToNamedColor (ColorName.Red));
+        Assert.True (color1.IsClosestToNamedColor16 (ColorName16.Red));
 
-        Assert.True (color2.IsClosestToNamedColor (ColorName.Red));
+        Assert.True (color2.IsClosestToNamedColor16 (ColorName16.Red));
     }
 
     [Theory (Skip = "Test data is now bogus")]
@@ -52,9 +52,9 @@ public partial class ColorTests
                     nameof (ColorTestsTheoryDataGenerators.FindClosestColor_ReturnsClosestColor),
                     MemberType = typeof (ColorTestsTheoryDataGenerators)
                 )]
-    public void FindClosestColor_ReturnsClosestColor (Color inputColor, ColorName expectedColorName)
+    public void FindClosestColor_ReturnsClosestColor (Color inputColor, ColorName16 expectedColorName)
     {
-        ColorName actualColorName = Color.GetClosestNamedColor (inputColor);
+        ColorName16 actualColorName = Color.GetClosestNamedColor16 (inputColor);
 
         Assert.Equal (expectedColorName, actualColorName);
     }
@@ -79,16 +79,16 @@ public partial class ColorTests
 
 public static partial class ColorTestsTheoryDataGenerators
 {
-    public static TheoryData<Color, ColorName> FindClosestColor_ReturnsClosestColor ()
+    public static TheoryData<Color, ColorName16> FindClosestColor_ReturnsClosestColor ()
     {
-        TheoryData<Color, ColorName> data = [];
-        data.Add (new Color (0, 0), ColorName.Black);
-        data.Add (new Color (255, 255, 255), ColorName.White);
-        data.Add (new Color (5, 100, 255), ColorName.BrightBlue);
-        data.Add (new Color (0, 255), ColorName.BrightGreen);
-        data.Add (new Color (255, 70, 8), ColorName.BrightRed);
-        data.Add (new Color (0, 128, 128), ColorName.Cyan);
-        data.Add (new Color (128, 64, 32), ColorName.Yellow);
+        TheoryData<Color, ColorName16> data = [];
+        data.Add (new Color (0, 0), ColorName16.Black);
+        data.Add (new Color (255, 255, 255), ColorName16.White);
+        data.Add (new Color (5, 100, 255), ColorName16.BrightBlue);
+        data.Add (new Color (0, 255), ColorName16.BrightGreen);
+        data.Add (new Color (255, 70, 8), ColorName16.BrightRed);
+        data.Add (new Color (0, 128, 128), ColorName16.Cyan);
+        data.Add (new Color (128, 64, 32), ColorName16.Yellow);
 
         return data;
     }

+ 10 - 10
UnitTests/Text/TextFormatterTests.cs

@@ -4143,8 +4143,8 @@ ssb
 
         tf.Draw (
                  new (0, 0, width, height),
-                 new (ColorName.White, ColorName.Black),
-                 new (ColorName.Blue, ColorName.Black),
+                 new (ColorName16.White, ColorName16.Black),
+                 new (ColorName16.Blue, ColorName16.Black),
                  default (Rectangle),
                  driver
                 );
@@ -4161,8 +4161,8 @@ ssb
 
         Attribute [] attrs =
         {
-            Attribute.Default, new (ColorName.Green, ColorName.BrightMagenta),
-            new (ColorName.Blue, ColorName.Cyan)
+            Attribute.Default, new (ColorName16.Green, ColorName16.BrightMagenta),
+            new (ColorName16.Blue, ColorName16.Cyan)
         };
         var tf = new TextFormatter { ConstrainToSize = new (14, 3), Text = "Test\nTest long\nTest long long\n", MultiLine = true };
 
@@ -5965,8 +5965,8 @@ ek")]
 
         tf.Draw (
                  new (0, 0, width, height),
-                 new (ColorName.White, ColorName.Black),
-                 new (ColorName.Blue, ColorName.Black),
+                 new (ColorName16.White, ColorName16.Black),
+                 new (ColorName16.Blue, ColorName16.Black),
                  default (Rectangle),
                  driver
                 );
@@ -6005,8 +6005,8 @@ ek")]
 
         tf.Draw (
                  new (0, 0, width, height),
-                 new (ColorName.White, ColorName.Black),
-                 new (ColorName.Blue, ColorName.Black),
+                 new (ColorName16.White, ColorName16.Black),
+                 new (ColorName16.Blue, ColorName16.Black),
                  default (Rectangle),
                  driver
                 );
@@ -6045,8 +6045,8 @@ ek")]
 
         tf.Draw (
                  new (0, 0, width, height),
-                 new (ColorName.White, ColorName.Black),
-                 new (ColorName.Blue, ColorName.Black),
+                 new (ColorName16.White, ColorName16.Black),
+                 new (ColorName16.Blue, ColorName16.Black),
                  default (Rectangle),
                  driver
                 );

+ 4 - 4
UnitTests/View/Adornment/BorderTests.cs

@@ -24,8 +24,8 @@ public class BorderTests (ITestOutputHelper output)
             Focus = new (Color.Green, Color.Red)
         };
         Assert.NotEqual (view.ColorScheme.Normal.Foreground, view.ColorScheme.Focus.Foreground);
-        Assert.Equal (ColorName.Red, view.Border.GetNormalColor ().Foreground.GetClosestNamedColor ());
-        Assert.Equal (ColorName.Green, view.Border.GetFocusColor ().Foreground.GetClosestNamedColor ());
+        Assert.Equal (ColorName16.Red, view.Border.GetNormalColor ().Foreground.GetClosestNamedColor16 ());
+        Assert.Equal (ColorName16.Green, view.Border.GetFocusColor ().Foreground.GetClosestNamedColor16 ());
         Assert.Equal (view.GetFocusColor (), view.Border.GetFocusColor ());
 
         superView.BeginInit ();
@@ -57,8 +57,8 @@ public class BorderTests (ITestOutputHelper output)
         {
             Normal = new (Color.Red, Color.Green), Focus = new (Color.Green, Color.Red)
         };
-        Assert.Equal (ColorName.Red, view.Border.GetNormalColor ().Foreground.GetClosestNamedColor ());
-        Assert.Equal (ColorName.Green, view.Border.GetFocusColor ().Foreground.GetClosestNamedColor ());
+        Assert.Equal (ColorName16.Red, view.Border.GetNormalColor ().Foreground.GetClosestNamedColor16 ());
+        Assert.Equal (ColorName16.Green, view.Border.GetFocusColor ().Foreground.GetClosestNamedColor16 ());
         Assert.Equal (view.GetNormalColor (), view.Border.GetNormalColor ());
         Assert.Equal (view.GetFocusColor (), view.Border.GetFocusColor ());
 

+ 2 - 2
UnitTests/View/Adornment/MarginTests.cs

@@ -20,8 +20,8 @@ public class MarginTests (ITestOutputHelper output)
         };
 
         superView.Add (view);
-        Assert.Equal (ColorName.Red, view.Margin.GetNormalColor ().Foreground.GetClosestNamedColor ());
-        Assert.Equal (ColorName.Red, superView.GetNormalColor ().Foreground.GetClosestNamedColor ());
+        Assert.Equal (ColorName16.Red, view.Margin.GetNormalColor ().Foreground.GetClosestNamedColor16 ());
+        Assert.Equal (ColorName16.Red, superView.GetNormalColor ().Foreground.GetClosestNamedColor16 ());
         Assert.Equal (superView.GetNormalColor (), view.Margin.GetNormalColor ());
         Assert.Equal (superView.GetFocusColor (), view.Margin.GetFocusColor ());
 

+ 1 - 1
UnitTests/View/Adornment/PaddingTests.cs

@@ -17,7 +17,7 @@ public class PaddingTests (ITestOutputHelper output)
             Normal = new (Color.Red, Color.Green), Focus = new (Color.Green, Color.Red)
         };
 
-        Assert.Equal (ColorName.Red, view.Padding.GetNormalColor ().Foreground.GetClosestNamedColor ());
+        Assert.Equal (ColorName16.Red, view.Padding.GetNormalColor ().Foreground.GetClosestNamedColor16 ());
         Assert.Equal (view.GetNormalColor (), view.Padding.GetNormalColor ());
 
         view.BeginInit ();

+ 1 - 1
UnitTests/View/Mouse/MouseTests.cs

@@ -361,7 +361,7 @@ public class MouseTests (ITestOutputHelper output) : TestsAllViews
         int enablingHighlight = 0;
         int disablingHighlight = 0;
         view.Highlight += View_Highlight;
-        view.ColorScheme = new ColorScheme (new Attribute (ColorName.Red, ColorName.Blue));
+        view.ColorScheme = new ColorScheme (new Attribute (ColorName16.Red, ColorName16.Blue));
         ColorScheme originalColorScheme = view.ColorScheme;
 
         view.NewMouseEvent (new () { Flags = MouseFlags.Button1Pressed, });

+ 13 - 13
UnitTests/Views/ColorPicker16Tests.cs

@@ -6,7 +6,7 @@ public class ColorPicker16Tests
     public void Constructors ()
     {
         var colorPicker = new ColorPicker16 ();
-        Assert.Equal (ColorName.Black, colorPicker.SelectedColor);
+        Assert.Equal (ColorName16.Black, colorPicker.SelectedColor);
         Assert.Equal (Point.Empty, colorPicker.Cursor);
         Assert.True (colorPicker.CanFocus);
 
@@ -20,25 +20,25 @@ public class ColorPicker16Tests
     public void KeyBindings_Command ()
     {
         var colorPicker = new ColorPicker16 ();
-        Assert.Equal (ColorName.Black, colorPicker.SelectedColor);
+        Assert.Equal (ColorName16.Black, colorPicker.SelectedColor);
 
         Assert.True (colorPicker.NewKeyDownEvent (Key.CursorRight));
-        Assert.Equal (ColorName.Blue, colorPicker.SelectedColor);
+        Assert.Equal (ColorName16.Blue, colorPicker.SelectedColor);
 
         Assert.True (colorPicker.NewKeyDownEvent (Key.CursorDown));
-        Assert.Equal (ColorName.BrightBlue, colorPicker.SelectedColor);
+        Assert.Equal (ColorName16.BrightBlue, colorPicker.SelectedColor);
 
         Assert.True (colorPicker.NewKeyDownEvent (Key.CursorLeft));
-        Assert.Equal (ColorName.DarkGray, colorPicker.SelectedColor);
+        Assert.Equal (ColorName16.DarkGray, colorPicker.SelectedColor);
 
         Assert.True (colorPicker.NewKeyDownEvent (Key.CursorUp));
-        Assert.Equal (ColorName.Black, colorPicker.SelectedColor);
+        Assert.Equal (ColorName16.Black, colorPicker.SelectedColor);
 
         Assert.True (colorPicker.NewKeyDownEvent (Key.CursorLeft));
-        Assert.Equal (ColorName.Black, colorPicker.SelectedColor);
+        Assert.Equal (ColorName16.Black, colorPicker.SelectedColor);
 
         Assert.True (colorPicker.NewKeyDownEvent (Key.CursorUp));
-        Assert.Equal (ColorName.Black, colorPicker.SelectedColor);
+        Assert.Equal (ColorName16.Black, colorPicker.SelectedColor);
     }
 
     [Fact]
@@ -46,7 +46,7 @@ public class ColorPicker16Tests
     public void MouseEvents ()
     {
         var colorPicker = new ColorPicker16 { X = 0, Y = 0, Height = 4, Width = 32 };
-        Assert.Equal (ColorName.Black, colorPicker.SelectedColor);
+        Assert.Equal (ColorName16.Black, colorPicker.SelectedColor);
         var top = new Toplevel ();
         top.Add (colorPicker);
         Application.Begin (top);
@@ -54,7 +54,7 @@ public class ColorPicker16Tests
         Assert.False (colorPicker.NewMouseEvent (new ()));
 
         Assert.True (colorPicker.NewMouseEvent (new () { Position = new (4, 1), Flags = MouseFlags.Button1Clicked }));
-        Assert.Equal (ColorName.Blue, colorPicker.SelectedColor);
+        Assert.Equal (ColorName16.Blue, colorPicker.SelectedColor);
         top.Dispose ();
     }
 
@@ -62,7 +62,7 @@ public class ColorPicker16Tests
     public void SelectedColorAndCursor ()
     {
         var colorPicker = new ColorPicker16 ();
-        colorPicker.SelectedColor = ColorName.White;
+        colorPicker.SelectedColor = ColorName16.White;
         Assert.Equal (7, colorPicker.Cursor.X);
         Assert.Equal (1, colorPicker.Cursor.Y);
 
@@ -71,9 +71,9 @@ public class ColorPicker16Tests
         Assert.Equal (0, colorPicker.Cursor.Y);
 
         colorPicker.Cursor = new (7, 1);
-        Assert.Equal (ColorName.White, colorPicker.SelectedColor);
+        Assert.Equal (ColorName16.White, colorPicker.SelectedColor);
 
         colorPicker.Cursor = Point.Empty;
-        Assert.Equal (ColorName.Black, colorPicker.SelectedColor);
+        Assert.Equal (ColorName16.Black, colorPicker.SelectedColor);
     }
 }