Exemplo n.º 1
0
        //LabMode currentLabMode = LabMode.CIE;
        private void buttonChangeLab_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.setColorByLab(lynxUpDownLab_L.DoubleValue, lynxUpDownLab_a.DoubleValue, lynxUpDownLab_b.DoubleValue, pt.CurrentLabMode);

            Color sc = lc.getColor();

            rectangleS.Fill = new SolidColorBrush(sc);
            ShowSourceInfor(sc);
            ShowTrueColorDiffrent(cc, sc);
            if (currentImage != null)
            {
                currentImage.Tag = sc;//变更其理论颜色
            }
        }
Exemplo n.º 2
0
        private void buttonLab2_Click(object sender, RoutedEventArgs e)
        {
            LColor lc = new LColor();

            lc.setColorByLab(Convert.ToDouble(textLab_L.Text), Convert.ToDouble(textLab_a.Text), Convert.ToDouble(textLab_b.Text), getCurrentLabMode());
            //lc.Lab_L = Convert.ToDouble(textLab_L.Text);
            //lc.Lab_a = Convert.ToDouble(textLab_a.Text);
            //lc.Lab_b = Convert.ToDouble(textLab_b.Text);
            //_color = DCTestLibrary.ColorManager.Lab2RGB(lc);
            //LColor lc2 = DCTestLibrary.ColorManager.RGB2HSB(_color);
            //LColor lc1 = DCTestLibrary.ColorManager.Lab2RGB(_color);
            textRGB_R.Text = _color.R.ToString();
            textRGB_G.Text = _color.G.ToString();
            textRGB_B.Text = _color.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).ToString();
            //textLab_a.Text = DCTestLibrary.ColorManager.getLaba(_color).ToString();
            //textLab_b.Text = DCTestLibrary.ColorManager.getLabb(_color).ToString();
        }