private void lightSourceColorPictureBox_Click(object sender, EventArgs e)
 {
     if (colorDialog1.ShowDialog() == DialogResult.OK)
     {
         Color color = colorDialog1.Color;
         (sender as PictureBox).BackColor = color;
         PaintingManager.SetLightColor(color);
         this.DrawNewPicture();
     }
 }
        private void CheckRadioButtonsAndDrawNewPicture()
        {
            PaintingManager.SetLightColor(lightSourceColorPictureBox.BackColor);

            if (ConstantObjectRadioButton.Checked)
            {
                PaintingManager.SetBaseObject(constantObjectColorPictureBox.BackColor);
            }
            else
            {
                PaintingManager.SetBaseObject(textureObjectPictureBox.Image as Bitmap);
            }

            if (constantNormalVectorRadioButton.Checked)
            {
                PaintingManager.SetNormalVector(new Vector3(0, 0, 1));
            }
            else
            {
                PaintingManager.SetNormalVector(textureVectorPictureBox.Image as Bitmap);
            }

            if (noDisorderRadioButton.Checked)
            {
                PaintingManager.SetDisorder(new Vector3(0, 0, 0));
            }
            else
            {
                PaintingManager.SetDisorder(textureDisoderPictureBox.Image as Bitmap, fDisorderTextbox.Text);
            }

            if (constantLightSourceVectorRadioButton.Checked)
            {
                timer.Stop();
                PaintingManager.SetLightVector(new Vector3(0, 0, 1), true);
            }
            else
            {
                if (!int.TryParse(radiusLightSourceVectorTextBox.Text, out int radius))
                {
                    return;
                }
                PaintingManager.SetLightVector(new Vector3(radius, 0, 0), false);
                timer.Start();
            }

            PaintingManager.SetLights(redLightToolStripMenuItem.Checked, greenLightToolStripMenuItem.Checked, blueLightToolStripMenuItem.Checked);

            this.DrawNewPicture();
        }