Color Picker first use


If i have have a code:
<Contrib:ColorPicker x:Name="MyColorPicker"
I can not use a attribute SelectedColor, because its throw me an exception when I use a event SelectedColorChanged.
And if i do not use a Selected color, application works well, but I have to move vertical slider before I can use SelectedColorChanged.
I attached a source code of my issue.

file attachments

Closed Jan 13, 2011 at 6:27 PM by pbrooks
The issue has been fixed.


chibiketan wrote Apr 28, 2009 at 3:12 PM

After some checks, it's due to a missing condition in hue calculation leading to a NaN value for the hue.
This case only appears when red, green and blue are equal, so min and max value are equal too.
Hue calculation says that if min == max then hue = 0 but in the application, we fall in the first if and calculate hue = 60 * (g - b) / (max - min).

You can find the corrected file attached.

wrote Apr 28, 2009 at 3:12 PM

pbrooks wrote Jan 13, 2011 at 6:27 PM

Thanks for the fix. I have made the change and checked in the code. It should be in the next release.

wrote Jan 13, 2011 at 6:27 PM

wrote Feb 14, 2013 at 3:03 AM

wrote May 16, 2013 at 8:31 AM