Explorar el Código

It builds, somehow

Equbuxu hace 4 años
padre
commit
89ef6cef27

+ 4 - 5
PixiEditor/Helpers/Extensions/ParserHelpers.cs

@@ -2,12 +2,12 @@
 using PixiEditor.Models.Layers;
 using PixiEditor.Parser;
 using PixiEditor.Parser.Models;
+using SkiaSharp;
 using System;
 using System.Collections.ObjectModel;
+using System.Drawing;
 using System.Linq;
 using System.Windows;
-using System.Windows.Media;
-using SDColor = System.Drawing.Color;
 
 namespace PixiEditor.Helpers.Extensions
 {
@@ -18,8 +18,7 @@ namespace PixiEditor.Helpers.Extensions
             Document document = new Document(serializableDocument.Width, serializableDocument.Height)
             {
                 Layers = serializableDocument.ToLayers(),
-                Swatches = new ObservableCollection<Color>(serializableDocument.Swatches.Select(x =>
-                    Color.FromArgb(x.A, x.R, x.G, x.B)))
+                Swatches = new ObservableCollection<SKColor>(serializableDocument.Swatches.Select(x => new SKColor(x.R, x.G, x.B, x.A)))
             };
 
             document.LayerStructure.Groups = serializableDocument.ToGroups();
@@ -70,7 +69,7 @@ namespace PixiEditor.Helpers.Extensions
                 Height = document.Height,
                 Layers = document.Layers.Select(x => x.ToSerializable()).ToList(),
                 Groups = document.LayerStructure.Groups.Select(x => x.ToSerializable()).ToArray(),
-                Swatches = document.Swatches.Select(x => SDColor.FromArgb(x.A, x.R, x.G, x.B)).ToList()
+                Swatches = document.Swatches.Select(x => Color.FromArgb(x.Alpha, x.Red, x.Green, x.Blue)).ToList()
             };
 
             return serializable;

+ 0 - 42
PixiEditor/Helpers/LayerBitmapContext.cs

@@ -1,42 +0,0 @@
-using PixiEditor.Models.Layers;
-using System;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-
-namespace PixiEditor.Helpers
-{
-    class LayerBitmapContext : IDisposable
-    {
-        public static Color Premultiply(Color c)
-        {
-            float fraction = c.A / 255f;
-            return Color.FromArgb(c.A, (byte)Math.Round(c.R * fraction), (byte)Math.Round(c.G * fraction), (byte)Math.Round(c.B * fraction));
-        }
-
-        private Layer layer;
-        private BitmapContext ctx;
-        public LayerBitmapContext(Layer layer)
-        {
-            this.layer = layer;
-            //ctx = layer.LayerBitmap.GetBitmapContext();
-        }
-
-        public void Dispose() => ctx.Dispose();
-
-        public bool IsPixelMatching(int x, int y, Color premult)
-        {
-            int realX = x - layer.OffsetX;
-            int realY = y - layer.OffsetY;
-
-            if (realX < 0 || realY < 0 || realX >= ctx.Width || realY >= ctx.Height)
-                return premult.A == 0;
-
-            unsafe
-            {
-                int pos = (realY * ctx.Width + realX) * 4;
-                byte* pixels = (byte*)ctx.Pixels;
-                return pixels[pos] == premult.B && pixels[pos + 1] == premult.G && pixels[pos + 2] == premult.R && pixels[pos + 3] == premult.A;
-            }
-        }
-    }
-}

+ 8 - 7
PixiEditor/Models/Controllers/PixelChangesController.cs

@@ -1,7 +1,8 @@
-using System;
+using PixiEditor.Models.DataHolders;
+using SkiaSharp;
+using System;
 using System.Collections.Generic;
 using System.Linq;
