Beispiel #1
0
        public void TryEnableMicaEffect(FluentAvaloniaTheme thm)
        {
            // The background colors for the Mica brush are still based around SolidBackgroundFillColorBase resource
            // BUT since we can't control the actual Mica brush color, we have to use the window background to create
            // the same effect. However, we can't use SolidBackgroundFillColorBase directly since its opaque, and if
            // we set the opacity the color become lighter than we want. So we take the normal color, darken it and
            // apply the opacity until we get the roughly the correct color
            // NOTE that the effect still doesn't look right, but it suffices. Ideally we need access to the Mica
            // CompositionBrush to properly change the color but I don't know if we can do that or not
            if (thm.RequestedTheme == FluentAvaloniaTheme.DarkModeString)
            {
                var color = this.TryFindResource("SolidBackgroundFillColorBase", out var value) ? (Color2)(Color)value : new Color2(32, 32, 32);

                color = color.LightenPercent(-0.2f);

                Background = new ImmutableSolidColorBrush(color, 0.85f);
            }
            else if (thm.RequestedTheme == FluentAvaloniaTheme.LightModeString)
            {
                // Similar effect here
                var color = this.TryFindResource("SolidBackgroundFillColorBase", out var value) ? (Color2)(Color)value : new Color2(243, 243, 243);

                color = color.LightenPercent(0.5f);

                Background = new ImmutableSolidColorBrush(color, 0.9);
            }
        }
Beispiel #2
0
 private void RenderDirtyRects(IDrawingContextImpl context)
 {
     foreach (var r in _dirtyRectsDisplay)
     {
         var brush = new ImmutableSolidColorBrush(Colors.Magenta, r.Opacity);
         context.FillRectangle(brush, r.Rect);
     }
 }
Beispiel #3
0
        public CurrentLineHighlightRenderer(TextView textView)
        {
            BorderPen = new Pen(new ImmutableSolidColorBrush(DefaultBorder));

            BackgroundBrush = new ImmutableSolidColorBrush(DefaultBackground);

            _textView = textView ?? throw new ArgumentNullException(nameof(textView));
            _textView.BackgroundRenderers.Add(this);

            _line = 0;
        }
Beispiel #4
0
        public void SetTheme(Theme theme)
        {
            _theme = theme;

            _brushes.Clear();

            var map = _theme.GetColorMap();

            foreach (var color in map)
            {
                var id = _theme.GetColorId(color);

                _brushes[id] = new ImmutableSolidColorBrush(Color.Parse(NormalizeColor(color)));
            }

            _transformations?.Clear();
        }
        public void Equality_Is_Implemented_Between_Mutable_And_Immutable_DashStyles()
        {
            var brush   = new ImmutableSolidColorBrush(Colors.Red);
            var target1 = new ImmutablePen(
                brush: brush,
                thickness: 2,
                dashStyle: new ImmutableDashStyle(new[] { 0.1, 0.2 }, 5),
                lineCap: PenLineCap.Round,
                lineJoin: PenLineJoin.Round,
                miterLimit: 21);
            var target2 = new Pen(
                brush: brush,
                thickness: 2,
                dashStyle: new DashStyle(new[] { 0.1, 0.2 }, 5),
                lineCap: PenLineCap.Round,
                lineJoin: PenLineJoin.Round,
                miterLimit: 21);

            Assert.True(Equals(target1, target2));
        }
