{"record":{"id":"a1011c41d74ced21","repo":"kovidgoyal/kitty","slug":"ignoring-invalid-title-bar-color-x","errorCode":null,"errorMessage":"Ignoring invalid title bar color: {x}","messagePattern":"Ignoring invalid title bar color: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"kitty/options/utils.py","lineNumber":1002,"sourceCode":"\ndef custom_shaders(x: str) -> tuple[str, ...]:\n    return tuple(shlex_split(x)) if x else ()\n\n\ndef allow_hyperlinks(x: str) -> int:\n    if x == 'ask':\n        return 0b11\n    return 1 if to_bool(x) else 0\n\n\ndef color_with_special_values(x: str, special_values: dict[str, int], error_msg: str) -> int:\n    x = x.strip('\"')\n    if (ans := special_values.get(x)) is not None:\n        return ans & 0xFF\n    try:\n        return (color_as_int(to_color(x)) << 8) | len(special_values)\n    except Exception:\n        log_error(error_msg.format(x=x))\n    return 0\n\n\ndef titlebar_color(x: str) -> int:\n    return color_with_special_values(x, {'system': 0, 'background': 1}, 'Ignoring invalid title bar color: {x}')\n\n\ndef scrollbar_color(x: str) -> int:\n    return color_with_special_values(x, {'foreground': 0, 'selection_background': 1}, 'Ignoring invalid scroll bar color: {x}')\n\n\ndef macos_titlebar_color(x: str) -> int:\n    x = x.strip('\"')\n    if x == 'light':\n        return -1\n    if x == 'dark':\n        return -2\n    return titlebar_color(x)","sourceCodeStart":984,"sourceCodeEnd":1020,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kitty/options/utils.py#L984-L1020","documentation":"kitty logs this when a titlebar_color/scrollbar_color value cannot be parsed as a color and is not one of the special values ('system', 'background'). The offending value is ignored and the color resolves to 0. It is a non-fatal config parse warning.","triggerScenarios":"Setting titlebar_color or scrollbar_color in kitty.conf to a malformed value, e.g. 'titlebar_color #ff00zz' or 'titlebar_color reed' (typo of red), or an unsupported color name.","commonSituations":"Typos in color names, malformed hex codes (wrong number of digits or invalid characters), copy-pasting colors from another terminal's format that kitty does not accept.","solutions":["Correct the value to a valid kitty color: named color, #rrggbb, #rgb, rgb:RR/GG/BB, or the special values 'system'/'background'.","If you intended the default, use 'system' (title bar) or 'background'.","Run kitty from a terminal and check the error log to confirm the option now parses."],"exampleFix":"# before\ntitlebar_color #ff00zz\n\n# after\ntitlebar_color #ff0000","handlingStrategy":"validation","validationCode":"from kitten_utils import is_valid_color  # pseudo\ndef valid_color(x: str) -> bool:\n    import re\n    x = x.strip('\"')\n    if x in {'system', 'background'}:\n        return True\n    return bool(re.fullmatch(r'#[0-9a-fA-F]{3}|#[0-9a-fA-F]{6}|rgb:[0-9a-fA-F/?]{1,4}(/[0-9a-fA-F?]*)*', x)) or x.lower() in NAMED_COLORS","typeGuard":"def is_special_or_color(x: str) -> bool:\n    return x in {'system','background'} or bool(re.fullmatch(r'#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})', x))","tryCatchPattern":null,"preventionTips":["Use hex #rrggbb or documented special values only","Validate colors in a config-lint step (e.g. kitty +runpy)"],"tags":["kitty","config","color","titlebar"],"backgroundTag":"config-value-validation-failed","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}