From 836c83b8f4e2c526b374c2f0c463b57918072d1e Mon Sep 17 00:00:00 2001 From: SandObserver <260779319+SandObserver@users.noreply.github.com> Date: Thu, 20 Aug 2026 15:09:41 -0400 Subject: [PATCH] Fix: accept a hex color typed without its leading hash Detect an invalid CSS color with two seeded fillStyle reads, so an unparseable value no longer resolves to black. Add the leading hash to a bare 3 to 8 digit hex code in the color control and in the background color field, and warn when a value is not a color. --- CHANGELOG.md | 3 +++ ui/admin/index.html | 2 +- ui/i18n/de.json | 1 + ui/i18n/en.json | 1 + ui/i18n/es.json | 1 + ui/i18n/fa.json | 1 + ui/i18n/fr.json | 1 + ui/i18n/zh-Hans.json | 1 + ui/js/admin-app-form.js | 2 +- ui/js/admin-color-control.js | 41 +++++++++++++++++++++++++++------- ui/js/admin-widget-form.js | 2 +- ui/js/admin.js | 17 +++++++++++--- ui/js/widget-config-form.js | 2 +- ui/test/color-control.test.mjs | 39 +++++++++++++++++++++++++------- 14 files changed, 91 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 70e87013..04a103fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- Color fields now accept a hex code typed without its leading `#`, and say so + when a value is not a color. + - Apps with a container check no longer show an unhealthy badge while Docker container health checks are off. diff --git a/ui/admin/index.html b/ui/admin/index.html index e83f5eee..7decc1cf 100644 --- a/ui/admin/index.html +++ b/ui/admin/index.html @@ -303,6 +303,6 @@