ColorPicker
ColorPicker copied to clipboard
HsvProps Issues
I just cloned the repo to start trying to investigate this issue:
https://github.com/wieslawsoltes/ColorPicker/issues/22
When I launch the ColorPickerDemo project from within VS it immediately crashes in
private static bool ValidateSaturation(double? saturation)
{
if (saturation is null)
{
return true;
}
if (saturation < 0.0 || saturation > 100.0)
{
throw new ArgumentException("Invalid Saturation value.");
}
return true;
}
The input saturation value is "100.00000000000001".
If I try to run ThemeEditor.Desktop it also crashes as it cannot find the Deafult Theme to load.
If I try to run the Web project it also bombs as no inputs.
I have run the Nuke build too.
So to just get the demo up and running I deleted the throw new ...
... that got the demo running which doesn't seem to have the same problem as the instance in my application. So still investigating that.
If I click on the Alpha
or HSV
or CMYK
tabs the demo app immediately bombs with:
System.InvalidCastException: 'Unable to cast object of type 'Avalonia.UnsetValueType' to type 'System.Nullable`1
If I drag the Alpha thumb to the far right and then resize the app it also bombs on throw new ArgumentException("Invalid Alpha value.");
As the alpha value being sent to the method is 100.00000000000001
.
Before seeing this behaviour I had already started to think it was something to do with the translation of values from screen points to the UI/mouse position calculations. I think this screen resizing bombing is in agreement as it seems to try to update the associated values before recalculating the potential min max values during the redraw.
@jamsoft Can you try again master branch, I have pushed some changes
That definitely has improved things but dragging the Alpha thumb to the far right is still passing 100.000000001 and crashing things.
Can't do more