Beispiel #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="OldValue"></param>
        /// <param name="NewValue"></param>
        protected virtual void OnColorChanged(Color OldValue, Color NewValue)
        {
            if (OldValue != NewValue)
            {
                if (SelectedComponent != null)
                {
                    if (ColorChangeSource == ColorChangeSourceType.ColorPropertySet)
                    {
                        UpdatePlane(SelectedComponent.GetValue(NewValue).Round().ToInt32());

                        SelectionPoint       = SelectedComponent.PointFromColor(NewValue);
                        SelectionTransform.X = SelectionPoint.X - (SelectionPane.PixelWidth / 2.0);
                        SelectionTransform.Y = SelectionPoint.Y - (SelectionPane.PixelHeight / 2.0);

                        PART_Slider.Value = SelectedComponent.GetValue(NewValue);

                        if (!SelectedComponent.IsUniform)
                        {
                            SelectedComponent.UpdateSlider(NormalPane, NewValue);
                        }
                    }
                    if (SelectionRing == ColorSelectorRing.BlackOrWhite)
                    {
                        AdjustRing(NewValue);
                    }
                }
                PART_AlphaSlider.Alpha = NewValue.A;

                ColorChanged?.Invoke(this, new EventArgs <Color>(NewValue));
            }
        }