{"record":{"id":"89e0b8d2cc9729a7","repo":"kovidgoyal/kitty","slug":"invalid-value-for-background-w","errorCode":null,"errorMessage":"Invalid value for --background: %w","messagePattern":"Invalid value for --background: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kittens/icat/main.go","lineNumber":81,"sourceCode":"var fit_mode fit_t\n\nfunc send_output(imgd *image_data) {\n\toutput_channel <- imgd\n}\n\nfunc parse_mirror() (err error) {\n\tflip = opts.Mirror == \"both\" || opts.Mirror == \"vertical\"\n\tflop = opts.Mirror == \"both\" || opts.Mirror == \"horizontal\"\n\treturn\n}\n\nfunc parse_background() (err error) {\n\tif opts.Background == \"\" || opts.Background == \"none\" {\n\t\treturn nil\n\t}\n\tcol, err := style.ParseColor(opts.Background)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Invalid value for --background: %w\", err)\n\t}\n\tremove_alpha = &imaging.NRGBColor{R: col.Red, G: col.Green, B: col.Blue}\n\treturn\n}\n\nfunc parse_z_index() (err error) {\n\tval := opts.ZIndex\n\tvar origin int32\n\tif strings.HasPrefix(val, \"--\") {\n\t\torigin = -1073741824\n\t\tval = val[1:]\n\t}\n\ti, err := strconv.ParseInt(val, 10, 32)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Invalid value for --z-index with error: %w\", err)\n\t}\n\tz_index = int32(i) + origin\n\treturn","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kittens/icat/main.go#L63-L99","documentation":"icat's --background option (other than '' or 'none') is parsed with style.ParseColor; an unparseable color string yields this error.","triggerScenarios":"--background with an invalid color name or malformed hex, e.g. --background=#GGG or --background=chartreuse2-nope.","commonSituations":"Typos in color names, missing '#' on hex values, or using CSS color syntax the parser doesn't support.","solutions":["Use a standard color name or #rrggbb / #rgb hex form","Check for typos and a leading '#' on hex values","Use --background none to disable"],"exampleFix":"# before\nkitty +kitten icat --background=#ff00zz img.png\n# after\nkitty +kitten icat --background=#ff0000 img.png","handlingStrategy":"validation","validationCode":"if _, err := style.ParseColor(opts.Background); err != nil { /* reject early with usage hint */ }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use #rrggbb or documented color names","Test color args in a wrapper before invoking icat"],"tags":["kitty","icat","color","argument-validation"],"backgroundTag":"invalid-color-value","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}