diff --git a/src/ol/color.js b/src/ol/color.js index d1807c95c5..0bbe0c06eb 100644 --- a/src/ol/color.js +++ b/src/ol/color.js @@ -30,7 +30,7 @@ ol.color.RGB_COLOR_RE_ = * @private */ ol.color.RGBA_COLOR_RE_ = - /^(?:rgba)?\((0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|1|0\.\d{0,10})\)$/i; + /^(?:rgba)?\((0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|1|0\.\d{0,16})\)$/i; /** diff --git a/test/spec/ol/color.test.js b/test/spec/ol/color.test.js index f713de47e8..f8599acbe5 100644 --- a/test/spec/ol/color.test.js +++ b/test/spec/ol/color.test.js @@ -81,6 +81,8 @@ describe('ol.color', function() { it('can parse rgba colors', function() { expect(ol.color.fromString('rgba(255, 255, 0, 0.1)')).to.eql( [255, 255, 0, 0.1]); + expect(ol.color.fromString('rgba(255, 255, 0, 0.3333333333333333)')).to.eql( + [255, 255, 0, 0.3333333333333333]); }); it('caches parsed values', function() {