private void ConvertToRgb()
{
try
{
string hex = "000000" + uxHexTextBox.Text ;
hex = hex.Substring(hex.Length - 6, 6);
string result = "RGB(";
for (int i = 0; i <= 4; i += 2)
{
string s = hex.Substring(i, 2);
result += Convert.ToInt32(s, 16).ToString();
if (i < 4)
result += ", ";
}
result += ")";
uxRgbTextBox.Text = result;
Clipboard.SetText(result);
uxHexTextBox.SelectAll();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, Application.ProductName);
}
}