private void CreateSpectrum()
        {
            _pickerBrush                        = new LinearGradientBrush();
            _pickerBrush.StartPoint             = new Point(0.5, 0);
            _pickerBrush.EndPoint               = new Point(0.5, 1);
            _pickerBrush.ColorInterpolationMode = ColorInterpolationMode.SRgbLinearInterpolation;

            var colorsList = ColorUtilities.GenerateHsvSpectrum();

            double stopIncrement = (double)1 / (colorsList.Count - 1);

            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;
            if (_spectrumDisplay != null)
            {
                _spectrumDisplay.Fill = _pickerBrush;
            }
        }
示例#2
0
 private string GetFormatedColorString(string stringToFormat)
 {
     return(ColorUtilities.FormatColorString(stringToFormat, UsingAlphaChannel));
 }