Skip to content

Commit

Permalink
Add NO_COLOR support
Browse files Browse the repository at this point in the history
  • Loading branch information
prettykool committed Apr 22, 2023
1 parent df939d3 commit cd905ec
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions mps_youtube/c.py
Expand Up @@ -4,12 +4,15 @@
import re
import sys


if sys.stdout.isatty():
white = "\x1b[%sm" % 0
ul = "\x1b[%sm" * 3 % (2, 4, 33)
ul = "\x1b[%sm" * 2 % (2, 4)

if not os.getenv('NO_COLOR'):
ul += "\x1b[%33m"

cols = ["\x1b[%sm" % n for n in range(91, 96)]
red, green, yellow, blue, pink = cols
red, green, yellow, blue, pink = [""]*5 if os.getenv('NO_COLOR') else cols
else:
ul = red = green = yellow = blue = pink = white = ""

Expand Down

0 comments on commit cd905ec

Please sign in to comment.