Merge pull request #6124 from marcjansen/more-digits
Allow up to 16 decimals for alpha channel when parsing rgba strings to colors
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user