def macos_titlebar_color(x: str) -> int: x = x.strip('"') if x == 'system': return 0 if x == 'background': return 1 return (color_as_int(to_color(x)) << 8) | 2
def titlebar_color(x: str) -> int: x = x.strip('"') if x == 'system': return 0 if x == 'background': return 1 try: return (color_as_int(to_color(x)) << 8) | 2 except ValueError: log_error(f'Ignoring invalid title bar color: {x}') return 0
def cursor_text_color(x: str) -> Optional[Color]: if x.lower() == 'background': return None return to_color(x)
def title_fg(self, val: str, ans: typing.Dict[str, typing.Any]) -> None: ans['title_fg'] = to_color(val)
def added_bg(self, val: str, ans: typing.Dict[str, typing.Any]) -> None: ans['added_bg'] = to_color(val)
def select_bg(self, val: str, ans: typing.Dict[str, typing.Any]) -> None: ans['select_bg'] = to_color(val)
def removed_margin_bg(self, val: str, ans: typing.Dict[str, typing.Any]) -> None: ans['removed_margin_bg'] = to_color(val)
def margin_fg(self, val: str, ans: typing.Dict[str, typing.Any]) -> None: ans['margin_fg'] = to_color(val)
def hunk_margin_bg(self, val: str, ans: typing.Dict[str, typing.Any]) -> None: ans['hunk_margin_bg'] = to_color(val)
def highlight_removed_bg(self, val: str, ans: typing.Dict[str, typing.Any]) -> None: ans['highlight_removed_bg'] = to_color(val)
def foreground(self, val: str, ans: typing.Dict[str, typing.Any]) -> None: ans['foreground'] = to_color(val)
def filler_bg(self, val: str, ans: typing.Dict[str, typing.Any]) -> None: ans['filler_bg'] = to_color(val)