This C the library simplifies changing the appearance of the terminal text output.
Independently of each other you can change the style and color of the text, the background color.
char* setBack(short arg)
,
char* setFore(short arg)
;
Arguments:
short arg
: 1 of 256 color format. range: [0 - 255];
Return:
char*
: ansicode. See showall.cpp for example.
char* setBack(short r, short g, short b)
,
char* setFore(short r, short g, short b)
;
Arguments:
short r, g, b
: RGB color format. range of each varriable: [0 - 255];
Return:
char*
: ansicode. See showall.cpp for example.
More about functions: libinfo.txt.
Style. | Name |
---|---|
BOLD | bold mode |
DIM | dim/faint mode |
FAINT | dim/faint mode |
ITALIC | italic mode |
UNDERLINE | underline mode |
OVERLINE | overline mode |
BLINKING | blinking mode |
INVERT | invert/reverse mode |
REVERSE | invert/reverse mode |
HIDE | invisible mode |
STRIKE | strikethrough mode |
Fore. | Name |
---|---|
BLACK | black |
RED | red |
GREEN | green |
YELLOW | yellow |
BLUE | blue |
MAGNETA | magneta |
CYAN | cyan |
WHITE | white |
Back. | Name |
---|---|
BLACK | black |
RED | red |
GREEN | green |
YELLOW | yellow |
BLUE | blue |
MAGNETA | magneta |
CYAN | cyan |
WHITE | white |
Style. | Name |
---|---|
RST | style reset, resets all changes |
#include <iostream>
#include "colorit/colorit.hpp"
int main(void) {
std::cout << Fore.RED << Style.ITALIC << "Hello!" << Style.RST << "\n"; // prints red text in italic style (mode)
return 0;
}
That's not all, the rest of constants, aliases, modes and other libinfo: libinfo.txt.
GNU General Public License v3.0