Skip to content

AlpineC/ColorLib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Description

ColorLib is a C++ library which allows for the easy creation of colored/formated strings using ANSI escape codes

Features

ColorStrings: Strings which allow for the modification of the color and style of characters within it
ColorChars: Characters which can be styled and joined together to form ColorStrings
Style Macros: Multiple macros which allow for the easy selection of predifined styles and colors

Example: Counter

#include <iostream>
#include <print>
#include <ColorLib.hpp>
using namespace colorlib;

int main()
{
    
   for (size_t i = 0; i < 10; i++)
   {
     if (i % 2 == 0)
     {
        std::print("{}",ColourString(i,RED));
     }

     else
     {
      std::print("{}",ColourString(i,BLUE));
     }

   }
   
   

    return 0;
}

Project Status

Colorlib is still in development and must undergo extensive review before a full release, so feel free to give any constructive feedback

Requirments to use

-Access to the C++ standard library and a compiler that supports at least C++20

How to use

  1. Install the latest release from the releases page which contains the ColorLib header file

  2. Compile the code you include the library header in using at least the C++20 standard option

Note that colorlib is a single header library

About

Simple C++ library for Manipulating the color of text in the terminal

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages