20 lines
496 B
Python
20 lines
496 B
Python
"""Handles terminal text styles"""
|
|
|
|
def style_text(text, *args):
|
|
styles = {
|
|
"bold": "\033[1m",
|
|
"dim": "\033[2m",
|
|
"underline": "\033[4m",
|
|
"blink": "\033[5m", # This is here if you REALLY need it...dont use it. (ctrl+shift+esc+E to enable evil mode.)
|
|
"inverse": "\033[7m", # Make fg and bg color swap
|
|
}
|
|
out = ""
|
|
for arg in args:
|
|
if arg in styles:
|
|
out += styles[arg]
|
|
out += text
|
|
out += "\033[0m"
|
|
return out
|
|
|
|
|