summaryrefslogtreecommitdiff
path: root/ansi.py
diff options
context:
space:
mode:
authorScott Gasch <[email protected]>2021-09-24 21:17:16 -0700
committerScott Gasch <[email protected]>2021-09-24 21:17:16 -0700
commit07d89df04c5705cec39d6bdd10aea00bd5eb67e3 (patch)
tree122f5eced107615f82b08acf710c9ed995098f87 /ansi.py
parent0338feb616bee4ba7bcd3b51748c4b79569cca0f (diff)
Make smaller 'reset's
Diffstat (limited to 'ansi.py')
-rwxr-xr-xansi.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/ansi.py b/ansi.py
index dfbf48a..4c09db3 100755
--- a/ansi.py
+++ b/ansi.py
@@ -1738,6 +1738,9 @@ def fg(name: Optional[str] = "",
force_216color: bool = False) -> str:
import string_utils
+ if name is not None and name == 'reset':
+ return '\033[39m'
+
if name is not None and string_utils.is_full_string(name):
rgb = _find_color_by_name(name)
return fg(
@@ -1822,6 +1825,9 @@ def bg(name: Optional[str] = "",
force_216color: bool = False) -> str:
import string_utils
+ if name is not None and name == 'reset':
+ return '\033[49m'
+
if name is not None and string_utils.is_full_string(name):
rgb = _find_color_by_name(name)
return bg(