예제 #1
0
        private void m_ctrl_ThinBox_SelectionChanged(object sender, System.EventArgs e)
        {
            _hsl  = m_ctrl_ThinBox.HSB;
            _rgb  = AdobeColors.HSB_to_RGB(_hsl);
            _cmyk = AdobeColors.RGB_to_CMYK(_rgb);

            UpdateTextBoxes();

            m_ctrl_BigBox.HSB = _hsl;

            m_lbl_Primary_Color.BackColor = _rgb;
            m_lbl_Primary_Color.Update();
        }
예제 #2
0
        private void m_txt_Hex_Leave(object sender, System.EventArgs e)
        {
            string text = m_txt_Hex.Text.ToUpper();
            bool   has_illegal_chars = false;

            if (text.Length <= 0)
            {
                has_illegal_chars = true;
            }
            foreach (char letter in text)
            {
                if (!char.IsNumber(letter))
                {
                    if (letter >= 'A' && letter <= 'F')
                    {
                        continue;
                    }
                    has_illegal_chars = true;
                    break;
                }
            }

            if (has_illegal_chars)
            {
                MessageBox.Show("Hex must be a hex value between 0x000000 and 0xFFFFFF");
                WriteHexData(_rgb);
                return;
            }

            _rgb  = ParseHexData(text);
            _hsl  = AdobeColors.RGB_to_HSB(_rgb);
            _cmyk = AdobeColors.RGB_to_CMYK(_rgb);

            m_ctrl_BigBox.HSB             = _hsl;
            m_ctrl_ThinBox.HSB            = _hsl;
            m_lbl_Primary_Color.BackColor = _rgb;

            UpdateTextBoxes();
        }