-
Notifications
You must be signed in to change notification settings - Fork 412
Setting alpha via an object doesn't work #58
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
Comments
This still seems to be an issue, 2 years later. The workaround is to do $.Color({red: 10, green: 10, blue: 10, alpha: 0.5}).alpha(0.5), but then what's the point of having it in the constructor in the first place? Also affects HSLA. |
Before this commit the following code: jQuery.Color( { red: 10, green: 20, blue: 30, alpha: 0.4 } ) was incorrectly creating a Color object with the alpha property set to 1. Fixes jquery#58
jQuery Color Please test and report any issues before we release the final! |
Released in jQuery Color 2.2.0. |
$.Color({red: 10, green: 10, blue: 10, alpha: 0.5}) results in a color with alpha set to 1.
The bug appears to be at line 276 in this section:
// everything defined but alpha?
if ( inst[ cache ] && jQuery.inArray( null, inst[ cache ].slice( 0, 3 ) ) < 0 ) {
// use the default of 1
inst[ cache ][ 3 ] = 1;
if ( space.from ) {
inst._rgba = space.from( inst[ cache ] );
}
}
It seems to just clear out the alpha every time.
The text was updated successfully, but these errors were encountered: