diff --git a/include/display.js b/include/display.js index 8053002..6bf89bd 100644 --- a/include/display.js +++ b/include/display.js @@ -667,7 +667,7 @@ var Display; if (this._true_color) { bgr = color; } else { - bgr = this._colourMap[color[0]]; + bgr = this._colourMap[color]; } var newStyle = 'rgb(' + bgr[2] + ',' + bgr[1] + ',' + bgr[0] + ')'; diff --git a/tests/test.display.js b/tests/test.display.js index 56dfc22..32a92e2 100644 --- a/tests/test.display.js +++ b/tests/test.display.js @@ -353,9 +353,9 @@ describe('Display/Canvas Helper', function () { it('should support drawing solid colors with color maps', function () { display._true_color = false; display.set_colourMap({ 0: [0xff, 0, 0], 1: [0, 0xff, 0] }); - display.fillRect(0, 0, 4, 4, [1]); - display.fillRect(0, 0, 2, 2, [0]); - display.fillRect(2, 2, 2, 2, [0]); + display.fillRect(0, 0, 4, 4, 1); + display.fillRect(0, 0, 2, 2, 0); + display.fillRect(2, 2, 2, 2, 0); expect(display).to.have.displayed(checked_data); });