aboutsummaryrefslogtreecommitdiff
path: root/include/kpl/color.h
diff options
context:
space:
mode:
authornodist <kevin.comas.git@gmail.com>2026-10-06 17:13:01 -0400
committernodist <kevin.comas.git@gmail.com>2026-10-06 17:13:01 -0400
commit7bd050ccf74222e1b659f2fd6826a86e6afbcc94 (patch)
tree30bae9ca5dd110f32cd4abb10d42ea4d872b4d82 /include/kpl/color.h
parentde65adbc1b2d1b3efdbe6a023bb7435f84b2f3a7 (diff)
basic tests
Diffstat (limited to 'include/kpl/color.h')
-rw-r--r--include/kpl/color.h120
1 files changed, 120 insertions, 0 deletions
diff --git a/include/kpl/color.h b/include/kpl/color.h
new file mode 100644
index 0000000..dc7fe20
--- /dev/null
+++ b/include/kpl/color.h
@@ -0,0 +1,120 @@
+/*
+ * Colors for pretty printing
+ */
+
+#pragma once
+
+#define KPL_COLOR_CONCAT(COLOR) KPL_COLOR_ ## COLOR
+
+#ifndef KPL_COLOR_OFF
+
+#define KPL_COLOR(A) "\e[" KPL_COLOR_CONCAT(A) "m"
+#define KPL_COLOR2(A, B) "\e[" KPL_COLOR_CONCAT(A) ";" KPL_COLOR_CONCAT(B) "m"
+#define KPL_COLOR3(A, B, C) "\e[" KPL_COLOR_CONCAT(A) ";" KPL_COLOR_CONCAT(B) ";" KPL_COLOR_CONCAT(C) "m"
+
+#define KPL_COLOR_RESET "0"
+#define KPL_COLOR_BOLD "1"
+#define KPL_COLOR_FAINT "2"
+#define KPL_COLOR_ITALIC "3"
+#define KPL_COLOR_UNDERLINE "4"
+#define KPL_COLOR_BLINK "5"
+#define KPL_COLOR_REVERSE "7"
+#define KPL_COLOR_HIDDEN "8"
+#define KPL_COLOR_RESET_BOLD "21"
+#define KPL_COLOR_RESET_FAINT "22"
+#define KPL_COLOR_RESET_ITALIC "23"
+#define KPL_COLOR_RESET_UNDERLINE "24"
+#define KPL_COLOR_RESET_BLINK "25"
+#define KPL_COLOR_RESET_REVERSE "27"
+#define KPL_COLOR_RESET_HIDDEN "28"
+#define KPL_COLOR_BLACK "30"
+#define KPL_COLOR_RED "31"
+#define KPL_COLOR_GREEN "32"
+#define KPL_COLOR_YELLOW "33"
+#define KPL_COLOR_BLUE "34"
+#define KPL_COLOR_MAGENTA "35"
+#define KPL_COLOR_CYAN "36"
+#define KPL_COLOR_GREY "37"
+#define KPL_COLOR_DEFAULT "39"
+#define KPL_COLOR_BG_BLACK "30"
+#define KPL_COLOR_BG_RED "41"
+#define KPL_COLOR_BG_GREEN "42"
+#define KPL_COLOR_BG_YELLOW "43"
+#define KPL_COLOR_BG_BLUE "44"
+#define KPL_COLOR_BG_MAGENTA "45"
+#define KPL_COLOR_BG_CYAN "46"
+#define KPL_COLOR_BG_GREY "47"
+#define KPL_COLOR_DARK_GREY "90"
+#define KPL_COLOR_LIGHT_RED "91"
+#define KPL_COLOR_LIGHT_GREEN "92"
+#define KPL_COLOR_LIGHT_YELLOW "93"
+#define KPL_COLOR_LIGHT_BLUE "94"
+#define KPL_COLOR_LIGHT_MAGENTA "95"
+#define KPL_COLOR_LIGHT_CYAN "96"
+#define KPL_COLOR_WHITE "97"
+#define KPL_COLOR_BG_DARK_GREY "100"
+#define KPL_COLOR_BG_LIGHT_RED "101"
+#define KPL_COLOR_BG_LIGHT_GREEN "102"
+#define KPL_COLOR_BG_LIGHT_YELLOW "103"
+#define KPL_COLOR_BG_LIGHT_BLUE "104"
+#define KPL_COLOR_BG_LIGHT_MAGENTA "105"
+#define KPL_COLOR_BG_LIGHT_CYAN "106"
+#define KPL_COLOR_BG_WHITE "107"
+
+#else
+
+#define KPL_COLOR(A) KPL_COLOR_CONCAT(A)
+#define KPL_COLOR2(A, B) KPL_COLOR_CONCAT(A) KPL_COLOR_CONCAT(B)
+#define KPL_COLOR3(A, B, C) KPL_COLOR_CONCAT(A) KPL_COLOR_CONCAT(B) KPL_COLOR_CONCAT(C)
+
+
+#define KPL_COLOR_RESET ""
+#define KPL_COLOR_BOLD ""
+#define KPL_COLOR_FAINT ""
+#define KPL_COLOR_ITALIC ""
+#define KPL_COLOR_UNDERLINE ""
+#define KPL_COLOR_BLINK ""
+#define KPL_COLOR_REVERSE ""
+#define KPL_COLOR_HIDDEN ""
+#define KPL_COLOR_RESET_BOLD ""
+#define KPL_COLOR_RESET_FAINT ""
+#define KPL_COLOR_RESET_ITALIC ""
+#define KPL_COLOR_RESET_UNDERLINE ""
+#define KPL_COLOR_RESET_BLINK ""
+#define KPL_COLOR_RESET_REVERSE ""
+#define KPL_COLOR_RESET_HIDDEN ""
+#define KPL_COLOR_BLACK ""
+#define KPL_COLOR_RED ""
+#define KPL_COLOR_GREEN ""
+#define KPL_COLOR_YELLOW ""
+#define KPL_COLOR_BLUE ""
+#define KPL_COLOR_MAGENTA ""
+#define KPL_COLOR_CYAN ""
+#define KPL_COLOR_GREY ""
+#define KPL_COLOR_DEFAULT ""
+#define KPL_COLOR_BG_BLACK ""
+#define KPL_COLOR_BG_RED ""
+#define KPL_COLOR_BG_GREEN ""
+#define KPL_COLOR_BG_YELLOW ""
+#define KPL_COLOR_BG_BLUE ""
+#define KPL_COLOR_BG_MAGENTA ""
+#define KPL_COLOR_BG_CYAN ""
+#define KPL_COLOR_BG_GREY ""
+#define KPL_COLOR_DARK_GREY ""
+#define KPL_COLOR_LIGHT_RED ""
+#define KPL_COLOR_LIGHT_GREEN ""
+#define KPL_COLOR_LIGHT_YELLOW ""
+#define KPL_COLOR_LIGHT_BLUE ""
+#define KPL_COLOR_LIGHT_MAGENTA ""
+#define KPL_COLOR_LIGHT_CYAN ""
+#define KPL_COLOR_WHITE ""
+#define KPL_COLOR_BG_DARK_GREY ""
+#define KPL_COLOR_BG_LIGHT_RED ""
+#define KPL_COLOR_BG_LIGHT_GREEN ""
+#define KPL_COLOR_BG_LIGHT_YELLOW ""
+#define KPL_COLOR_BG_LIGHT_BLUE ""
+#define KPL_COLOR_BG_LIGHT_MAGENTA ""
+#define KPL_COLOR_BG_LIGHT_CYAN ""
+#define KPL_COLOR_BG_WHITE ""
+
+#endif