X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=dygraph-utils.js;h=bf936658aaa27d2d2ccbd13487bad7f7b18e1962;hb=f24c7fbf0dbb41673f96526165e4c1000bd150a2;hp=4f90c65e2480a9a992b823e6dab35fc680c4679b;hpb=9f79cb9489fd18858e4f5b661cb4b03be988b3b3;p=dygraphs.git diff --git a/dygraph-utils.js b/dygraph-utils.js index 4f90c65..bf93665 100644 --- a/dygraph-utils.js +++ b/dygraph-utils.js @@ -1148,7 +1148,13 @@ Dygraph.toRGB_ = function(colorStr) { div.style.backgroundColor = colorStr; div.style.visibility = 'hidden'; document.body.appendChild(div); - var rgbStr = window.getComputedStyle(div, null).backgroundColor; + var rgbStr; + if (window.getComputedStyle) { + rgbStr = window.getComputedStyle(div, null).backgroundColor; + } else { + // IE8 + rgbStr = div.currentStyle.backgroundColor; + } document.body.removeChild(div); var bits = /^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/.exec(rgbStr); return {