You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reproduce:
Go to https://labs.abeautifulsite.net/jquery-minicolors/ and check the second RGB(A) example.
Now enter '#ff0000' in the input box.
The newly entered color is selected in the color grid, but the opacity slider stays where it was, while it should be moved all the way to the top (a hex color is fully opaque).
The fix is simple. In jquery.minicolors.js, I added this single line of code, line 586:
// Determine hex/HSB values
if(isRgb(input.val())) {
// If input value is a rgb(a) string, convert it to hex color and update opacity
hex = rgbString2hex(input.val());
alpha = keepWithin(parseFloat(getAlpha(input.val())).toFixed(2), 0, 1);
if(alpha) {
input.attr('data-opacity', alpha);
}
} else {
hex = convertCase(parseHex(input.val(), true), settings.letterCase);
input.attr('data-opacity', ''); // FIX
}
The text was updated successfully, but these errors were encountered:
I think this is more of a behavioral question than a bug.
If you compare entering a hex value via keyboard to entering via slider, the current behavior is consistent. For example, you don't expect opacity to change when sliding, so why should it change when typing?
I'm not sure if it should reset in this case. Open to other opinions.
Reproduce:
Go to https://labs.abeautifulsite.net/jquery-minicolors/ and check the second RGB(A) example.
Now enter '#ff0000' in the input box.
The newly entered color is selected in the color grid, but the opacity slider stays where it was, while it should be moved all the way to the top (a hex color is fully opaque).
The fix is simple. In jquery.minicolors.js, I added this single line of code, line 586:
The text was updated successfully, but these errors were encountered: