Author Topic: Roundiing difference  (Read 10647 times)

Offline Iconshow

  • Newbie
  • *
  • Posts: 1
  • Karma: +1/-0
    • Icon Sets and XAML Icon Studio
Roundiing difference
« on: December 12, 2015, 12:14:29 PM »

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

Offline Richard Moss

  • Cyotek Team
  • Administrator
  • Sr. Member
  • *****
  • Posts: 456
  • Karma: +25/-0
Re: Roundiing difference
« Reply #1 on: December 12, 2015, 12:48:24 PM »

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.

Richard Moss