From cf04453d8bc1049c6f37c3bf3e5331b2c3cc43bb Mon Sep 17 00:00:00 2001 From: Timo Hausmann Date: Tue, 18 Oct 2022 12:42:37 +0200 Subject: [PATCH 1/2] Fix: Hexcodes starting with 0E becoming 000000 --- FieldtypeColorPicker.module | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/FieldtypeColorPicker.module b/FieldtypeColorPicker.module index 25bc4c4..015264e 100644 --- a/FieldtypeColorPicker.module +++ b/FieldtypeColorPicker.module @@ -32,7 +32,7 @@ class FieldtypeColorPicker extends Fieldtype { * */ public function getBlankValue(Page $page, Field $field) { - if($field->default == "0") $field->default = "000000"; + if($field->default === "0") $field->default = "000000"; return $field->default ? $field->default : ''; } @@ -62,7 +62,7 @@ class FieldtypeColorPicker extends Fieldtype { if(!$field->formatting) return $value; if("transp" == strtolower($value)) return self::TRANSPARENT; - if($value == "0") $value = "000000"; + if($value === "0") $value = "000000"; return self::HEX_PREFIX . $value; } From 4a07b57aa6af27b62072750c1a45a52b84f067aa Mon Sep 17 00:00:00 2001 From: Timo Hausmann Date: Tue, 18 Oct 2022 13:06:38 +0200 Subject: [PATCH 2/2] indicate not set color in UI --- colorpicker/css/colorpicker.css | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/colorpicker/css/colorpicker.css b/colorpicker/css/colorpicker.css index bf08d25..4b81178 100755 --- a/colorpicker/css/colorpicker.css +++ b/colorpicker/css/colorpicker.css @@ -162,3 +162,9 @@ .colorpicker_slider { background-position: bottom; } + + +.colorpicker_loaded:has(+ input:not([value])), +.colorpicker_loaded:has(+ input[value=""]) { + background: linear-gradient(-45deg, white 47%, red 48%, red 52%, white 53%) !important; +} \ No newline at end of file