-using PixiEditor.Models.DataHolders;
 
 namespace PixiEditor.Models.Controllers
 {
@@ -52,9 +53,9 @@ namespace PixiEditor.Models.Controllers
             int i = 0;
             foreach (KeyValuePair<Guid, LayerChange> change in LastChanges)
             {
-                Dictionary<Position.Coordinates, System.Windows.Media.Color> pixelChanges =
+                Dictionary<Position.Coordinates, SKColor> pixelChanges =
                     change.Value.PixelChanges.ChangedPixels.ToDictionary(entry => entry.Key, entry => entry.Value);
-                Dictionary<Position.Coordinates, System.Windows.Media.Color> oldValues = LastOldValues[change.Key].PixelChanges.ChangedPixels
+                Dictionary<Position.Coordinates, SKColor> oldValues = LastOldValues[change.Key].PixelChanges.ChangedPixels
                     .ToDictionary(entry => entry.Key, entry => entry.Value);
 
                 LayerChange tmp = new LayerChange(new BitmapPixelChanges(pixelChanges), change.Key);
@@ -77,7 +78,7 @@ namespace PixiEditor.Models.Controllers
 
         private void AddToExistingLayerChange(LayerChange layerChange, LayerChange oldValues)
         {
-            foreach (KeyValuePair<Position.Coordinates, System.Windows.Media.Color> change in layerChange.PixelChanges.ChangedPixels)
+            foreach (KeyValuePair<Position.Coordinates, SKColor> change in layerChange.PixelChanges.ChangedPixels)
             {
                 if (LastChanges[layerChange.LayerGuid].PixelChanges.ChangedPixels.ContainsKey(change.Key))
                 {
@@ -89,7 +90,7 @@ namespace PixiEditor.Models.Controllers
                 }
             }
 
-            foreach (KeyValuePair<Position.Coordinates, System.Windows.Media.Color> change in oldValues.PixelChanges.ChangedPixels)
+            foreach (KeyValuePair<Position.Coordinates, SKColor> change in oldValues.PixelChanges.ChangedPixels)
             {
                 if (LastOldValues[layerChange.LayerGuid].PixelChanges.ChangedPixels.ContainsKey(change.Key))
                 {
@@ -102,4 +103,4 @@ namespace PixiEditor.Models.Controllers
             }
         }
     }
-}
+}

+ 1 - 1
PixiEditor/Models/DataHolders/Document/Document.Layers.cs

@@ -209,7 +209,7 @@ namespace PixiEditor.Models.DataHolders
 
         public void AddNewLayer(string name, bool setAsActive = true)
         {
-            AddNewLayer(name, 0, 0, setAsActive);
+            AddNewLayer(name, 1, 1, setAsActive);
         }
 
         public void AddNewLayer(string name, int width, int height, bool setAsActive = true)

+ 2 - 2
PixiEditor/Models/DataHolders/Document/Document.cs

@@ -5,6 +5,7 @@ using PixiEditor.Models.Layers;
 using PixiEditor.Models.Position;
 using PixiEditor.Models.Undo;
 using PixiEditor.ViewModels;
+using SkiaSharp;
 using System;
 using System.Buffers;
 using System.Collections.Generic;
@@ -13,7 +14,6 @@ using System.Diagnostics;
 using System.IO;
 using System.Linq;
 using System.Windows;
