diff --git a/src/ol/color.js b/src/ol/color.js index 5b156d362b..d1807c95c5 100644 --- a/src/ol/color.js +++ b/src/ol/color.js @@ -189,18 +189,6 @@ ol.color.fromStringInternal_ = function(s) { }; -/** - * @param {ol.Color} color Color. - * @return {boolean} Is valid. - */ -ol.color.isValid = function(color) { - return 0 <= color[0] && color[0] < 256 && - 0 <= color[1] && color[1] < 256 && - 0 <= color[2] && color[2] < 256 && - 0 <= color[3] && color[3] <= 1; -}; - - /** * @param {ol.Color} color Color. * @param {ol.Color=} opt_color Color. diff --git a/test/spec/ol/color.test.js b/test/spec/ol/color.test.js index 0df4432ed0..f713de47e8 100644 --- a/test/spec/ol/color.test.js +++ b/test/spec/ol/color.test.js @@ -103,28 +103,6 @@ describe('ol.color', function() { }); - describe('ol.color.isValid', function() { - - it('identifies valid colors', function() { - expect(ol.color.isValid([0, 0, 0, 0])).to.be(true); - expect(ol.color.isValid([255, 255, 255, 1])).to.be(true); - }); - - it('identifies out-of-range channels', function() { - expect(ol.color.isValid([-1, 0, 0, 0])).to.be(false); - expect(ol.color.isValid([256, 0, 0, 0])).to.be(false); - expect(ol.color.isValid([0, -1, 0, 0])).to.be(false); - expect(ol.color.isValid([0, 256, 0, 0])).to.be(false); - expect(ol.color.isValid([0, 0, -1, 0])).to.be(false); - expect(ol.color.isValid([0, 0, 256, 0])).to.be(false); - expect(ol.color.isValid([0, 0, -1, 0])).to.be(false); - expect(ol.color.isValid([0, 0, 256, 0])).to.be(false); - expect(ol.color.isValid([0, 0, 0, -1])).to.be(false); - expect(ol.color.isValid([0, 0, 0, 2])).to.be(false); - }); - - }); - describe('ol.color.normalize', function() { it('clamps out-of-range channels', function() {