Skip to content

Commit

Permalink
Fixed opacity calculation in color (#27)
Browse files Browse the repository at this point in the history
* Fixed opacity calculation in `color`

* Fixed opacity calculation in `color` (#2)

* Added a missing semicolon
  • Loading branch information
refset authored and stewartlord committed Feb 6, 2017
1 parent 62321ed commit 700e36c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion identicon.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@
rectangles: null,

color: function(r, g, b, a){
var values = [r, g, b, a ? a/255 : 1].map(Math.round);
var values = [r, g, b].map(Math.round);
values.push((a >= 0) && (a <= 255) ? a/255 : 1);
return 'rgba(' + values.join(',') + ')';
},

Expand Down

0 comments on commit 700e36c

Please sign in to comment.