diff --git a/src/interface.js b/src/interface.js
index b595357e00bf57e9d40162221bc276a1af3cdecb..816546a0c202b0ba2b3db94ac0d182186e7f80ee 100644
--- a/src/interface.js
+++ b/src/interface.js
@@ -162,7 +162,11 @@ function updateSVG(fromSettingsChange=false) {
     globalXMLRoot.setAttribute("height", `${(vb[3]/1000).toFixed(3)}mm`);
     if (!globalSettings.transparent) {
         let backgroundElem = globalXMLRoot.ownerDocument.createElement("rect");
-        backgroundElem.setAttribute("fill", "rgb(255,255,255)");
+        if (globalSettings.blackAndWhite) {
+            backgroundElem.setAttribute("fill", "rgb(0,0,0)");
+        } else {
+            backgroundElem.setAttribute("fill", "rgb(255,255,255)");
+        }
         backgroundElem.setAttribute("x", vb[0]);
         backgroundElem.setAttribute("y", vb[1]);
         backgroundElem.setAttribute("width", vb[2]);
@@ -191,8 +195,8 @@ function updateSVG(fromSettingsChange=false) {
                 // let ty = Number(m[1]) + (layerVB[3]-(yMax-yMin))/2;
                 if (globalSettings.blackAndWhite) {
                     g.setAttribute("opacity", 1.0);
-                    g.setAttribute("fill", "rgb(0,0,0)");
-                    g.setAttribute("stroke", "rgb(0,0,0)");
+                    g.setAttribute("fill", "rgb(255,255,255)");
+                    g.setAttribute("stroke", "rgb(255,255,255)");
                 } else {
                     g.setAttribute("opacity", layerOpacity);
                     g.setAttribute("fill", layerRGB);