/* * 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