color theme related improvements

This commit is contained in:
Frank Skare
2019-07-17 18:18:33 +02:00
parent a82f558acf
commit 2af84941ca
15 changed files with 121 additions and 99 deletions

View File

@@ -1,4 +1,5 @@
using System;
using System.Diagnostics;
using System.Globalization;
using System.Windows;
using System.Windows.Controls;
@@ -64,11 +65,14 @@ namespace DynamicGUI
{
d.FullOpen = true;
try {
Color col = GetColor(ValueTextBox.Text);
d.Color = System.Drawing.Color.FromArgb(col.A, col.R, col.G, col.B);
} catch { }
if (!string.IsNullOrEmpty(ValueTextBox.Text))
{
Color col = GetColor(ValueTextBox.Text);
d.Color = System.Drawing.Color.FromArgb(col.A, col.R, col.G, col.B);
}
} catch {}
if (d.ShowDialog() == WinForms.DialogResult.OK)
ValueTextBox.Text = System.Drawing.ColorTranslator.ToHtml(d.Color);
ValueTextBox.Text = "#" + d.Color.ToArgb().ToString("X8");
}
break;
}