-
-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing alpha channel #1
Comments
Ok, so new release here https://github.com/NC22/HTML5-Color-Picker/releases some new enter methods, etc. later will add to wiki new constructor parameters alpha - base value for alpha (float value from 0 to 1) default 1 new events mouseupalpha new functions getCurColorRgba - Return array {r : var, g : var, b : var, a : var} |
Wow, that was fast 👍 Thank you, job well done :) |
Ok, just tried in my project and works great. I just changed updateInput method to change input value accordingly if alpha < 1 function updateInput(){
if (!input) return;
if(a < 1) {
input.value = 'rgba(' + rgb.r + ', ' + rgb.g + ', ' + rgb.b + ', ' + a.toFixed(2) + ')';
} else {
input.value = hex;
}
if (inputColor) {
if(hsv.v < 0.5){
input.style.color = "#FFF";
} else {
input.style.color = "#000";
}
input.style.background = 'rgba(' + rgb.r + ', ' + rgb.g + ', ' + rgb.b + ', ' + a + ')';
}
} |
I forked it, not sure if to make pull request since you had many useless space characters which my editor erased. |
I'll look that, thanks. |
https://github.com/NC22/HTML5-Color-Picker/blob/master/html5kellycolorpicker.js#L806 Your corrections in behavior added. And also added event 'updateinput' for overload private updateInput function if some other behavior is needed. |
This color picker seems great, except missing option for transparency, would be possible to add a transparency slider?
The text was updated successfully, but these errors were encountered: