private void OnColorChanged(ColorHSV h) { var c = h.ToRGB(); c.A = 255; OnColorChanged(c, h); }
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; } }; }
private void OnColorChanged(ColorHSV h) { var c = h.ToRGB(); c = ColorStorage.CreateColor(c.R, c.G, c.B, 255); OnColorChanged(c, h); }