/// <summary> /// Creates the spectrum. /// </summary> private void CreateSpectrum() { _pickerBrush = new LinearGradientBrush(); _pickerBrush.StartPoint = new Point(0.5, 0); _pickerBrush.EndPoint = new Point(0.5, 1); _pickerBrush.ColorInterpolationMode = ColorInterpolationMode.SRgbLinearInterpolation; List <Color> colorsList = ColorUtilities.GenerateHsvSpectrum(); double stopIncrement = (double)1 / colorsList.Count; int i; for (i = 0; i < colorsList.Count; i++) { _pickerBrush.GradientStops.Add(new GradientStop(colorsList[i], i * stopIncrement)); } _pickerBrush.GradientStops[i - 1].Offset = 1.0; _spectrumDisplay.Fill = _pickerBrush; }