summaryrefslogtreecommitdiff
path: root/js/record.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/record.js')
-rw-r--r--js/record.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/js/record.js b/js/record.js
index dd7357a..b3c2466 100644
--- a/js/record.js
+++ b/js/record.js
@@ -148,10 +148,20 @@
frames[i].width = w
}
}
+ function backgroundColor(){
+ var colors = [
+ source.style.backgroundColor,
+ document.body.backgroundColor,
+ "white"
+ ]
+ for (var i in colors) {
+ if (colors[i] != "") return colors[i]
+ }
+ }
function capture(){
var frame = frames[done++]
var ctx = frame.getContext('2d')
- ctx.fillStyle = document.body.backgroundColor
+ ctx.fillStyle = backgroundColor()
ctx.fillRect(0,0,w,h)
ctx.drawImage(source, x, y, w, h, 0, 0, w, h)
}