Beispiel #6
0
        public MainView()
        {
            AvaloniaXamlLoader.Load(this);

            var sideBar = this.FindControl <TabControl>("Sidebar");

            if (AvaloniaLocator.Current.GetService <IRuntimePlatform>().GetRuntimeInfo().IsDesktop)
            {
                IList tabItems = ((IList)sideBar.Items);
                tabItems.Add(new TabItem()
                {
                    Header  = "Dialogs",
                    Content = new DialogsPage()
                });
                tabItems.Add(new TabItem()
                {
                    Header  = "Screens",
                    Content = new ScreenPage()
                });
            }

            var themes = this.Find <ComboBox>("Themes");

            themes.SelectionChanged += (sender, e) =>
            {
                if (themes.SelectedItem is CatalogTheme theme)
                {
                    var themeStyle = Application.Current.Styles[0];
                    if (theme == CatalogTheme.FluentLight)
                    {
                        if (App.Fluent.Mode != FluentThemeMode.Light)
                        {
                            App.Fluent.Mode = FluentThemeMode.Light;
                        }
                        Application.Current.Styles[0] = App.Fluent;
                        Application.Current.Styles[1] = App.ColorPickerFluent;
                        Application.Current.Styles[2] = App.DataGridFluent;
                    }
                    else if (theme == CatalogTheme.FluentDark)
                    {
                        if (App.Fluent.Mode != FluentThemeMode.Dark)
                        {
                            App.Fluent.Mode = FluentThemeMode.Dark;
                        }
                        Application.Current.Styles[0] = App.Fluent;
                        Application.Current.Styles[1] = App.ColorPickerFluent;
                        Application.Current.Styles[2] = App.DataGridFluent;
                    }
                    else if (theme == CatalogTheme.DefaultLight)
                    {
                        App.Default.Mode = Avalonia.Themes.Default.SimpleThemeMode.Light;
                        Application.Current.Styles[0] = App.DefaultLight;
                        Application.Current.Styles[1] = App.ColorPickerDefault;
                        Application.Current.Styles[2] = App.DataGridDefault;
                    }
                    else if (theme == CatalogTheme.DefaultDark)
                    {
                        App.Default.Mode = Avalonia.Themes.Default.SimpleThemeMode.Dark;
                        Application.Current.Styles[0] = App.DefaultDark;
                        Application.Current.Styles[1] = App.ColorPickerDefault;
                        Application.Current.Styles[2] = App.DataGridDefault;
                    }
                }
            };

            var flowDirections = this.Find <ComboBox>("FlowDirection");

            flowDirections.SelectionChanged += (sender, e) =>
            {
                if (flowDirections.SelectedItem is FlowDirection flowDirection)
                {
                    this.FlowDirection = flowDirection;
                }
            };

            var decorations = this.Find <ComboBox>("Decorations");

            decorations.SelectionChanged += (sender, e) =>
            {
                if (VisualRoot is Window window &&
                    decorations.SelectedItem is SystemDecorations systemDecorations)
                {
                    window.SystemDecorations = systemDecorations;
                }
            };

            var         transparencyLevels = this.Find <ComboBox>("TransparencyLevels");
            IDisposable backgroundSetter = null, paneBackgroundSetter = null;

            transparencyLevels.SelectionChanged += (sender, e) =>
            {
                backgroundSetter?.Dispose();
                paneBackgroundSetter?.Dispose();
                if (transparencyLevels.SelectedItem is WindowTransparencyLevel selected &&
                    selected != WindowTransparencyLevel.None)
                {
                    var semiTransparentBrush = new ImmutableSolidColorBrush(Colors.Gray, 0.5);
                    backgroundSetter     = sideBar.SetValue(BackgroundProperty, semiTransparentBrush, Avalonia.Data.BindingPriority.Style);
                    paneBackgroundSetter = sideBar.SetValue(SplitView.PaneBackgroundProperty, semiTransparentBrush, Avalonia.Data.BindingPriority.Style);
                }
            };
        }
Beispiel #7
0
        public AvaloniaXamlIlWellKnownTypes(TransformerConfiguration cfg)
        {
            XamlIlTypes               = cfg.WellKnownTypes;
            AvaloniaObject            = cfg.TypeSystem.GetType("Avalonia.AvaloniaObject");
            IAvaloniaObject           = cfg.TypeSystem.GetType("Avalonia.IAvaloniaObject");
            AvaloniaObjectExtensions  = cfg.TypeSystem.GetType("Avalonia.AvaloniaObjectExtensions");
            AvaloniaProperty          = cfg.TypeSystem.GetType("Avalonia.AvaloniaProperty");
            AvaloniaPropertyT         = cfg.TypeSystem.GetType("Avalonia.AvaloniaProperty`1");
            AvaloniaAttachedPropertyT = cfg.TypeSystem.GetType("Avalonia.AttachedProperty`1");
            BindingPriority           = cfg.TypeSystem.GetType("Avalonia.Data.BindingPriority");
            IBinding                 = cfg.TypeSystem.GetType("Avalonia.Data.IBinding");
            IDisposable              = cfg.TypeSystem.GetType("System.IDisposable");
            ICommand                 = cfg.TypeSystem.GetType("System.Windows.Input.ICommand");
            Transitions              = cfg.TypeSystem.GetType("Avalonia.Animation.Transitions");
            AssignBindingAttribute   = cfg.TypeSystem.GetType("Avalonia.Data.AssignBindingAttribute");
            DependsOnAttribute       = cfg.TypeSystem.GetType("Avalonia.Metadata.DependsOnAttribute");
            AvaloniaObjectBindMethod = AvaloniaObjectExtensions.FindMethod("Bind", IDisposable, false, IAvaloniaObject,
                                                                           AvaloniaProperty,
                                                                           IBinding, cfg.WellKnownTypes.Object);
            UnsetValueType     = cfg.TypeSystem.GetType("Avalonia.UnsetValueType");
            StyledElement      = cfg.TypeSystem.GetType("Avalonia.StyledElement");
            IStyledElement     = cfg.TypeSystem.GetType("Avalonia.IStyledElement");
            INameScope         = cfg.TypeSystem.GetType("Avalonia.Controls.INameScope");
            INameScopeRegister = INameScope.GetMethod(
                new FindMethodMethodSignature("Register", XamlIlTypes.Void,
                                              XamlIlTypes.String, XamlIlTypes.Object)
            {
                IsStatic      = false,
                DeclaringOnly = true,
                IsExactMatch  = true
            });
            INameScopeComplete = INameScope.GetMethod(
                new FindMethodMethodSignature("Complete", XamlIlTypes.Void)
            {
                IsStatic      = false,
                DeclaringOnly = true,
                IsExactMatch  = true
            });
            NameScope             = cfg.TypeSystem.GetType("Avalonia.Controls.NameScope");
            NameScopeSetNameScope = NameScope.GetMethod(new FindMethodMethodSignature("SetNameScope",
                                                                                      XamlIlTypes.Void, StyledElement, INameScope)
            {
                IsStatic = true
            });
            AvaloniaObjectSetValueMethod = AvaloniaObject.FindMethod("SetValue", XamlIlTypes.Void,
                                                                     false, AvaloniaProperty, XamlIlTypes.Object, BindingPriority);
            IPropertyInfo               = cfg.TypeSystem.GetType("Avalonia.Data.Core.IPropertyInfo");
            ClrPropertyInfo             = cfg.TypeSystem.GetType("Avalonia.Data.Core.ClrPropertyInfo");
            PropertyPath                = cfg.TypeSystem.GetType("Avalonia.Data.Core.PropertyPath");
            PropertyPathBuilder         = cfg.TypeSystem.GetType("Avalonia.Data.Core.PropertyPathBuilder");
            IPropertyAccessor           = cfg.TypeSystem.GetType("Avalonia.Data.Core.Plugins.IPropertyAccessor");
            PropertyInfoAccessorFactory = cfg.TypeSystem.GetType("Avalonia.Markup.Xaml.MarkupExtensions.CompiledBindings.PropertyInfoAccessorFactory");
            CompiledBindingPathBuilder  = cfg.TypeSystem.GetType("Avalonia.Markup.Xaml.MarkupExtensions.CompiledBindings.CompiledBindingPathBuilder");
            CompiledBindingPath         = cfg.TypeSystem.GetType("Avalonia.Markup.Xaml.MarkupExtensions.CompiledBindings.CompiledBindingPath");
            CompiledBindingExtension    = cfg.TypeSystem.GetType("Avalonia.Markup.Xaml.MarkupExtensions.CompiledBindingExtension");
            ResolveByNameExtension      = cfg.TypeSystem.GetType("Avalonia.Markup.Xaml.MarkupExtensions.ResolveByNameExtension");
            DataTemplate                = cfg.TypeSystem.GetType("Avalonia.Markup.Xaml.Templates.DataTemplate");
            IDataTemplate               = cfg.TypeSystem.GetType("Avalonia.Controls.Templates.IDataTemplate");
            IItemsPresenterHost         = cfg.TypeSystem.GetType("Avalonia.Controls.Presenters.IItemsPresenterHost");
            ItemsRepeater               = cfg.TypeSystem.GetType("Avalonia.Controls.ItemsRepeater");
            ReflectionBindingExtension  = cfg.TypeSystem.GetType("Avalonia.Markup.Xaml.MarkupExtensions.ReflectionBindingExtension");
            RelativeSource              = cfg.TypeSystem.GetType("Avalonia.Data.RelativeSource");
            UInt       = cfg.TypeSystem.GetType("System.UInt32");
            Int        = cfg.TypeSystem.GetType("System.Int32");
            Long       = cfg.TypeSystem.GetType("System.Int64");
            Uri        = cfg.TypeSystem.GetType("System.Uri");
            FontFamily = cfg.TypeSystem.GetType("Avalonia.Media.FontFamily");
            FontFamilyConstructorUriName = FontFamily.GetConstructor(new List <IXamlType> {
                Uri, XamlIlTypes.String
            });

            (IXamlType, IXamlConstructor) GetNumericTypeInfo(string name, IXamlType componentType, int componentCount)
            {
                var type = cfg.TypeSystem.GetType(name);
                var ctor = type.GetConstructor(Enumerable.Range(0, componentCount).Select(_ => componentType).ToList());

                return(type, ctor);
            }

            (Thickness, ThicknessFullConstructor)       = GetNumericTypeInfo("Avalonia.Thickness", XamlIlTypes.Double, 4);
            (Point, PointFullConstructor)               = GetNumericTypeInfo("Avalonia.Point", XamlIlTypes.Double, 2);
            (Vector, VectorFullConstructor)             = GetNumericTypeInfo("Avalonia.Vector", XamlIlTypes.Double, 2);
            (Size, SizeFullConstructor)                 = GetNumericTypeInfo("Avalonia.Size", XamlIlTypes.Double, 2);
            (Matrix, MatrixFullConstructor)             = GetNumericTypeInfo("Avalonia.Matrix", XamlIlTypes.Double, 6);
            (CornerRadius, CornerRadiusFullConstructor) = GetNumericTypeInfo("Avalonia.CornerRadius", XamlIlTypes.Double, 4);

            GridLength = cfg.TypeSystem.GetType("Avalonia.Controls.GridLength");
            GridLengthConstructorValueType = GridLength.GetConstructor(new List <IXamlType> {
                XamlIlTypes.Double, cfg.TypeSystem.GetType("Avalonia.Controls.GridUnitType")
            });
            Color = cfg.TypeSystem.GetType("Avalonia.Media.Color");
            StandardCursorType    = cfg.TypeSystem.GetType("Avalonia.Input.StandardCursorType");
            Cursor                = cfg.TypeSystem.GetType("Avalonia.Input.Cursor");
            CursorTypeConstructor = Cursor.GetConstructor(new List <IXamlType> {
                StandardCursorType
            });
            ColumnDefinition             = cfg.TypeSystem.GetType("Avalonia.Controls.ColumnDefinition");
            ColumnDefinitions            = cfg.TypeSystem.GetType("Avalonia.Controls.ColumnDefinitions");
            RowDefinition                = cfg.TypeSystem.GetType("Avalonia.Controls.RowDefinition");
            RowDefinitions               = cfg.TypeSystem.GetType("Avalonia.Controls.RowDefinitions");
            Classes                      = cfg.TypeSystem.GetType("Avalonia.Controls.Classes");
            StyledElementClassesProperty =
                StyledElement.Properties.First(x => x.Name == "Classes" && x.PropertyType.Equals(Classes));
            ClassesBindMethod = cfg.TypeSystem.GetType("Avalonia.StyledElementExtensions")
                                .FindMethod("BindClass", IDisposable, false, IStyledElement,
                                            cfg.WellKnownTypes.String,
                                            IBinding, cfg.WellKnownTypes.Object);

            IBrush = cfg.TypeSystem.GetType("Avalonia.Media.IBrush");
            ImmutableSolidColorBrush = cfg.TypeSystem.GetType("Avalonia.Media.Immutable.ImmutableSolidColorBrush");
            ImmutableSolidColorBrushConstructorColor = ImmutableSolidColorBrush.GetConstructor(new List <IXamlType> {
                UInt
            });
            TypeUtilities            = cfg.TypeSystem.GetType("Avalonia.Utilities.TypeUtilities");
            TextDecorationCollection = cfg.TypeSystem.GetType("Avalonia.Media.TextDecorationCollection");
            TextDecorations          = cfg.TypeSystem.GetType("Avalonia.Media.TextDecorations");
            TextTrimming             = cfg.TypeSystem.GetType("Avalonia.Media.TextTrimming");
            ISetter = cfg.TypeSystem.GetType("Avalonia.Styling.ISetter");
        }
            private static IBrush CreateBackgroundBrush()
            {
                var b = new ImmutableSolidColorBrush(Colors.LimeGreen, 0.4);

                return(b);
            }
