Last active
February 8, 2020 10:21
-
-
Save jhurliman/851b93b49a01c4f84b888fe647a2b37f to your computer and use it in GitHub Desktop.
COLOR macro for C/C++ ANSI color code printing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Assumes the surrounding context has a bool named `color` | |
#define COLOR( code, s ) ( color ? "\033[0;" #code "m" : "" ) << s << ( color ? "\033[0;m" : "" ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment