コード例 #1
0
 public override void UpdateFromLocation(EditorInteraction interaction, CGPoint location)
 {
     if (previous == HitTest(location))
     {
         interaction.Color = interaction.ViewModel.InitialColor;
     }
 }
コード例 #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();
 }
コード例 #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);
        }
コード例 #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);
        }
コード例 #5
0
 public override void Commit(EditorInteraction interaction)
 {
 }
コード例 #6
0
 abstract public void UpdateFromLocation(EditorInteraction interaction, CGPoint location);
コード例 #7
0
 abstract public void UpdateFromModel(EditorInteraction interaction);
コード例 #8
0
 abstract public void Commit(EditorInteraction interaction);
コード例 #9
0
 public override void Commit(EditorInteraction interaction)
 {
     interaction.ViewModel.CommitLastColor();
 }