Sha256: 2cb7587a8bcd80f24ecfeba74de2c203cb3b54cb783a28cdf7f9cc2ad91df011
Contents?: true
Size: 570 Bytes
Versions: 11
Compression:
Stored size: 570 Bytes
Contents
#ifndef LIMONP_COLOR_PRINT_HPP #define LIMONP_COLOR_PRINT_HPP #include <string> #include <stdarg.h> namespace limonp { using std::string; enum Color { BLACK = 30, RED, GREEN, YELLOW, BLUE, PURPLE }; // enum Color static void ColorPrintln(enum Color color, const char * fmt, ...) { va_list ap; printf("\033[0;%dm", color); va_start(ap, fmt); vprintf(fmt, ap); va_end(ap); printf("\033[0m\n"); // if not \n , in some situation , the next lines will be set the same color unexpectedly } } // namespace limonp #endif // LIMONP_COLOR_PRINT_HPP
Version data entries
11 entries across 11 versions & 3 rubygems