def add_catppuccin(
flavor,
*,
rosewater,
flamingo,
pink,
mauve,
red,
maroon, #
peach,
yellow,
green,
teal, #
sky,
sapphire,
blue,
lavender, #
text,
subtext_1,
subtext_0,
overlay_2,
overlay_1, #
overlay_0, #
surface_2,
surface_1,
surface_0,
base,
mantle, #
crust,
dark=True,
):
"""Add catppuccin."""
name = f'catppuccin-{flavor}'
BUILTIN_THEMES[name] = Theme(
name=name,
primary=pink,
secondary=mauve,
warning=yellow,
error=red,
success=green,
accent=peach,
foreground=text,
background=mantle,
surface=surface_0,
panel=surface_1,
dark=dark,
variables={
'input-cursor-foreground': crust,
'input-cursor-background': rosewater,
'input-selection-background': f'{overlay_2} 30%',
'border': lavender,
'border-blurred': surface_2,
'footer-background': surface_1,
'block-cursor-foreground': base,
'block-cursor-text-style': 'none',
'button-color-foreground': mantle,
},
)
TEXT_THEMES[name] = TextAreaTheme(
name=name,
base_style=Style(color=text, bgcolor=base),
gutter_style=Style(color=rosewater, bgcolor=base),
cursor_style=Style(color=overlay_2, bgcolor=rosewater),
cursor_line_style=Style(bgcolor=surface_0),
cursor_line_gutter_style=Style(color=subtext_1, bgcolor=surface_1),
bracket_matching_style=Style(bgcolor=crust, bold=True),
selection_style=Style(bgcolor=surface_1),
syntax_styles={
'string': Style(color=green),
'string.documentation': Style(color=green),
'comment': Style(color=subtext_0),
'heading.marker': Style(color=green),
'keyword': Style(color=mauve),
'operator': Style(color=sky),
'repeat': Style(color=sky),
'exception': Style(color=red),
'include': Style(color=mauve),
'keyword.function': Style(color=mauve),
'keyword.return': Style(color=mauve),
'keyword.operator': Style(color=mauve),
'conditional': Style(color=mauve),
'number': Style(color=red),
'float': Style(color=red),
'class': Style(color=mauve),
'type': Style(color=mauve),
'type.class': Style(color=yellow),
'type.builtin': Style(color=text),
'function': Style(color=blue),
'function.call': Style(color=blue),
'method': Style(color=blue),
'method.call': Style(color=blue),
'boolean': Style(color=peach, italic=True),
'constant.builtin': Style(color=peach, italic=True),
'json.null': Style(color=peach, italic=True),
'regex.punctuation.bracket': Style(color=red),
'regex.operator': Style(color=sky),
'html.end_tag_error': Style(color=red, underline=True),
'tag': Style(color=mauve),
'yaml.field': Style(color=red, bold=True),
'json.label': Style(color=red, bold=True),
'toml.type': Style(color=mauve),
'toml.datetime': Style(color=mauve),
'css.property': Style(color=mauve),
'heading': Style(color=sapphire, bold=True),
'bold': Style(bold=True),
'italic': Style(italic=True),
'strikethrough': Style(strike=True),
'link.label': Style(color=red),
'link.uri': Style(color=pink, underline=True),
'list.marker': Style(color=yellow),
'inline_code': Style(color=yellow),
'punctuation.bracket': Style(color=red),
'punctuation.delimiter': Style(color=rosewater),
'punctuation.special': Style(color=red),
},
)