Color picker rgb and hex values broken

Hi,

I have found a bug that happens sometimes in the color picker (4.0.3).

I believe that the color picker internally works in hsl and then makes rgb and hex from that.

The bug appears in two places.

Move the mouse of the color pallet. You will notice that hsl values are all within range. But sometimes the rgb values are > 255 or -1. This in turn appears with a hex value with an extra 0 at the end or a - in the value.

It does not happen in all positions of the slide on the right so you might need to try a few to make it happen.

Please let me know if you need more information to reproduce the bug.

I need a fix as soon as possible.

Cheers,
Alex

Hi
It is quite difficult to reproduce this bug locally, if we need to move mouse randomly.
May be you can to reproduce it again and provide us screenshots?

Hi,

Please see the attached screenshot. Notice the hsl values appear to be fine, while the rgb and hex values are not.


Cheers,

Alex

Sorry, still can’t reproduce. May be you can provide us video with mouse moving on support@dhtmlx.com with a link to this topic?

Hi,

After capturing feedback, I believe I have discovered what is wrong. In all cases where I have 7 digits for the hex color or a dash in the hex color, if I click on the slider to the right of where you select the color, it fixes the issue.

Cheers,

Alex

Hi

could you please clarify ‘7 digits for the hex color’?

Hi,

So, this is a picture of what the colorpicker looks like when I click on the ribbon button.


To select a color, I click on the color palate in the color picker and it produces a white crosshair where the mouse was and the color values populate below. This is a picture of what it looks like.


Now, as you can see, there hex value is #0-1a0f1 and the Red value is -1. To fix this, I click on what I call the slider to the right of the color palate with the crosshair and above the -1.


Now, as you can see, all the values in the color picker are in range. This leads me to believe that what I call the slider may not initialize within a valid range because clicking on it and setting it anywhere never gives me an out of range value like what you have in the second screenshot.

Thank you for your kind assistance. I am able to reproduce this behaviour every time without fail which, as a developer, I know is like gold when you are trying to solve a problem.

Getting this issue cleared up will be of great value to my customers. Let me know if I can do anything else to help with the problem.

Cheers,

Alex

Hello Alex.

Thanks for the explanations. Could you please send us demo? direct link also an option. You can send them to support@dhtmlx.com, please include link to this thread. We need exact init codelines, how do you attach colorpicker to ribbon, to reproduce issue locally, Also please provide browser details.

Hi Andrei,

Thanks for the suggestion. So I found two issues… one was a bug on my end the other is a bug on your end.

In my json, I set custom_colors: true rather than the proper json… easy fix.

The other bug is that in the json, if you set

color: “#000000

It reproduces my bug. In fact, the color picker starts with no values.

Cheers,

Alex

Hello Alex. Please try attached version?

There was an issue with default selected color on init. Still not sure how to reproduce issue with custom_colors:true, according code - ‘true’ as value should be skipped, local tests are good.
dhtmlxColorPicker_v412_std_20141216.zip (956 KB)

Hi Andrei,

Thanks.

The issue on my end was not causing a problem with your control, but was not doing what I wanted it to.

I am going to merge the change back into my customized 4.0.3 version. There was a lot of missing functionality I needed in the Ribbon and some other components. There were also a lot of small bugs that had to be fixed immediately so I created a private version that I call 4.0.3+.

Once things slow down a bit, I need to update to the latest version and create a better path to incorporate the extra functionality I need into your released versions…

Cheers,
Alex

Alex, you’re welcome to report about the bugs that you find. If they’re confirmed, we will fix them and include in the next release.