summary refs log tree commit diff
path: root/dot_ipython/profile_default/startup/10_colours.py
diff options
context:
space:
mode:
Diffstat (limited to 'dot_ipython/profile_default/startup/10_colours.py')
-rw-r--r--dot_ipython/profile_default/startup/10_colours.py56
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()