diff options
author | Alen <alen@dotfiles.xyz> | 2023-09-25 21:32:05 +0400 |
---|---|---|
committer | Alen <alen@dotfiles.xyz> | 2023-09-25 21:32:05 +0400 |
commit | 4b8ed94012af1fb4f4752b5d199f79c6bcfd4c59 (patch) | |
tree | ad54d702d385e973f367cc02c9115b1948510caa /dot_ipython/profile_default/startup/10_colours.py | |
parent | 33df3ffbe31ea3b722bfeec21e6a4ebfd038aa00 (diff) |
Add basic IPython config and startup scripts
Diffstat (limited to 'dot_ipython/profile_default/startup/10_colours.py')
-rw-r--r-- | dot_ipython/profile_default/startup/10_colours.py | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/dot_ipython/profile_default/startup/10_colours.py b/dot_ipython/profile_default/startup/10_colours.py new file mode 100644 index 0000000..eb6e5a8 --- /dev/null +++ b/dot_ipython/profile_default/startup/10_colours.py @@ -0,0 +1,56 @@ +"""Simple colours for colourful colouring.""" + + +class FG: + RESET = "\u001b[0m" + + DARK_BLACK = BLACK = "\u001b[30m" + DARK_RED = "\u001b[31m" + DARK_GREEN = "\u001b[32m" + DARK_YELLOW = BROWN = "\u001b[33m" + DARK_BLUE = BLUE = "\u001b[34m" + DARK_MAGENTA = PURPLE = "\u001b[35m" + DARK_CYAN = "\u001b[36m" + DARK_WHITE = "\u001b[37m" + + BRIGHT_BLACK = GRAY = GREY = "\u001b[30;1m" + BRIGHT_RED = RED = "\u001b[31;1m" + BRIGHT_GREEN = GREEN = "\u001b[32;1m" + BRIGHT_YELLOW = YELLOW = "\u001b[33;1m" + BRIGHT_BLUE = "\u001b[34;1m" + BRIGHT_MAGENTA = MAGENTA = "\u001b[35;1m" + BRIGHT_CYAN = CYAN = "\u001b[36;1m" + BRIGHT_WHITE = WHITE = "\u001b[37;1m" + + def __getitem__(self, rgb): + r, g, b = rgb + return f"\u001b[38;2;{r};{g};{b}m" + + +class BG: + RESET = "\u001b[0m" + + DARK_BLACK = BLACK = "\u001b[40m" + DARK_RED = "\u001b[41m" + DARK_GREEN = "\u001b[42m" + DARK_YELLOW = BROWN = "\u001b[44m" + DARK_BLUE = BLUE = "\u001b[44m" + DARK_MAGENTA = PURPLE = "\u001b[45m" + DARK_CYAN = "\u001b[46m" + DARK_WHITE = "\u001b[47m" + + BRIGHT_BLACK = GRAY = GREY = "\u001b[40;1m" + BRIGHT_RED = RED = "\u001b[41;1m" + BRIGHT_GREEN = GREEN = "\u001b[42;1m" + BRIGHT_YELLOW = YELLOW = "\u001b[44;1m" + BRIGHT_BLUE = "\u001b[44;1m" + BRIGHT_MAGENTA = MAGENTA = "\u001b[45;1m" + BRIGHT_CYAN = CYAN = "\u001b[46;1m" + BRIGHT_WHITE = WHITE = "\u001b[47;1m" + + def __getitem__(self, rgb): + r, g, b = rgb + return f"\u001b[48;2;{r};{g};{b}m" + + +_summarise_startup() |