Add new config option to set the terminal bg color

This is a hacky way to do it, but it works surprisingly well, considering there's no true way to modify a terminal's fully color scheme.
This commit is contained in:
rlaphoenix 2023-02-25 11:29:46 +00:00
parent 01e419d52c
commit 6eac499ae0
2 changed files with 7 additions and 0 deletions

View File

@ -62,6 +62,7 @@ class Config:
self.proxy_providers: dict = kwargs.get("proxy_providers") or {}
self.serve: dict = kwargs.get("serve") or {}
self.services: dict = kwargs.get("services") or {}
self.set_terminal_bg: bool = kwargs.get("set_terminal_bg", True)
self.tag: str = kwargs.get("tag") or ""
@classmethod

View File

@ -1,6 +1,8 @@
from rich.console import Console
from rich.theme import Theme
from devine.core.config import config
catppuccin_mocha = {
# Colors based on "CatppuccinMocha" from Gogh themes
@ -30,10 +32,14 @@ primary_scheme["bright_yellow"] = primary_scheme["yellow"]
primary_scheme["bright_blue"] = primary_scheme["blue"]
primary_scheme["bright_magenta"] = primary_scheme["pink"]
primary_scheme["bright_cyan"] = primary_scheme["cyan"]
if config.set_terminal_bg:
primary_scheme["none"] += f" on {primary_scheme['bg']}"
custom_colors = {
"ascii.art": primary_scheme["pink"]
}
if config.set_terminal_bg:
custom_colors["ascii.art"] += f" on {primary_scheme['bg']}"
console = Console(