Beispiel #9
0
 /// <summary>
 /// Initializes static members of the <see cref="Brushes"/> class.
 /// </summary>
 static Brushes()
 {
     AliceBlue            = new ImmutableSolidColorBrush(Colors.AliceBlue);
     AntiqueWhite         = new ImmutableSolidColorBrush(Colors.AntiqueWhite);
     Aqua                 = new ImmutableSolidColorBrush(Colors.Aqua);
     Aquamarine           = new ImmutableSolidColorBrush(Colors.Aquamarine);
     Azure                = new ImmutableSolidColorBrush(Colors.Azure);
     Beige                = new ImmutableSolidColorBrush(Colors.Beige);
     Bisque               = new ImmutableSolidColorBrush(Colors.Bisque);
     Black                = new ImmutableSolidColorBrush(Colors.Black);
     BlanchedAlmond       = new ImmutableSolidColorBrush(Colors.BlanchedAlmond);
     Blue                 = new ImmutableSolidColorBrush(Colors.Blue);
     BlueViolet           = new ImmutableSolidColorBrush(Colors.BlueViolet);
     Brown                = new ImmutableSolidColorBrush(Colors.Brown);
     BurlyWood            = new ImmutableSolidColorBrush(Colors.BurlyWood);
     CadetBlue            = new ImmutableSolidColorBrush(Colors.CadetBlue);
     Chartreuse           = new ImmutableSolidColorBrush(Colors.Chartreuse);
     Chocolate            = new ImmutableSolidColorBrush(Colors.Chocolate);
     Coral                = new ImmutableSolidColorBrush(Colors.Coral);
     CornflowerBlue       = new ImmutableSolidColorBrush(Colors.CornflowerBlue);
     Cornsilk             = new ImmutableSolidColorBrush(Colors.Cornsilk);
     Crimson              = new ImmutableSolidColorBrush(Colors.Crimson);
     Cyan                 = new ImmutableSolidColorBrush(Colors.Cyan);
     DarkBlue             = new ImmutableSolidColorBrush(Colors.DarkBlue);
     DarkCyan             = new ImmutableSolidColorBrush(Colors.DarkCyan);
     DarkGoldenrod        = new ImmutableSolidColorBrush(Colors.DarkGoldenrod);
     DarkGray             = new ImmutableSolidColorBrush(Colors.DarkGray);
     DarkGreen            = new ImmutableSolidColorBrush(Colors.DarkGreen);
     DarkKhaki            = new ImmutableSolidColorBrush(Colors.DarkKhaki);
     DarkMagenta          = new ImmutableSolidColorBrush(Colors.DarkMagenta);
     DarkOliveGreen       = new ImmutableSolidColorBrush(Colors.DarkOliveGreen);
     DarkOrange           = new ImmutableSolidColorBrush(Colors.DarkOrange);
     DarkOrchid           = new ImmutableSolidColorBrush(Colors.DarkOrchid);
     DarkRed              = new ImmutableSolidColorBrush(Colors.DarkRed);
     DarkSalmon           = new ImmutableSolidColorBrush(Colors.DarkSalmon);
     DarkSeaGreen         = new ImmutableSolidColorBrush(Colors.DarkSeaGreen);
     DarkSlateBlue        = new ImmutableSolidColorBrush(Colors.DarkSlateBlue);
     DarkSlateGray        = new ImmutableSolidColorBrush(Colors.DarkSlateGray);
     DarkTurquoise        = new ImmutableSolidColorBrush(Colors.DarkTurquoise);
     DarkViolet           = new ImmutableSolidColorBrush(Colors.DarkViolet);
     DeepPink             = new ImmutableSolidColorBrush(Colors.DeepPink);
     DeepSkyBlue          = new ImmutableSolidColorBrush(Colors.DeepSkyBlue);
     DimGray              = new ImmutableSolidColorBrush(Colors.DimGray);
     DodgerBlue           = new ImmutableSolidColorBrush(Colors.DodgerBlue);
     Firebrick            = new ImmutableSolidColorBrush(Colors.Firebrick);
     FloralWhite          = new ImmutableSolidColorBrush(Colors.FloralWhite);
     ForestGreen          = new ImmutableSolidColorBrush(Colors.ForestGreen);
     Fuchsia              = new ImmutableSolidColorBrush(Colors.Fuchsia);
     Gainsboro            = new ImmutableSolidColorBrush(Colors.Gainsboro);
     GhostWhite           = new ImmutableSolidColorBrush(Colors.GhostWhite);
     Gold                 = new ImmutableSolidColorBrush(Colors.Gold);
     Goldenrod            = new ImmutableSolidColorBrush(Colors.Goldenrod);
     Gray                 = new ImmutableSolidColorBrush(Colors.Gray);
     Green                = new ImmutableSolidColorBrush(Colors.Green);
     GreenYellow          = new ImmutableSolidColorBrush(Colors.GreenYellow);
     Honeydew             = new ImmutableSolidColorBrush(Colors.Honeydew);
     HotPink              = new ImmutableSolidColorBrush(Colors.HotPink);
     IndianRed            = new ImmutableSolidColorBrush(Colors.IndianRed);
     Indigo               = new ImmutableSolidColorBrush(Colors.Indigo);
     Ivory                = new ImmutableSolidColorBrush(Colors.Ivory);
     Khaki                = new ImmutableSolidColorBrush(Colors.Khaki);
     Lavender             = new ImmutableSolidColorBrush(Colors.Lavender);
     LavenderBlush        = new ImmutableSolidColorBrush(Colors.LavenderBlush);
     LawnGreen            = new ImmutableSolidColorBrush(Colors.LawnGreen);
     LemonChiffon         = new ImmutableSolidColorBrush(Colors.LemonChiffon);
     LightBlue            = new ImmutableSolidColorBrush(Colors.LightBlue);
     LightCoral           = new ImmutableSolidColorBrush(Colors.LightCoral);
     LightCyan            = new ImmutableSolidColorBrush(Colors.LightCyan);
     LightGoldenrodYellow = new ImmutableSolidColorBrush(Colors.LightGoldenrodYellow);
     LightGray            = new ImmutableSolidColorBrush(Colors.LightGray);
     LightGreen           = new ImmutableSolidColorBrush(Colors.LightGreen);
     LightPink            = new ImmutableSolidColorBrush(Colors.LightPink);
     LightSalmon          = new ImmutableSolidColorBrush(Colors.LightSalmon);
     LightSeaGreen        = new ImmutableSolidColorBrush(Colors.LightSeaGreen);
     LightSkyBlue         = new ImmutableSolidColorBrush(Colors.LightSkyBlue);
     LightSlateGray       = new ImmutableSolidColorBrush(Colors.LightSlateGray);
     LightSteelBlue       = new ImmutableSolidColorBrush(Colors.LightSteelBlue);
     LightYellow          = new ImmutableSolidColorBrush(Colors.LightYellow);
     Lime                 = new ImmutableSolidColorBrush(Colors.Lime);
     LimeGreen            = new ImmutableSolidColorBrush(Colors.LimeGreen);
     Linen                = new ImmutableSolidColorBrush(Colors.Linen);
     Magenta              = new ImmutableSolidColorBrush(Colors.Magenta);
     Maroon               = new ImmutableSolidColorBrush(Colors.Maroon);
     MediumAquamarine     = new ImmutableSolidColorBrush(Colors.MediumAquamarine);
     MediumBlue           = new ImmutableSolidColorBrush(Colors.MediumBlue);
     MediumOrchid         = new ImmutableSolidColorBrush(Colors.MediumOrchid);
     MediumPurple         = new ImmutableSolidColorBrush(Colors.MediumPurple);
     MediumSeaGreen       = new ImmutableSolidColorBrush(Colors.MediumSeaGreen);
     MediumSlateBlue      = new ImmutableSolidColorBrush(Colors.MediumSlateBlue);
     MediumSpringGreen    = new ImmutableSolidColorBrush(Colors.MediumSpringGreen);
     MediumTurquoise      = new ImmutableSolidColorBrush(Colors.MediumTurquoise);
     MediumVioletRed      = new ImmutableSolidColorBrush(Colors.MediumVioletRed);
     MidnightBlue         = new ImmutableSolidColorBrush(Colors.MidnightBlue);
     MintCream            = new ImmutableSolidColorBrush(Colors.MintCream);
     MistyRose            = new ImmutableSolidColorBrush(Colors.MistyRose);
     Moccasin             = new ImmutableSolidColorBrush(Colors.Moccasin);
     NavajoWhite          = new ImmutableSolidColorBrush(Colors.NavajoWhite);
     Navy                 = new ImmutableSolidColorBrush(Colors.Navy);
     OldLace              = new ImmutableSolidColorBrush(Colors.OldLace);
     Olive                = new ImmutableSolidColorBrush(Colors.Olive);
     OliveDrab            = new ImmutableSolidColorBrush(Colors.OliveDrab);
     Orange               = new ImmutableSolidColorBrush(Colors.Orange);
     OrangeRed            = new ImmutableSolidColorBrush(Colors.OrangeRed);
     Orchid               = new ImmutableSolidColorBrush(Colors.Orchid);
     PaleGoldenrod        = new ImmutableSolidColorBrush(Colors.PaleGoldenrod);
     PaleGreen            = new ImmutableSolidColorBrush(Colors.PaleGreen);
     PaleTurquoise        = new ImmutableSolidColorBrush(Colors.PaleTurquoise);
     PaleVioletRed        = new ImmutableSolidColorBrush(Colors.PaleVioletRed);
     PapayaWhip           = new ImmutableSolidColorBrush(Colors.PapayaWhip);
     PeachPuff            = new ImmutableSolidColorBrush(Colors.PeachPuff);
     Peru                 = new ImmutableSolidColorBrush(Colors.Peru);
     Pink                 = new ImmutableSolidColorBrush(Colors.Pink);
     Plum                 = new ImmutableSolidColorBrush(Colors.Plum);
     PowderBlue           = new ImmutableSolidColorBrush(Colors.PowderBlue);
     Purple               = new ImmutableSolidColorBrush(Colors.Purple);
     Red         = new ImmutableSolidColorBrush(Colors.Red);
     RosyBrown   = new ImmutableSolidColorBrush(Colors.RosyBrown);
     RoyalBlue   = new ImmutableSolidColorBrush(Colors.RoyalBlue);
     SaddleBrown = new ImmutableSolidColorBrush(Colors.SaddleBrown);
     Salmon      = new ImmutableSolidColorBrush(Colors.Salmon);
     SandyBrown  = new ImmutableSolidColorBrush(Colors.SandyBrown);
     SeaGreen    = new ImmutableSolidColorBrush(Colors.SeaGreen);
     SeaShell    = new ImmutableSolidColorBrush(Colors.SeaShell);
     Sienna      = new ImmutableSolidColorBrush(Colors.Sienna);
     Silver      = new ImmutableSolidColorBrush(Colors.Silver);
     SkyBlue     = new ImmutableSolidColorBrush(Colors.SkyBlue);
     SlateBlue   = new ImmutableSolidColorBrush(Colors.SlateBlue);
     SlateGray   = new ImmutableSolidColorBrush(Colors.SlateGray);
     Snow        = new ImmutableSolidColorBrush(Colors.Snow);
     SpringGreen = new ImmutableSolidColorBrush(Colors.SpringGreen);
     SteelBlue   = new ImmutableSolidColorBrush(Colors.SteelBlue);
     Tan         = new ImmutableSolidColorBrush(Colors.Tan);
     Teal        = new ImmutableSolidColorBrush(Colors.Teal);
     Thistle     = new ImmutableSolidColorBrush(Colors.Thistle);
     Tomato      = new ImmutableSolidColorBrush(Colors.Tomato);
     Transparent = new ImmutableSolidColorBrush(Colors.Transparent);
     Turquoise   = new ImmutableSolidColorBrush(Colors.Turquoise);
     Violet      = new ImmutableSolidColorBrush(Colors.Violet);
     Wheat       = new ImmutableSolidColorBrush(Colors.Wheat);
     White       = new ImmutableSolidColorBrush(Colors.White);
     WhiteSmoke  = new ImmutableSolidColorBrush(Colors.WhiteSmoke);
     Yellow      = new ImmutableSolidColorBrush(Colors.Yellow);
     YellowGreen = new ImmutableSolidColorBrush(Colors.YellowGreen);
 }