1
0
Fork 0

Added check in color output to improve performance

This commit is contained in:
JoshuaMKW 2020-08-19 06:32:52 -05:00
parent 2a7ac8a3d9
commit 2f4656026d

View file

@ -88,6 +88,15 @@ def color_text(text: str, textToColor: list=[('', None)], defaultColor: str=None
currentColor = None
formattedText = ''
format = False
for itemPair in textToColor:
if itemPair[0] != '' or itemPair[1] is not None:
format = True
break
if not format:
return defaultColor + text + TRESET
for char in text:
handled = False
for itemPair in textToColor: