Skip to content

Commit

Permalink
Make bgFillColor configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
skeltoac committed Dec 20, 2012
1 parent 995eb9a commit d9cd9ba
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions js/canvas.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
white = "#FFFFFF"; white = "#FFFFFF";


var defaults = { var defaults = {
bgFillColor : "#000000",
debug : false, debug : false,
debugSelector : "#debug", debugSelector : "#debug",
baseHref : "", baseHref : "",
Expand Down Expand Up @@ -120,7 +121,9 @@
}; };


function Fireworks(options) { function Fireworks(options) {
$.extend(true, this, defaults, options, vars); // Allow opts to override the defaults $.extend(this, defaults, options, vars); // Allow opts to override the defaults
var rgb = hexToRgb(this.bgFillColor);
this.bgFillStyle = "rgba("+rgb[0]+","+rgb[1]+","+rgb[2]+",0.25)";
this.loadSprites(); // blocks animation while loading sprites this.loadSprites(); // blocks animation while loading sprites
}; };


Expand Down Expand Up @@ -725,7 +728,7 @@
Fireworks.prototype.fadeFrame = function() { Fireworks.prototype.fadeFrame = function() {
// Fade the previous frame // Fade the previous frame
this.displayContext.globalCompositeOperation = "source-over"; this.displayContext.globalCompositeOperation = "source-over";
this.displayContext.fillStyle = "rgba(0,0,0,0.25)"; this.displayContext.fillStyle = this.bgFillStyle;
this.displayContext.fillRect(0, 0, this.canvas.width, this.canvas.height); this.displayContext.fillRect(0, 0, this.canvas.width, this.canvas.height);
}; };


Expand Down

0 comments on commit d9cd9ba

Please sign in to comment.