mirror of
https://github.com/RYDE-WORK/ballistica.git
synced 2026-02-05 15:03:33 +08:00
Tidying color stuff
This commit is contained in:
parent
35edfbd375
commit
e0b24e170f
@ -32,7 +32,11 @@ if TYPE_CHECKING:
|
|||||||
|
|
||||||
@unique
|
@unique
|
||||||
class TerminalColor(Enum):
|
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
|
# Styles
|
||||||
RESET = '\033[0m'
|
RESET = '\033[0m'
|
||||||
|
|||||||
@ -614,5 +614,16 @@ def filter_server_config() -> None:
|
|||||||
batools.build.filter_server_config(sys.argv[2], sys.argv[3])
|
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__':
|
if __name__ == '__main__':
|
||||||
snippets_main(globals())
|
snippets_main(globals())
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user