Exemplo n.º 1
0
 public override void UpdateFromLocation(EditorInteraction interaction, CGPoint location)
 {
     if (previous == HitTest(location))
     {
         interaction.Color = interaction.ViewModel.InitialColor;
     }
 }
Exemplo n.º 2
0
 public override void UpdateFromModel(EditorInteraction interaction)
 {
     LayoutIfNeeded();
     current.BackgroundColor  = interaction.Color.ToCGColor();
     previous.BackgroundColor = interaction.ViewModel.InitialColor.ToCGColor();
     last.BackgroundColor     = interaction.LastColor.ToCGColor();
 }
Exemplo n.º 3
0
        public override void UpdateFromModel(EditorInteraction interaction)
        {
            LayoutIfNeeded();
            var color = interaction.Color;

            var sat    = this.saturationEditor.LocationFromColor(this.saturationLayer, color);
            var bright = this.brightnessEditor.LocationFromColor(this.brightnessLayer, color);

            var x = sat.X;
            var y = bright.Y + this.saturationLayer.Frame.Y;

            grip.Frame = new CGRect(x - GripRadius, y - GripRadius, GripRadius * 2, GripRadius * 2);

            var hueColor = interaction.Color.HueColor;

            this.saturationEditor.UpdateGradientLayer(this.saturationLayer, hueColor);
        }
Exemplo n.º 4
0
        public override void UpdateFromLocation(EditorInteraction interaction, CGPoint location)
        {
            var loc   = location;
            var frame = saturationLayer.Frame;

            if (interaction.ViewModel == null)
            {
                return;
            }

            var color      = interaction.Color;
            var saturation = this.saturationEditor.ValueFromLocation(this.saturationLayer, loc);
            var brightness = this.saturationEditor.ValueFromLocation(
                this.brightnessLayer,
                new CGPoint(loc.X + brightnessLayer.Frame.X, loc.Y + brightnessLayer.Frame.Y));

            interaction.Color = interaction.Color.UpdateHSB(saturation: saturation, brightness: brightness);
        }
Exemplo n.º 5
0
 public override void Commit(EditorInteraction interaction)
 {
 }
 abstract public void UpdateFromLocation(EditorInteraction interaction, CGPoint location);
 abstract public void UpdateFromModel(EditorInteraction interaction);
 abstract public void Commit(EditorInteraction interaction);
Exemplo n.º 9
0
 public override void Commit(EditorInteraction interaction)
 {
     interaction.ViewModel.CommitLastColor();
 }