Example #1
0
        /// <summary>
        /// Handles the SelectedColorSpaceComponentChanged event raised by the
        /// color spaces. When this occurs, the color slider arrow regions and
        /// the color panels are updated.
        /// </summary>
        /// <param name="sender">The ColorSpace object that raised the event.</param>
        /// <param name="e">An EventArgs containing the event data.</param>

        private void SelectedColorSpaceComponentChanged(ColorSpace sender, EventArgs e)
        {
            if (sender is RgbColorSpace)
            {
                hsbColorSpace.ResetComponents();
            }
            else if (sender is HsbColorSpace)
            {
                rgbColorSpace.ResetComponents();
            }

            m_currentColorSpace = sender;

            UpdateColorSliderArrowRegions();
            UpdateColorPanels(true, true, true);
        }