Skip to content

Commit 9e018ea

Browse files
author
lauren mccarthy
committed
fixing alpha 0 closes #285
1 parent af63d25 commit 9e018ea

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

lib/p5.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! p5.js v0.2.23 August 04, 2014 */
1+
/*! p5.js v0.2.23 August 05, 2014 */
22
var shim = function (require) {
33
window.requestDraw = function () {
44
return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function (callback, element) {
@@ -464,7 +464,7 @@ var p5Color = function (require, core, constants) {
464464
for (var i = 0; i < 3; i++) {
465465
a[i] = Math.floor(a[i]);
466466
}
467-
var alpha = a[3] ? a[3] / 255 : 1;
467+
var alpha = typeof a[3] !== 'undefined' ? a[3] / 255 : 1;
468468
return 'rgba(' + a[0] + ',' + a[1] + ',' + a[2] + ',' + alpha + ')';
469469
};
470470
p5.Color.getColor = function () {

0 commit comments

Comments
 (0)