From 454d60f31f82a3927a31f047c6658ef4b59a6cd5 Mon Sep 17 00:00:00 2001 From: Jack Wilkinson <31214002+jaxwilko@users.noreply.github.com> Date: Wed, 26 Feb 2025 14:29:55 +0000 Subject: [PATCH] Add fix for colorpicker hex with alpha saving --- modules/backend/formwidgets/ColorPicker.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/backend/formwidgets/ColorPicker.php b/modules/backend/formwidgets/ColorPicker.php index 9ad7dc67b..248b078a2 100644 --- a/modules/backend/formwidgets/ColorPicker.php +++ b/modules/backend/formwidgets/ColorPicker.php @@ -64,7 +64,7 @@ class ColorPicker extends FormWidgetBase */ protected array $validationPatterns = [ 'cmyk' => '/^cmyk\((\d{1,2}\.?\d{0,2}%,? ?){4}\)$/', - 'hex' => '/^#[\w\d]{6}$/', + 'hex' => '/^#[\w\d]{6,8}$/', 'hsl' => '/^hsla\((\d{1,3}\.?\d{0,2}%?, ?){3}\d\.?\d{0,2}?\)$/', 'rgb' => '/^rgba\((\d{1,3}\.?\d{0,2}, ?){3}\d\.?\d{0,2}?\)$/', ];