diff --git a/ColorPicker/Pages/HarmoniesPage.xaml b/ColorPicker/Pages/HarmoniesPage.xaml index f1ce55ed..3b61d8cd 100644 --- a/ColorPicker/Pages/HarmoniesPage.xaml +++ b/ColorPicker/Pages/HarmoniesPage.xaml @@ -477,10 +477,30 @@ Cursor="Hand" MouseLeftButtonUp="ComplementaryBorder_MouseLeftButtonUp" /> - + + + + + + + + + + + + + + + + + + + + diff --git a/ColorPicker/Pages/HarmoniesPage.xaml.cs b/ColorPicker/Pages/HarmoniesPage.xaml.cs index e34d39ed..a7df31bf 100644 --- a/ColorPicker/Pages/HarmoniesPage.xaml.cs +++ b/ColorPicker/Pages/HarmoniesPage.xaml.cs @@ -28,6 +28,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE using ColorPicker.Windows; using Synethia; using System; +using System.Text.RegularExpressions; using System.Windows; using System.Windows.Controls; using System.Windows.Input; @@ -107,7 +108,7 @@ internal void InitHarmonies() // Analogous AnalogousPanel.Children.Clear(); - var analogousColors = Global.GenerateAnalogousColors(color, 6, 15); + var analogousColors = Global.GenerateAnalogousColors(color, 6, int.Parse(AngleTxt.Text)); for (int i = 0; i < analogousColors.Length; i++) { CornerRadius radius = i == 0 ? new(10, 0, 0, 10) : new(0); @@ -455,5 +456,25 @@ private void BookmarkBtn_Click(object sender, RoutedEventArgs e) BookmarkBtn.Content = "\uF1F8"; BookmarkToolTip.Content = Properties.Resources.RemoveBookmark; } + + private void AnalogousSettingsBtn_Click(object sender, RoutedEventArgs e) + { + AnalogousPopup.IsOpen = true; + } + + private void AngleTxt_PreviewTextInput(object sender, TextCompositionEventArgs e) + { + Regex regex = new("[^0-9]+"); + e.Handled = regex.IsMatch(e.Text); + } + + private void AngleTxt_TextChanged(object sender, TextChangedEventArgs e) + { + try + { + InitHarmonies(); + } + catch { } + } } } diff --git a/ColorPicker/Properties/Resources.Designer.cs b/ColorPicker/Properties/Resources.Designer.cs index 15a97e9a..44a363d4 100644 --- a/ColorPicker/Properties/Resources.Designer.cs +++ b/ColorPicker/Properties/Resources.Designer.cs @@ -123,6 +123,15 @@ public static string Analogous { } } + /// + /// Looks up a localized string similar to Angle. + /// + public static string Angle { + get { + return ResourceManager.GetString("Angle", resourceCulture); + } + } + /// /// Looks up a localized string similar to Apply. /// diff --git a/ColorPicker/Properties/Resources.en-US.resx b/ColorPicker/Properties/Resources.en-US.resx index ab775e98..88d4e51f 100644 --- a/ColorPicker/Properties/Resources.en-US.resx +++ b/ColorPicker/Properties/Resources.en-US.resx @@ -639,4 +639,7 @@ RGB Separator + + Angle + \ No newline at end of file diff --git a/ColorPicker/Properties/Resources.fr-FR.resx b/ColorPicker/Properties/Resources.fr-FR.resx index 0e11afd4..fbbf244d 100644 --- a/ColorPicker/Properties/Resources.fr-FR.resx +++ b/ColorPicker/Properties/Resources.fr-FR.resx @@ -643,4 +643,7 @@ Séparateur RGB + + Angle + \ No newline at end of file diff --git a/ColorPicker/Properties/Resources.resx b/ColorPicker/Properties/Resources.resx index f7bbeb0a..4903dc06 100644 --- a/ColorPicker/Properties/Resources.resx +++ b/ColorPicker/Properties/Resources.resx @@ -619,4 +619,7 @@ RGB Separator + + Angle + \ No newline at end of file diff --git a/ColorPicker/Properties/Resources.zh-CN.resx b/ColorPicker/Properties/Resources.zh-CN.resx index 6d44712a..e824983a 100644 --- a/ColorPicker/Properties/Resources.zh-CN.resx +++ b/ColorPicker/Properties/Resources.zh-CN.resx @@ -647,4 +647,7 @@ RGB 分色器 + + 角度 + \ No newline at end of file