예제 #1
0
        private void OnColorChanged(ColorHSV h)
        {
            var c = h.ToRGB();

            c.A = 255;
            OnColorChanged(c, h);
        }
예제 #2
0
        private void SubscribeHSV(SpinButton spinButton, Slider slider)
        {
            spinButton.Tag = false;
            slider.Tag     = false;

            spinButton.ValueChangedByUser += (s, a) =>
            {
                if (spinButton.Value == null)
                {
                    return;
                }

                try
                {
                    spinButton.Tag = true;

                    var hsv = new ColorHSV
                    {
                        H = (int)_sliderH.Value,
                        S = (int)_sliderS.Value,
                        V = (int)_sliderV.Value
                    };
                    SetHSV(hsv);

                    _suppressHSV = true;
                    var rgb = hsv.ToRGB();
                    Color = new Color(rgb.R, rgb.G, rgb.B, Color.A);
                }
                finally
                {
                    spinButton.Tag = false;
                    _suppressHSV   = false;
                }
            };

            slider.ValueChangedByUser += (s, a) =>
            {
                try
                {
                    slider.Tag = true;

                    var hsv = new ColorHSV
                    {
                        H = (int)_sliderH.Value,
                        S = (int)_sliderS.Value,
                        V = (int)_sliderV.Value
                    };
                    SetHSV(hsv);

                    _suppressHSV = true;
                    var rgb = hsv.ToRGB();
                    Color = new Color(rgb.R, rgb.G, rgb.B, Color.A);
                }
                finally
                {
                    slider.Tag   = false;
                    _suppressHSV = false;
                }
            };
        }
예제 #3
0
        private void OnColorChanged(ColorHSV h)
        {
            var c = h.ToRGB();

            c = ColorStorage.CreateColor(c.R, c.G, c.B, 255);
            OnColorChanged(c, h);
        }