Cyotek Forums

Source Code => Color Picker Controls => Topic started by: Iconshow on December 12, 2015, 12:14:29 PM

Title: Roundiing difference
Post by: Iconshow on December 12, 2015, 12:14:29 PM
Hello,

You have written a great tool. The tool offers great possibilities to adjust color values.

I've tested first ColorPicker Version 1.02.
If I change the values of a Colorbar, the values of the other two Colorbars be affected. I was searching for the mistake and think I've found the cause. In module HSLColors in ToRgbColor function rounding errors may occur. At the end of the routine Colors is multiplied by the 255.

Color [color] * = 255;

After changing the command line, the values of the two Colorbars will no longer be changed.

Color [color] = Math.Round (Color [color] * 255d);

In the version 1.05, the error no longer occurs because the RGB values are stored in a separate variable. But when converting an HSL value but it can still lead to a rounding difference.

Ciao J├╝rgen
Title: Re: Roundiing difference
Post by: Richard Moss on December 12, 2015, 12:48:24 PM
Hello,

Thanks for taking the time to investigate this issue and let me know of a solution! I've committed your fix to the GitHub repository, although I haven't updated the NuGet package yet as that sync included another commit I haven't fully tested.

Thank you again.

Regards;
Richard Moss