コード例 #1
0
        private void UpdateFromRGB()
        {
            int r = GetInt(redTextBox);
            int g = GetInt(greenTextBox);
            int b = GetInt(blueTextBox);

            rgbColor = Color.FromArgb(r, g, b);
            hslColor = HSColor.RGB2HSL(rgbColor);
            SetHSLTextBoxes();
            SetGraphics();
            SetColorPanel();
        }
コード例 #2
0
        /// <summary>
        ///     Set current selected color.
        /// </summary>
        /// <param name="color">Current color.</param>
        /// <returns><c>True</c>.</returns>
        public override bool SetColor(Color color)
        {
            setting++;
            alphaNud.Value = (decimal)color.A;
            setting--;

            rgbColor = Color.FromArgb(255, color);
            hslColor = HSColor.RGB2HSL(rgbColor);
            SetRGBTextBoxes();
            SetHSLTextBoxes();
            SetGraphics();
            SetColorPanel();
            return(true);
        }