Exemple #1
0
 // For RGB
 private void trackBarBlue_Scroll(object sender, EventArgs e)
 {
     //RGB
     panel1.BackColor = System.Drawing.Color.FromArgb
                            (trackBarRed.Value, trackBarGreen.Value, trackBarBlue.Value);
     textBoxBlue.Text = trackBarBlue.Value.ToString();
     //CMY
     textBoxYellow.Text   = TransformationCMY.getCMYbyRGB(textBoxBlue.Text);
     trackBarYellow.Value = TransformationCMY.reSizeCMY(textBoxYellow.Text);
     //HLS
     setHLS();
     //Lu'v'
     setLUV();
 }
Exemple #2
0
        // For CMY
        private void setCMYFromRGB()
        {
            TransformationHLStoRGB trans = new TransformationHLStoRGB(textBoxHue.Text,
                                                                      textBoxLightness.Text, textBoxSaturation.Text);

            trackBarCyan.Scroll    -= trackBarCyan_Scroll;
            trackBarMagenta.Scroll -= trackBarMagenta_Scroll;
            trackBarYellow.Scroll  -= trackBarYellow_Scroll;

            textBoxCyan.Text      = TransformationCMY.getCMYbyRGB(textBoxRed.Text);
            textBoxMagenta.Text   = TransformationCMY.getCMYbyRGB(textBoxGreen.Text);
            textBoxYellow.Text    = TransformationCMY.getCMYbyRGB(textBoxBlue.Text);
            trackBarCyan.Value    = TransformationCMY.reSizeCMY(textBoxCyan.Text);
            trackBarMagenta.Value = TransformationCMY.reSizeCMY(textBoxMagenta.Text);
            trackBarYellow.Value  = TransformationCMY.reSizeCMY(textBoxYellow.Text);

            trackBarCyan.Scroll    += trackBarCyan_Scroll;
            trackBarMagenta.Scroll += trackBarMagenta_Scroll;
            trackBarYellow.Scroll  += trackBarYellow_Scroll;
        }
Exemple #3
0
        // For RGB
        private void textBoxBlue_TextChanged(object sender, EventArgs e)
        {
            String count = getSimpleStringRGB(textBoxBlue.Text);
            int    value = 0;

            if (count.Length != 0)
            {
                value = Convert.ToInt32(count);
            }
            textBoxBlue.Text   = count;
            trackBarBlue.Value = value;
            panel1.BackColor   = System.Drawing.Color.FromArgb
                                     (trackBarRed.Value, trackBarGreen.Value, trackBarBlue.Value);

            //CMY
            textBoxYellow.Text   = TransformationCMY.getCMYbyRGB(textBoxBlue.Text);
            trackBarYellow.Value = TransformationCMY.reSizeCMY(textBoxYellow.Text);
            //HLS
            setHLS();
            //Lu'v'
            setLUV();
        }