public void Updateb(double L, double a, double b, bool instantTransition) { if (!ColorPicker.TransitionsDisabled) { if (instantTransition) { this.LABTransition.Easing = new InstantEasing(); } else { this.LABTransition.Easing = new LinearEasing(); } } this.ColorComponent = ColorPicker.ColorComponents.B; LAB newValue = new LAB(L, a, b); if (this.LAB.L != newValue.L || this.LAB.a != newValue.a || this.LAB.b != newValue.b) { this.LAB = newValue; if (instantTransition) { Update(ColorPicker.ColorSpaces.LAB); } } else { Update(ColorPicker.ColorSpaces.LAB); } }
public void Update(double L, double a, double b, Lab.LabComponents labComponent, bool instantTransition) { if (!ColorPicker.TransitionsDisabled) { if (instantTransition) { this.Transition.Easing = new InstantEasing(); } else { this.Transition.Easing = new LinearEasing(); } } this.LabComponent = labComponent; if (this.LAB.L != L || this.LAB.a != a || this.LAB.b != b) { this.LAB = new LAB(L, a, b); } else { Update(L, a, b); } }
protected override void OnPropertyChanged <T>(AvaloniaPropertyChangedEventArgs <T> change) { base.OnPropertyChanged(change); if (change.Property == LABProperty) { LAB lab = (change.NewValue.Value as LAB?).Value; double L = lab.L; double a = lab.a; double b = lab.b; Update(L, a, b); } }
public AnimatableLABCanvas(double L, double a, double b, Lab.LabComponents labComponent) { LabImage = new Image() { Width = 96, Height = 96 }; PositionEllipse = new Ellipse(); LabComponent = labComponent; this.LAB = new LAB(L, a, b); if (!ColorPicker.TransitionsDisabled) { this.Transitions = new Transitions(); this.Transition = new LABTransition() { Property = LABProperty, Duration = new TimeSpan(0, 0, 0, 0, 100) }; this.Transitions.Add(Transition); } }