protected SingleColorSchemeEditorViewModelBase(IWindowManager windowManager)
            : base(windowManager)
        {
            var random = new Random();

            var hue = random.Next(0, 360);

            var hsl = new Color.HSL(hue, 0.5d, 0.5d);

            CurrentColor = new ColourViewModel {
                Color = hsl.ToRGB().ToSystemColor(255)
            };

            CurrentHue        = hsl.H;
            CurrentSaturation = hsl.S;
            CurrentLuminosity = hsl.L;
        }
Ejemplo n.º 2
0
        public async void Edit(ColourViewModel color)
        {
            var editColourViewModel = new EditColourViewModel(color.Color.FromSystemColor());

            var confirmed = await windowManager.ShowDialogAsync(editColourViewModel, settings : new Dictionary <string, object>
            {
                { "Title", "Edit Color" },
                { "IsPrimaryButtonEnabled", true },
                { "PrimaryButtonText", "save" },
                { "IsSecondaryButtonEnabled", true },
                { "SecondaryButtonText", "cancel" },
                { "FullSizeDesired", false }
            });

            if (!confirmed)
            {
                return;
            }

            color.Color = editColourViewModel.Colour.ToSystemColor(255);
        }
Ejemplo n.º 3
0
 public void Remove(ColourViewModel color)
 {
     Colors.Remove(color);
 }
 public override void SetColors(IEnumerable <Color.RGB> colours)
 {
     CurrentColor = new ColourViewModel {
         Color = colours.ElementAt(2).ToSystemColor(255)
     };
 }