{"record":{"id":"f85c7cb75bd611a2","repo":"multica-ai/multica","slug":"color-must-be-a-6-digit-hex-value-like-3b82f6","errorCode":null,"errorMessage":"color must be a 6-digit hex value like #3b82f6","messagePattern":"color must be a 6-digit hex value like #3b82f6","errorType":"validation","errorClass":null,"httpStatus":400,"severity":"error","filePath":"server/internal/handler/label.go","lineNumber":112,"sourceCode":"\t\treturn value, nil\n\tdefault:\n\t\treturn \"\", errors.New(\"resource_type must be issue, agent, or skill\")\n\t}\n}\n\n// 6-digit hex, with or without leading '#'.\nvar hexColorRE = regexp.MustCompile(`^#?[0-9a-fA-F]{6}$`)\n\n// normalizeColor returns a canonical \"#rrggbb\" form or an error if invalid.\n//\n// LOAD-BEARING INVARIANT: LabelChip renders `style={{ backgroundColor: color }}`\n// directly in the frontend. If this regex is ever relaxed to accept arbitrary\n// CSS (named colors, `url(...)`, etc.), that inline style becomes an injection\n// surface. Keep the regex strict.\nfunc normalizeColor(c string) (string, error) {\n\tc = strings.TrimSpace(c)\n\tif !hexColorRE.MatchString(c) {\n\t\treturn \"\", errors.New(\"color must be a 6-digit hex value like #3b82f6\")\n\t}\n\tif !strings.HasPrefix(c, \"#\") {\n\t\tc = \"#\" + c\n\t}\n\treturn strings.ToLower(c), nil\n}\n\nconst maxLabelNameLen = 32\n\n// validateLabelName trims and validates a label name. Returns the trimmed\n// name or an error suitable for a 400 response.\nfunc validateLabelName(raw string) (string, error) {\n\tfor _, r := range raw {\n\t\tif unicode.IsControl(r) {\n\t\t\treturn \"\", errors.New(\"name cannot contain tabs, newlines, or control characters\")\n\t\t}\n\t}\n\tname := strings.TrimSpace(raw)","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/internal/handler/label.go#L94-L130","documentation":"Error \"color must be a 6-digit hex value like #3b82f6\" thrown in multica-ai/multica.","triggerScenarios":"Thrown at server/internal/handler/label.go:112 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a 6-digit hex color with a leading '#', e.g. #3b82f6."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}