fix colorpicker rgb/hsl parser with leading/trailing space

This commit is contained in:
tophf 2020-08-09 15:03:20 +03:00
parent d18314357f
commit 96c87fc55d

View File

@ -106,7 +106,7 @@ const colorConverter = (() => {
if (!type) return; if (!type) return;
const comma = value.includes(',') && !value.includes('/'); const comma = value.includes(',') && !value.includes('/');
const num = value.split(comma ? /\s*,\s*/ : /\s+(?!\/)|\s*\/\s*/); const num = value.trim().split(comma ? /\s*,\s*/ : /\s+(?!\/)|\s*\/\s*/);
if (num.length < 3 || num.length > 4) return; if (num.length < 3 || num.length > 4) return;
if (num[3] && !validateAlpha(num[3])) return null; if (num[3] && !validateAlpha(num[3])) return null;