From 4b8ed94012af1fb4f4752b5d199f79c6bcfd4c59 Mon Sep 17 00:00:00 2001 From: Alen Date: Mon, 25 Sep 2023 21:32:05 +0400 Subject: Add basic IPython config and startup scripts --- dot_ipython/profile_default/startup/10_colours.py | 56 +++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 dot_ipython/profile_default/startup/10_colours.py (limited to 'dot_ipython/profile_default/startup/10_colours.py') 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() -- cgit 1.4.1-2-gfad0