Skip to content

Single-header macro-based library for using terminal color codes in C/C++

License

Notifications You must be signed in to change notification settings

tomsik68/ansi_colors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ansi_colors

Single-header macro-based library for terminal color codes

Screenshot

This is a showcase of all supported formatting at the moment (the colors may look different depending on your terminal configuration):

Usage

Copy the header file somewhere in your project. Then, you can include it whenever needed.

#include "ansi_colors.h"

The color codes can then be used with puts, printf or really any I/O function that outputs to an ANSI terminal. For example:

#include <stdio.h>
#include "ansi_colors.h"

int main(int argc, char** argv) {
  printf("Hello world! " BOLD " This text is written in bold!" RESET " this is not!" );
  return 0;
}

About

Single-header macro-based library for using terminal color codes in C/C++

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published