Пример #1
0
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
Пример #2
0
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
Пример #3
0
def cursor_text_color(x: str) -> Optional[Color]:
    if x.lower() == 'background':
        return None
    return to_color(x)
Пример #4
0
 def title_fg(self, val: str, ans: typing.Dict[str, typing.Any]) -> None:
     ans['title_fg'] = to_color(val)
Пример #5
0
 def added_bg(self, val: str, ans: typing.Dict[str, typing.Any]) -> None:
     ans['added_bg'] = to_color(val)
Пример #6
0
 def select_bg(self, val: str, ans: typing.Dict[str, typing.Any]) -> None:
     ans['select_bg'] = to_color(val)
Пример #7
0
 def removed_margin_bg(self, val: str,
                       ans: typing.Dict[str, typing.Any]) -> None:
     ans['removed_margin_bg'] = to_color(val)
Пример #8
0
 def margin_fg(self, val: str, ans: typing.Dict[str, typing.Any]) -> None:
     ans['margin_fg'] = to_color(val)
Пример #9
0
 def hunk_margin_bg(self, val: str, ans: typing.Dict[str,
                                                     typing.Any]) -> None:
     ans['hunk_margin_bg'] = to_color(val)
Пример #10
0
 def highlight_removed_bg(self, val: str,
                          ans: typing.Dict[str, typing.Any]) -> None:
     ans['highlight_removed_bg'] = to_color(val)
Пример #11
0
 def foreground(self, val: str, ans: typing.Dict[str, typing.Any]) -> None:
     ans['foreground'] = to_color(val)
Пример #12
0
 def filler_bg(self, val: str, ans: typing.Dict[str, typing.Any]) -> None:
     ans['filler_bg'] = to_color(val)