From cec3b12b73807610bb7f2216ab5343884d00de57 Mon Sep 17 00:00:00 2001 From: Dave Lage Date: Sun, 3 Oct 2021 19:59:58 -0400 Subject: [PATCH] Support decimal percentage in hsla Support strings like hsla(60.342, 10.833999999999%, 14.5999999999%, 0.3) as hsla. --- src/color.class.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/color.class.js b/src/color.class.js index c1346310ed5..121a261e185 100644 --- a/src/color.class.js +++ b/src/color.class.js @@ -288,7 +288,7 @@ * @field * @memberOf fabric.Color */ - fabric.Color.reHSLa = /^hsla?\(\s*(\d{1,3})\s*,\s*(\d{1,3}\%)\s*,\s*(\d{1,3}\%)\s*(?:\s*,\s*(\d+(?:\.\d+)?)\s*)?\)$/i; + fabric.Color.reHSLa = /^hsla?\(\s*(\d{1,3}(?:\.\d+)?)\s*,\s*(\d{1,3}(?:\.\d+)?\%)\s*,\s*(\d{1,3}(?:\.\d+)?\%)\s*(?:\s*,\s*(\d+(?:\.\d+)?)\s*)?\)$/i; /** * Regex matching color in HEX format (ex: #FF5544CC, #FF5555, 010155, aff)