Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix reported alpha value in rgb and hsl colors

  • Loading branch information...
commit b8fb3e55d2476d7812ef79ddef86c36eddf1abc4 1 parent cf7f207
Jason Johnston authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 sources/Color.js
View
4 sources/Color.js
@@ -119,13 +119,13 @@ PIE.Color = (function() {
// RGB or RGBA colors
if( m = color.match( Color.rgbOrRgbaRE ) ) {
color = me.rgbToHex( +m[1], +m[2], +m[3] );
- alpha = ( 5 in m ) ? +m[5] : 1;
+ alpha = ( m[5] === '' ) ? 1 : +m[5];
}
// HSL or HSLA colors
else if( m = color.match( Color.hslOrHslaRE ) ) {
rgb = hsl2rgb( m[1], m[2], m[3] );
color = me.rgbToHex( rgb.r, rgb.g, rgb.b );
- alpha = ( 5 in m ) ? +m[5] : 1;
+ alpha = ( m[5] === '' ) ? 1 : +m[5];
}
else {
if( Color.names.hasOwnProperty( vLower = color.toLowerCase() ) ) {
Please sign in to comment.
Something went wrong with that request. Please try again.