mirror of
				https://github.com/devine-dl/devine.git
				synced 2025-11-04 03:44:49 +00:00 
			
		
		
		
	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:
		
							parent
							
								
									01e419d52c
								
							
						
					
					
						commit
						6eac499ae0
					
				@ -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
 | 
			
		||||
 | 
			
		||||
@ -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(
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user