Created
April 10, 2024 14:54
-
-
Save AlexWaygood/0526a59ef5e73724b63c414ede7a1417 to your computer and use it in GitHub Desktop.
thing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from types import SimpleNamespace | |
AnsiColors = SimpleNamespace( | |
BOLD_GREEN="\x1b[1;32m", | |
BOLD_MAGENTA="\x1b[1;35m", | |
BOLD_RED="\x1b[1;31m", | |
GREEN="\x1b[32m", | |
GREY = "\x1b[90m" | |
MAGENTA = "\x1b[35m" | |
RED = "\x1b[31m" | |
RESET = "\x1b[0m" | |
YELLOW = "\x1b[33m" | |
) | |
def get_ansii_colors(): | |
if can_colorise(): | |
return AnsiColors | |
return SimpleNamespace(**dict.fromkeys(vars(AnsiColors), "")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment