Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/brandonki/color-print-cpp

lightweight cross-platform logging with colors!
https://github.com/brandonki/color-print-cpp

Last synced: about 2 months ago
JSON representation

lightweight cross-platform logging with colors!

Awesome Lists containing this project

README

        

# color-print-cpp
cross-platform single header library to print colors to the console!

define CPRINT_PREFIX before including pLog.h to add a CP_ prefix to constants such as RED, BLUE, etc.

```cpp
#include "pLog.h"

using namespace pLog;

int main(int argc, char* argv[]){
if(!pLog_err)
println("Colors not supported :(");

println(12.5, RED, BOLD);
println(16, UNDERLINE, BOLD, RED);
println(fmt("I'm blue", BLUE) + " " + fmt("I'm cyan and bold", BRIGHT_CYAN, BOLD));
println("r,g,b values are also supported! They can be bold, underlined, etc.", rgb(255, 100, 0), BOLD);
println("to set background color pass a color to the bg() function.", bg(RED));
print("rgb can also be passed to bg", bg(rgb(255, 100, 0)));
}
```