JosefVesely / printfcolor

🍭 A single-header C library for printing colored text to the console
MIT License
9 stars 1 forks source link
c cli color colors console library linux terminal windows

printfcolor Library

A single-header C library for printing colored text to the console. It supports both Windows and Unix-like systems.

How to use

Include the printfcolor.h header file in your C project:

#include "printfcolor.h"

Example code

#include "printfcolor.h"

int main()
{
    printfc_fg(BLUE, "Blue text\n");
    printfc_fg(MAGENTA, "Magenta text\n\n");

    printfc_bg(GREEN, "Green background\n");
    printfc_bg(RED, "Red background\n\n");

    printfc(WHITE, BLUE, "White on blue\n");
    printfc(MAGENTA, CYAN, "Magenta on cyan\n");
}

Output:

Example output

Compatibility

Error Handling

License

This project is licensed under the MIT License - see the LICENSE file for details