Skip to content
/ ansi Public

C++17 header only to use ansi colors and escape sequences. On Linux, UNIX and Windows 10.

Notifications You must be signed in to change notification settings

josepuga/ansi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Table of Contents

About The Project

A simple way to show ansi colors and use escape codes on Linux and Windows terminals in a c++17 style with std::cout. .

Pros

  • Only one header.
  • Multiplatform: Windows, Linux and UNIX.
  • No external dependencies(*), like conio, ncurses, etc.

Cons

  • (*)On Windows you need to use Windows.h. The reason of that is a necessary hack with the API function SetConsoleMode(). On the other hand, that header and its dependencies are easily availables on Windows sytems.
  • Colors and behaviors like blink text, may differ from system to system (xterm, tty, windows, kterm, etc.). The best way to deal with it is trial and error.
  • Only for Windows 10 v1511 or higher.
  • Not the best option if you are looking for performance.

Usage and Demo

As easy as type somethink like std::cout << ansi::yellow << "Yellow text";.

Functions are doxygen style documented. Best way to learn is to have a look at the header file.

Run the demo to watch ansi codes in action. Some demo screenshots (in Windows):

Demo Screenshot 1 Demo Screenshot 2 Demo Screenshot 3

License

Distributed under the MIT License.

Contact

Feel free to send me any feedback.

José Puga - josepuga.programacion@gmail.com

About

C++17 header only to use ansi colors and escape sequences. On Linux, UNIX and Windows 10.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published