From b9c99b1f4c9becdc1fe6b0b51091ae1fa75e9d65 Mon Sep 17 00:00:00 2001 From: NaBian <836904362@qq.com> Date: Thu, 5 Jul 2018 19:41:18 +0800 Subject: [PATCH] colorpicker --- HandyControl/Controls/ColorPicker.xaml.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/HandyControl/Controls/ColorPicker.xaml.cs b/HandyControl/Controls/ColorPicker.xaml.cs index 6ee1e329..97888950 100644 --- a/HandyControl/Controls/ColorPicker.xaml.cs +++ b/HandyControl/Controls/ColorPicker.xaml.cs @@ -375,7 +375,8 @@ namespace HandyControl.Controls var common = list[commonIndex]; list[maxIndex] = 255; list[minIndex] = 0; - list[commonIndex] = (byte)(255 * max * (min - common) / (double)(max * (min - max))); + common = (byte)(255 * (min - common) / (double)(min - max)); + list[commonIndex] = common; BackColor = new SolidColorBrush(Color.FromRgb(list[0], list[1], list[2])); list[commonIndex] = 0;