mirror of
https://github.com/RYDE-WORK/ballistica.git
synced 2026-01-26 00:47:10 +08:00
Tidying color stuff
This commit is contained in:
parent
35edfbd375
commit
e0b24e170f
@ -32,7 +32,11 @@ if TYPE_CHECKING:
|
||||
|
||||
@unique
|
||||
class TerminalColor(Enum):
|
||||
"""Color codes for printing to terminals."""
|
||||
"""Color codes for printing to terminals.
|
||||
|
||||
Generally the Clr class should be used when incorporating color into
|
||||
terminal output, as it handles non-color-supporting terminals/etc.
|
||||
"""
|
||||
|
||||
# Styles
|
||||
RESET = '\033[0m'
|
||||
|
||||
@ -614,5 +614,16 @@ def filter_server_config() -> None:
|
||||
batools.build.filter_server_config(sys.argv[2], sys.argv[3])
|
||||
|
||||
|
||||
def printcolors() -> None:
|
||||
"""Print all colors available in efro.terminals.TerminalColor."""
|
||||
from efro.terminal import TerminalColor
|
||||
for value in TerminalColor:
|
||||
if value is TerminalColor.RESET:
|
||||
continue
|
||||
print(f'{value.name}: {value.value}'
|
||||
f'The quick brown fox jumps over the lazy dog.'
|
||||
f'{TerminalColor.RESET.value}')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
snippets_main(globals())
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user