private void UpdateVisuals() { if (m_hueMonitor == null) return; Color c = this.SelectedColor; ColorSpace cs = new ColorSpace(); HSV hsv = cs.ConvertRgbToHsv(c); m_huePos = (hsv.Hue / 360 * m_hueMonitor.Height); m_sampleY = -1 * (hsv.Value - 1) * m_colorSample.Height; m_sampleX = hsv.Saturation * m_colorSample.Width; if (!double.IsNaN(m_huePos)) UpdateHueSelection(); UpdateSatValSelection(); }
/// <summary> /// Create a new instance of the ColorPicker control. /// </summary> public ColorPicker() { DefaultStyleKey = typeof(ColorPicker); m_colorSpace = new ColorSpace(); }