From 66d9ef872c6381e680a93bec1ea20166ec3f56a4 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Tue, 16 Jan 2018 09:08:16 +0100 Subject: [PATCH] Fix color regexp to not match 7 hex digit --- src/ol/color.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ol/color.js b/src/ol/color.js index a4c4ef64fd..a6112d11b7 100644 --- a/src/ol/color.js +++ b/src/ol/color.js @@ -11,7 +11,7 @@ import {clamp} from './math.js'; * @type {RegExp} * @private */ -const HEX_COLOR_RE_ = /^#(?:[0-9a-f]{3,4}){1,2}$/i; +const HEX_COLOR_RE_ = /^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i; /**