+// Test https://github.com/danvk/dygraphs/issues/247
+UpdateOptionsTestCase.prototype.testUpdateColors = function() {
+ var graphDiv = document.getElementById("graph");
+ var graph = new Dygraph(graphDiv, this.data, this.opts);
+
+ var defaultColors = ["rgb(0,128,0)", "rgb(0,0,128)"];
+ assertEquals(["rgb(0,128,0)", "rgb(0,0,128)"], graph.getColors());
+
+ var colors1 = [ "#aaa", "#bbb" ];
+ graph.updateOptions({ colors: colors1 });
+ assertEquals(colors1, graph.getColors());
+
+ var colors2 = [ "#aaa", "#bbb", "#ccc" ];
+ graph.updateOptions({ colors: colors2 });
+ assertEquals(colors2, graph.getColors());
+
+
+ graph.updateOptions({ colors: null });
+ assertEquals(defaultColors, graph.getColors());
+}