-using System.Windows.Media;
 
 namespace PixiEditor.Models.DataHolders
 {
@@ -107,7 +107,7 @@ namespace PixiEditor.Models.DataHolders
 
         public UndoManager UndoManager { get; set; }
 
-        public ObservableCollection<Color> Swatches { get; set; } = new ObservableCollection<Color>();
+        public ObservableCollection<SKColor> Swatches { get; set; } = new ObservableCollection<SKColor>();
 
         public void RaisePropertyChange(string name)
         {

+ 11 - 11
PixiEditor/Models/DataHolders/Selection.cs

@@ -1,26 +1,26 @@
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Diagnostics;
-using System.Linq;
-using System.Windows.Media;
-using PixiEditor.Helpers;
+using PixiEditor.Helpers;
 using PixiEditor.Models.Enums;
 using PixiEditor.Models.Layers;
 using PixiEditor.Models.Position;
+using SkiaSharp;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Diagnostics;
+using System.Linq;
 
 namespace PixiEditor.Models.DataHolders
 {
     [DebuggerDisplay("{SelectedPoints.Count} selected Pixels")]
     public class Selection : NotifyableObject
     {
-        private readonly Color selectionBlue;
+        private readonly SKColor selectionBlue;
         private Layer selectionLayer;
 
         public Selection(Coordinates[] selectedPoints)
         {
             SelectedPoints = new ObservableCollection<Coordinates>(selectedPoints);
             SelectionLayer = new Layer("_selectionLayer");
-            selectionBlue = Color.FromArgb(127, 142, 202, 255);
+            selectionBlue = new SKColor(142, 202, 255, 127);
         }
 
         public ObservableCollection<Coordinates> SelectedPoints { get; private set; }
@@ -37,7 +37,7 @@ namespace PixiEditor.Models.DataHolders
 
         public void SetSelection(IEnumerable<Coordinates> selection, SelectionType mode)
         {
-            Color selectionColor = selectionBlue;
+            SKColor selectionColor = selectionBlue;
             switch (mode)
             {
                 case SelectionType.New:
@@ -49,7 +49,7 @@ namespace PixiEditor.Models.DataHolders
                     break;
                 case SelectionType.Subtract:
                     SelectedPoints = new ObservableCollection<Coordinates>(SelectedPoints.Except(selection));
-                    selectionColor = System.Windows.Media.Colors.Transparent;
+                    selectionColor = SKColors.Transparent;
                     break;
             }
 
@@ -62,4 +62,4 @@ namespace PixiEditor.Models.DataHolders
             SelectedPoints.Clear();
         }
     }
-}
+}

+ 11 - 1
PixiEditor/Models/DataHolders/Surface.cs

@@ -21,6 +21,8 @@ namespace PixiEditor.Models.DataHolders
 
         public Surface(int w, int h)
         {
+            if (w <= 0 || h <= 0)
+                throw new ArgumentException("Surface dimensions must be non-zero");
             SkiaSurface = CreateSurface(w, h);
             Width = w;
             Height = h;
@@ -37,6 +39,8 @@ namespace PixiEditor.Models.DataHolders
 
         public Surface(int w, int h, byte[] pbgra32Bytes)
         {
+            if (w <= 0 || h <= 0)
+                throw new ArgumentException("Surface dimensions must be non-zero");
             Width = w;
             Height = h;
             SkiaSurface = Pbgra32BytesToSkSurface(w, h, pbgra32Bytes);
@@ -46,6 +50,9 @@ namespace PixiEditor.Models.DataHolders
         {
             if (original.Format != PixelFormats.Pbgra32)
                 throw new ArgumentException("This method only supports Pbgra32 bitmaps");
+            if (original.PixelWidth <= 0 || original.PixelHeight <= 0)
+                throw new ArgumentException("Surface dimensions must be non-zero");
+
             byte[] pixels = new byte[original.PixelWidth * original.PixelHeight * 4];
             original.CopyPixels(pixels, original.PixelWidth * 4, 0);
 
@@ -157,7 +164,10 @@ namespace PixiEditor.Models.DataHolders
 
         private static SKSurface CreateSurface(int w, int h)
         {
-            return SKSurface.Create(new SKImageInfo(w, h, SKColorType.RgbaF16, SKAlphaType.Premul, SKColorSpace.CreateSrgb()));
+            var surface = SKSurface.Create(new SKImageInfo(w, h, SKColorType.RgbaF16, SKAlphaType.Premul, SKColorSpace.CreateSrgb()));
+            if (surface == null)
+                throw new Exception("Could not create surface");
+            return surface;
         }
 
     }

+ 4 - 4
PixiEditor/Models/ImageManipulation/BitmapUtils.cs

@@ -103,13 +103,13 @@ namespace PixiEditor.Models.ImageManipulation
                 maxPreviewHeight);
         }
 
-        public static Dictionary<Guid, Color[]> GetPixelsForSelection(Layer[] layers, Coordinates[] selection)
+        public static Dictionary<Guid, SKColor[]> GetPixelsForSelection(Layer[] layers, Coordinates[] selection)
         {
-            Dictionary<Guid, Color[]> result = new();
+            Dictionary<Guid, SKColor[]> result = new();
 
             foreach (Layer layer in layers)
             {
-                Color[] pixels = new Color[selection.Length];
+                SKColor[] pixels = new SKColor[selection.Length];
 
                 for (int j = 0; j < pixels.Length; j++)
                 {
@@ -121,7 +121,7 @@ namespace PixiEditor.Models.ImageManipulation
                     }
 
                     var cl = layer.GetPixel(position.X, position.Y);
-                    pixels[j] = Color.FromArgb(cl.Alpha, cl.Red, cl.Green, cl.Blue);
+                    pixels[j] = cl;
                 }
                 result[layer.LayerGuid] = pixels;
             }

+ 6 - 6
PixiEditor/Models/Tools/Tools/ColorPickerTool.cs

@@ -1,9 +1,9 @@
+using PixiEditor.Models.Position;
+using PixiEditor.ViewModels;
+using SkiaSharp;
 using System.Collections.Generic;
 using System.Drawing;
 using System.Windows.Input;
-using PixiEditor.Models.Position;
-using PixiEditor.ViewModels;
-using Color = System.Windows.Media.Color;
 
 namespace PixiEditor.Models.Tools.Tools
 {
@@ -29,7 +29,7 @@ namespace PixiEditor.Models.Tools.Tools
             ViewModelMain.Current.ColorsSubViewModel.PrimaryColor = GetColorUnderMouse();
         }
 
-        public Color GetColorUnderMouse()
+        public SKColor GetColorUnderMouse()
         {
             System.Drawing.Color color;
             using (Bitmap bitmap = new Bitmap(1, 1))
@@ -42,7 +42,7 @@ namespace PixiEditor.Models.Tools.Tools
                 color = bitmap.GetPixel(0, 0);
             }
 
-            return Color.FromArgb(color.A, color.R, color.G, color.B);
+            return new SKColor(color.R, color.G, color.B, color.A);
         }
     }
