{"record":{"id":"c0cb60ca82f72fa6","repo":"charmbracelet/vhs","slug":"marginfill-is-not-a-valid-color","errorCode":null,"errorMessage":"\"${marginFill}\" is not a valid color.","messagePattern":"\"(.+?)\" is not a valid color\\.","errorType":"validation","errorClass":"parser.Error","httpStatus":null,"severity":"error","filePath":"parser/parser.go","lineNumber":511,"sourceCode":"\t\t\t\tNewError(p.cur, windowBar+\" is not a valid bar style.\"),\n\t\t\t)\n\t\t}\n\tcase token.MARGIN_FILL:\n\t\tcmd.Args = p.peek.Literal\n\t\tp.nextToken()\n\n\t\tmarginFill := p.cur.Literal\n\n\t\t// Check if margin color is a valid hex string\n\t\tif strings.HasPrefix(marginFill, \"#\") {\n\t\t\t_, err := strconv.ParseUint(marginFill[1:], 16, 64)\n\n\t\t\tif err != nil || len(marginFill) != 7 {\n\t\t\t\tp.errors = append(\n\t\t\t\t\tp.errors,\n\t\t\t\t\tNewError(\n\t\t\t\t\t\tp.cur,\n\t\t\t\t\t\t\"\\\"\"+marginFill+\"\\\" is not a valid color.\",\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\tcase token.CURSOR_BLINK:\n\t\tcmd.Args = p.peek.Literal\n\t\tp.nextToken()\n\n\t\tif p.cur.Type != token.BOOLEAN {\n\t\t\tp.errors = append(\n\t\t\t\tp.errors,\n\t\t\t\tNewError(p.cur, \"expected boolean value.\"),\n\t\t\t)\n\t\t}\n\n\tdefault:\n\t\tcmd.Args = p.peek.Literal\n\t\tp.nextToken()","sourceCodeStart":493,"sourceCodeEnd":529,"githubUrl":"https://github.com/charmbracelet/vhs/blob/c073383b5de0b1f57bf514113029c306bc986539/parser/parser.go#L493-L529","documentation":"Fires in parseSet when the MarginFill value starts with '#' but is not a valid hex color: strconv.ParseUint of the hex digits fails or the string is not exactly 7 characters (#RRGGBB). Values not starting with '#' (named colors) skip this check entirely.","triggerScenarios":"Thrown at parser/parser.go:511 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a full 6-digit hex color, e.g. #1D2B53 (7 chars including the #)","Remove stray characters after the hex digits","Use a named color string without '#' if supported"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c073383b5de0b1f57bf514113029c306bc986539","analyzedAt":"2026-09-02T01:53:05.682Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}