Fix color regexp to not match 7 hex digit

This commit is contained in:
Frederic Junod
2018-01-16 09:08:16 +01:00
parent 974f9391f2
commit 66d9ef872c

View File

@@ -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;
/**