示例#1
0
        /// <summary>
        /// Update the color hue and saturation from the position of the color picker.
        /// </summary>
        private void UpdateColorPicker()
        {
            colorHSB.Hue        = ((Canvas.GetLeft(ColorPickPointer) - Canvas.GetLeft(ColorMapImage)) / 255) * 360;
            colorHSB.Saturation = 1 - ((Canvas.GetTop(ColorPickPointer) - Canvas.GetTop(ColorMapImage)) / 255);

            UpdateGradient(ColorHSB.HSBtoRGB(colorHSB.Hue, colorHSB.Saturation, 1));
        }
示例#2
0
        /// <summary>
        /// Update the selected color to the preview box.
        /// </summary>
        private void UpdateColor()
        {
            selectedColor = ColorHSB.HSBtoRGB(colorHSB.Hue, colorHSB.Saturation, colorHSB.Brightness);

            ColorPreviewBox.Background = GetBrush();
        }