🐛 fix(utils.go): check if hex-code starts with an #

This commit is contained in:
Siesta
2025-09-18 09:18:47 +02:00
parent c15cfdea70
commit 8085930dfe
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -26,7 +26,7 @@ func IDtoInt(id string) (int, error) {
}
func IsValidHexColor(color string) bool {
pattern := `^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$`
pattern := `^#(?:[A-Fa-f0-9]{3}|[A-Fa-f0-9]{6})$`
match, _ := regexp.MatchString(pattern, color)
return match
}