private void CTB_Click(object sender, EventArgs e) { try { if (TACB.SelectedItem.ToString() == "RGB") { CHTB.Text = Colorful.RGBtoHEX(Convert.ToInt32(CRTB.Text), Convert.ToInt32(CGTB.Text), Convert.ToInt32(CBTB.Text)); } else { CRTB.Text = Colorful.HEXtoRGB(CHTB.Text, Enums.ColorType.OnlyR); CGTB.Text = Colorful.HEXtoRGB(CHTB.Text, Enums.ColorType.OnlyG); CBTB.Text = Colorful.HEXtoRGB(CHTB.Text, Enums.ColorType.OnlyB); } } catch { // } }
private void Button11_Click(object sender, EventArgs e) { try { ComboBox(); if (Selection10) { textBox8.Text = Colorful.RGBtoHEX(Convert.ToInt32(textBox6.Text), Convert.ToInt32(textBox9.Text), Convert.ToInt32(textBox10.Text), false, "Error!"); } else { textBox6.Text = Colorful.HEXtoRGB(textBox8.Text, Enums.ColorType.OnlyR, "Error!"); textBox9.Text = Colorful.HEXtoRGB(textBox8.Text, Enums.ColorType.OnlyG, "Error!"); textBox10.Text = Colorful.HEXtoRGB(textBox8.Text, Enums.ColorType.OnlyB, "Error!"); } button9.Cursor = Cursors.Hand; button10.Cursor = Cursors.Hand; } catch (Exception Ex) { MessageBox.Show(Ex.Message); } }
private void Button6_Click(object sender, EventArgs e) { MessageBox.Show(Colorful.RGBtoHEX(Convert.ToInt32(textBox9.Text), Convert.ToInt32(textBox10.Text), Convert.ToInt32(textBox11.Text), true, "Error!")); MessageBox.Show(Colorful.RGBtoHEX(Convert.ToInt32(textBox9.Text), Convert.ToInt32(textBox10.Text), Convert.ToInt32(textBox11.Text), false, "Error!")); }