Skip to content
Browse files

fixed problem with background color

  • Loading branch information...
1 parent 00435ec commit e8e04dc3860e3cbf3d38ed9d010c7ea5b6f8fd1a @ChrisJan00 committed
Showing with 6 additions and 1 deletion.
  1. +6 −1 runningbrushes_ctrl/runningbrushes.js
View
7 runningbrushes_ctrl/runningbrushes.js
@@ -367,12 +367,17 @@ var RunningBrushes = function() {
self.newWidth = 512;
self.newHeight = 512;
self.applyNewScreen = function() {
+ function paddedHexStr(number) {
+ var str = number.toString(16).substr(0,2);
+ return "00".substr(0,2-str.length) + str;
+ }
self.originalWidth = self.newWidth;
self.canvas.width = self.originalWidth + self.extraBorder;
self.canvas.height = self.newHeight;
self.canvas.style.width = self.canvas.width;
self.canvas.style.height = self.newHeight;
- document.bgColor = "#"+self.bgRed.toString(16)+self.bgGreen.toString(16)+self.bgBlue.toString(16);
+
+ document.bgColor = "#"+paddedHexStr(self.bgRed)+paddedHexStr(self.bgGreen)+paddedHexStr(self.bgBlue);
self.clean();
optionsMenu.updateSize();
}

0 comments on commit e8e04dc

Please sign in to comment.
Something went wrong with that request. Please try again.