2

Closed

Color Picker first use

description

If i have have a code:
 
<Contrib:ColorPicker x:Name="MyColorPicker"
                             Width="200"
                             Height="200"
                             Margin="10"
                             SelectedColorChanged="MyColorPicker_SelectedColorChanged"/>
 
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 7:27 PM by pbrooks
The issue has been fixed.

comments

chibiketan wrote Apr 28, 2009 at 4: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 4:12 PM

pbrooks wrote Jan 13, 2011 at 7: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 7:27 PM

wrote Feb 14, 2013 at 4:03 AM

wrote May 16, 2013 at 9:31 AM