-}
+}

+ 18 - 23
PixiEditor/Models/Tools/Tools/FloodFill.cs

@@ -1,11 +1,10 @@
-using PixiEditor.Helpers;
-using PixiEditor.Models.Controllers;
+using PixiEditor.Models.Controllers;
 using PixiEditor.Models.DataHolders;
 using PixiEditor.Models.Layers;
 using PixiEditor.Models.Position;
+using SkiaSharp;
 using System.Collections.Generic;
 using System.Diagnostics;
-using System.Windows.Media;
 
 namespace PixiEditor.Models.Tools.Tools
 {
@@ -22,7 +21,7 @@ namespace PixiEditor.Models.Tools.Tools
 
         public override string Tooltip => "Fills area with color. (G)";
 
-        public override LayerChange[] Use(Layer layer, List<Coordinates> coordinates, Color color)
+        public override LayerChange[] Use(Layer layer, List<Coordinates> coordinates, SKColor color)
         {
             Stopwatch sw = new Stopwatch();
             sw.Start();
@@ -32,12 +31,12 @@ namespace PixiEditor.Models.Tools.Tools
             return res;
         }
 
-        public BitmapPixelChanges LinearFill(Layer layer, Coordinates startingCoords, Color newColor)
+        public BitmapPixelChanges LinearFill(Layer layer, Coordinates startingCoords, SKColor newColor)
         {
             List<Coordinates> changedCoords = new List<Coordinates>();
             Queue<FloodFillRange> floodFillQueue = new Queue<FloodFillRange>();
-            Color colorToReplace = layer.GetPixelWithOffset(startingCoords.X, startingCoords.Y);
-            if ((colorToReplace.A == 0 && newColor.A == 0) ||
+            SKColor colorToReplace = layer.GetPixelWithOffset(startingCoords.X, startingCoords.Y);
+            if ((colorToReplace.Alpha == 0 && newColor.Alpha == 0) ||
                 colorToReplace == newColor)
                 return BitmapPixelChanges.Empty;
 
@@ -47,20 +46,16 @@ namespace PixiEditor.Models.Tools.Tools
                 return BitmapPixelChanges.Empty;
             var visited = new bool[width * height];
 
-            using (LayerBitmapContext ctx = new LayerBitmapContext(layer))
-            {
-                Color premult = LayerBitmapContext.Premultiply(colorToReplace);
-                PerformLinearFill(ctx, changedCoords, floodFillQueue, startingCoords, width, ref premult, visited);
-                PerformFloodFIll(ctx, changedCoords, floodFillQueue, ref premult, width, height, visited);
-            }
+            PerformLinearFill(layer, changedCoords, floodFillQueue, startingCoords, width, colorToReplace, visited);
+            PerformFloodFIll(layer, changedCoords, floodFillQueue, colorToReplace, width, height, visited);
 
             return BitmapPixelChanges.FromSingleColoredArray(changedCoords, newColor);
         }
 
         private void PerformLinearFill(
-            LayerBitmapContext layer,
+            Layer layer,
             List<Coordinates> changedCoords, Queue<FloodFillRange> floodFillQueue,
-            Coordinates coords, int width, ref Color colorToReplace, bool[] visited)
+            Coordinates coords, int width, SKColor colorToReplace, bool[] visited)
         {
             // Find the Left Edge of the Color Area
             int fillXLeft = coords.X;
@@ -76,7 +71,7 @@ namespace PixiEditor.Models.Tools.Tools
                 // Move one pixel to the left
                 fillXLeft--;
                 // Exit the loop if we're at edge of the bitmap or the color area
-                if (fillXLeft < 0 || visited[pixelIndex - 1] || !layer.IsPixelMatching(fillXLeft, coords.Y, colorToReplace))
+                if (fillXLeft < 0 || visited[pixelIndex - 1] || layer.GetPixelWithOffset(fillXLeft, coords.Y) != colorToReplace)
                     break;
             }
             int lastFilledPixelLeft = fillXLeft + 1;
@@ -92,7 +87,7 @@ namespace PixiEditor.Models.Tools.Tools
                 visited[pixelIndex] = true;
 
                 fillXRight++;
-                if (fillXRight >= width || visited[pixelIndex + 1] || !layer.IsPixelMatching(fillXRight, coords.Y, colorToReplace))
+                if (fillXRight >= width || visited[pixelIndex + 1] || layer.GetPixelWithOffset(fillXRight, coords.Y) != colorToReplace)
                     break;
             }
             int lastFilledPixelRight = fillXRight - 1;
