summaryrefslogtreecommitdiff
path: root/js/record.js
diff options
context:
space:
mode:
authorJulie Lala <jules@okfoc.us>2013-12-19 20:22:04 -0500
committerJulie Lala <jules@okfoc.us>2013-12-19 20:22:04 -0500
commit5074835b9e4a532f5a42394c2d4a244b0fab2a01 (patch)
treefbaa48a8a436e907d447cad73465a8eb4ad4476d /js/record.js
parent35bab6de471ed2cb971b736e97a83d60eab0628e (diff)
background color
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)
}