From 5074835b9e4a532f5a42394c2d4a244b0fab2a01 Mon Sep 17 00:00:00 2001 From: Julie Lala Date: Thu, 19 Dec 2013 20:22:04 -0500 Subject: background color --- js/record.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'js/record.js') 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) } -- cgit v1.2.3-70-g09d2