@@ -103,9 +98,9 @@ namespace PixiEditor.Models.Tools.Tools
         }
 
         private void PerformFloodFIll(
-            LayerBitmapContext layer,
+            Layer layer,
             List<Coordinates> changedCords, Queue<FloodFillRange> floodFillQueue,
-            ref Color colorToReplace, int width, int height, bool[] pixelsVisited)
+            SKColor colorToReplace, int width, int height, bool[] pixelsVisited)
         {
             while (floodFillQueue.Count > 0)
             {
@@ -120,11 +115,11 @@ namespace PixiEditor.Models.Tools.Tools
                 {
                     //START LOOP UPWARDS
                     //if we're not above the top of the bitmap and the pixel above this one is within the color tolerance
-                    if (range.Y > 0 && (!pixelsVisited[upPixelIndex]) && layer.IsPixelMatching(i, upY, colorToReplace))
-                        PerformLinearFill(layer, changedCords, floodFillQueue, new Coordinates(i, upY), width, ref colorToReplace, pixelsVisited);
+                    if (range.Y > 0 && (!pixelsVisited[upPixelIndex]) && layer.GetPixelWithOffset(i, upY) == colorToReplace)
+                        PerformLinearFill(layer, changedCords, floodFillQueue, new Coordinates(i, upY), width, colorToReplace, pixelsVisited);
                     //START LOOP DOWNWARDS
-                    if (range.Y < (height - 1) && (!pixelsVisited[downPixelxIndex]) && layer.IsPixelMatching(i, downY, colorToReplace))
-                        PerformLinearFill(layer, changedCords, floodFillQueue, new Coordinates(i, downY), width, ref colorToReplace, pixelsVisited);
+                    if (range.Y < (height - 1) && (!pixelsVisited[downPixelxIndex]) && layer.GetPixel(i, downY) == colorToReplace)
+                        PerformLinearFill(layer, changedCords, floodFillQueue, new Coordinates(i, downY), width, colorToReplace, pixelsVisited);
                     downPixelxIndex++;
                     upPixelIndex++;
                 }

+ 2 - 2
PixiEditor/Models/Tools/Tools/MagicWandTool.cs

@@ -8,7 +8,7 @@ using PixiEditor.Models.Layers;
 using PixiEditor.Models.Position;
 using PixiEditor.Models.Tools.ToolSettings.Toolbars;
 using PixiEditor.ViewModels;
-using System;
+using SkiaSharp;
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
 using System.Windows.Input;
@@ -60,7 +60,7 @@ namespace PixiEditor.Models.Tools.Tools
                 floodFill.LinearFill(
                     layer,
                     new Coordinates((int)document.MouseXOnCanvas, (int)document.MouseYOnCanvas),
-                    System.Windows.Media.Colors.White
+                    SKColors.White
                     ).ChangedPixels.Keys,
                 selectionType);
 

+ 12 - 12
PixiEditor/ViewModels/SubViewModels/Main/ColorsViewModel.cs

@@ -1,6 +1,6 @@
-using System;
-using System.Windows.Media;
-using PixiEditor.Helpers;
+using PixiEditor.Helpers;
+using SkiaSharp;
+using System;
 
 namespace PixiEditor.ViewModels.SubViewModels.Main
 {
@@ -12,9 +12,9 @@ namespace PixiEditor.ViewModels.SubViewModels.Main
 
         public RelayCommand RemoveSwatchCommand { get; set; }
 
-        private Color primaryColor = Colors.Black;
+        private SKColor primaryColor = SKColors.Black;
 
-        public Color PrimaryColor // Primary color, hooked with left mouse button
+        public SKColor PrimaryColor // Primary color, hooked with left mouse button
         {
             get => primaryColor;
             set
@@ -28,9 +28,9 @@ namespace PixiEditor.ViewModels.SubViewModels.Main
             }
         }
 
-        private Color secondaryColor = Colors.White;
+        private SKColor secondaryColor = SKColors.White;
 
-        public Color SecondaryColor
+        public SKColor SecondaryColor
         {
             get => secondaryColor;
             set
@@ -58,7 +58,7 @@ namespace PixiEditor.ViewModels.SubViewModels.Main
             SecondaryColor = tmp;
         }
 
-        public void AddSwatch(Color color)
+        public void AddSwatch(SKColor color)
         {
             if (!Owner.BitmapManager.ActiveDocument.Swatches.Contains(color))
             {
@@ -68,12 +68,12 @@ namespace PixiEditor.ViewModels.SubViewModels.Main
 
         private void RemoveSwatch(object parameter)
         {
-            if (!(parameter is Color))
+            if (!(parameter is SKColor))
             {
                 throw new ArgumentException();
             }
 
-            Color color = (Color)parameter;
+            SKColor color = (SKColor)parameter;
             if (Owner.BitmapManager.ActiveDocument.Swatches.Contains(color))
             {
                 Owner.BitmapManager.ActiveDocument.Swatches.Remove(color);
@@ -82,7 +82,7 @@ namespace PixiEditor.ViewModels.SubViewModels.Main
 
         private void SelectColor(object parameter)
         {
-            PrimaryColor = parameter as Color? ?? throw new ArgumentException();
+            PrimaryColor = parameter as SKColor? ?? throw new ArgumentException();
         }
     }
-}
+}

+ 11 - 8
PixiEditor/Views/UserControls/ToolSettingColorPicker.xaml.cs

@@ -1,10 +1,9 @@
-using System.Windows;
+using PixiEditor.Helpers;
+using PixiEditor.ViewModels;
+using SkiaSharp;
+using System.Windows;
 using System.Windows.Controls;
-using System.Windows.Data;
 using System.Windows.Media;
-using ColorPicker;
-using PixiEditor.Helpers;
-using PixiEditor.ViewModels;
 
 namespace PixiEditor.Views
 {
@@ -14,7 +13,7 @@ namespace PixiEditor.Views
     public partial class ToolSettingColorPicker : UserControl
     {
         public static readonly DependencyProperty SelectedColorProperty =
-            DependencyProperty.Register(nameof(SelectedColor), typeof(Color), typeof(ToolSettingColorPicker));
+            DependencyProperty.Register(nameof(SelectedColor), typeof(SKColor), typeof(ToolSettingColorPicker));
 
         public Color SelectedColor
         {
@@ -44,7 +43,11 @@ namespace PixiEditor.Views
 
         public void CopyMainColor(object parameter)
         {
-            SelectedColor = ViewModelMain.Current.ColorsSubViewModel.PrimaryColor;
+            SelectedColor = Color.FromArgb(
+                ViewModelMain.Current.ColorsSubViewModel.PrimaryColor.Alpha,
+                ViewModelMain.Current.ColorsSubViewModel.PrimaryColor.Red,
+                ViewModelMain.Current.ColorsSubViewModel.PrimaryColor.Green,
+                ViewModelMain.Current.ColorsSubViewModel.PrimaryColor.Blue);
         }
     }
-}
+}