Browse Source

Simplify this

Brandon Thetford 1 year ago
parent
commit
166930101a
1 changed files with 2 additions and 10 deletions
  1. 2 10
      Terminal.Gui/Drawing/Attribute.cs

+ 2 - 10
Terminal.Gui/Drawing/Attribute.cs

@@ -72,16 +72,8 @@ public readonly struct Attribute : IEquatable<Attribute>, IEqualityOperators<Att
         Foreground = foreground;
         Background = background;
 
-        // TODO: Once CursesDriver supports truecolor all the PlatformColor stuff goes away
-        if (Application.Driver is null)
-        {
-            PlatformColor = -1;
-
-            return;
-        }
-
-        Attribute make = Application.Driver.MakeColor (foreground, background);
-        PlatformColor = make.PlatformColor;
+        // TODO: Once CursesDriver supports true color all the PlatformColor stuff goes away
+        PlatformColor = Application.Driver?.MakeColor(in foreground, in background).PlatformColor ?? -1;
     }
 
     /// <summary>