private void tboxLAB_TextChanged(object sender, EventArgs e) { if (changing) { return; } try { RGBColor rGBColor = new LabColor( Convert.ToDouble(tboxLABL.Text), Convert.ToDouble(tboxLABA.Text), Convert.ToDouble(tboxLABB.Text) ).ToRGB(); labelColor.BackColor = labelColor.ForeColor = Color.FromArgb( rGBColor.R, rGBColor.G, rGBColor.B ); } catch (Exception ex) { MessageBox.Show("AArrrr!!! " + ex.Message); } }
private void updateLAB(LabColor color) { tboxLABL.Text = color.L1.ToString(); tboxLABA.Text = color.A.ToString(); tboxLABB.Text = color.B.ToString(); trackBarLABL.Value = Convert.ToInt32(color.L1); trackBarLABA.Value = Convert.ToInt32(color.A); trackBarLABB.Value = Convert.ToInt32(color.B); }