public override void UpdateFromLocation(EditorInteraction interaction, CGPoint location) { if (previous == HitTest(location)) { interaction.Color = interaction.ViewModel.InitialColor; } }
public override void UpdateFromModel(EditorInteraction interaction) { LayoutIfNeeded(); current.BackgroundColor = interaction.Color.ToCGColor(); previous.BackgroundColor = interaction.ViewModel.InitialColor.ToCGColor(); last.BackgroundColor = interaction.LastColor.ToCGColor(); }
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); }
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); }
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);
public override void Commit(EditorInteraction interaction) { interaction.ViewModel.CommitLastColor(); }