示例#1
0
        private void buttonChangeHSB_Click(object sender, RoutedEventArgs e)
        {
            Color  cc = Color.FromArgb(255, Convert.ToByte(textBlockCurrentGRB_R.Text), Convert.ToByte(textBlockCurrentGRB_G.Text), Convert.ToByte(textBlockCurrentGRB_B.Text));
            LColor lc = new LColor();

            lc.setColorByHSB(lynxUpDownHSB_H.DoubleValue, lynxUpDownHSB_S.DoubleValue, lynxUpDownHSB_B.DoubleValue);

            Color sc = lc.getColor();

            rectangleS.Fill = new SolidColorBrush(sc);
            ShowSourceInfor(sc);
            ShowTrueColorDiffrent(cc, sc);
            if (currentImage != null)
            {
                currentImage.Tag = sc;//变更其理论颜色
            }
        }
        private void buttonHSB2_Click(object sender, RoutedEventArgs e)
        {
            //_color = Color.FromArgb(255, Convert.ToByte(textRGB_R.Text), Convert.ToByte(textRGB_G.Text), Convert.ToByte(textRGB_B.Text));
            LColor lc = new LColor();

            lc.setColorByHSB(Convert.ToDouble(textHSB_H.Text), Convert.ToDouble(textHSB_S.Text), Convert.ToDouble(textHSB_B.Text));
            //lc.HSB_H = Convert.ToDouble(textHSB_H.Text);
            //lc.HSB_S = Convert.ToDouble(textHSB_S.Text);
            //lc.HSB_B = Convert.ToDouble(textHSB_B.Text);
            //_color = DCTestLibrary.ColorManager.HSB2RGB(lc);
            //LColor lc2 = DCTestLibrary.ColorManager.HSB2RGB(_color);
            //LColor lc1 = DCTestLibrary.ColorManager.RGB2HSB(_color);
            textRGB_R.Text = lc.ARGB_R.ToString();
            textRGB_G.Text = lc.ARGB_G.ToString();
            textRGB_B.Text = lc.ARGB_B.ToString();
            //textHSB_H.Text = DCTestLibrary.ColorManager.getHue(_color).ToString();
            //textHSB_S.Text = DCTestLibrary.ColorManager.getSaturation(_color).ToString();
            //textHSB_B.Text = DCTestLibrary.ColorManager.getBrightness(_color).ToString();
            textLab_L.Text = DCTestLibrary.ColorManager.getLabL(_color, getCurrentLabMode()).ToString();
            textLab_a.Text = DCTestLibrary.ColorManager.getLaba(_color, getCurrentLabMode()).ToString();
            textLab_b.Text = DCTestLibrary.ColorManager.getLabb(_color, getCurrentLabMode()).ToString();
        }