Skip to content

mdurrant/php-console-color

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PhpConsoleColor

####Purpose This lightweight library only serves to make formatted console output code more readable.

Instead of:

echo "\033[0;31Foo:\033[0m Bar";

We can do:

$console->writeLn("<red>Foo:</red> Bar");

####Usage

$console = new Console();
$console->write('This');
$console->write('is');
$console->write('a');
$console->writeLn('<blue>Test</blue>');
$console->writeLn('Hello world!');

will output

Example output

####Colors

Color Code Info
black Black
red Red
green Green
yellow Yellow
blue Blue
purple Purple
cyan Cyan
white White
blackB Black Bold
redB Red Bold
greenB Black Bold
yellowB Yellow Bold
blueB Blue Bold
purpleB Purple Bold
cyanB Cyan Bold
whiteB White Bold
blackU Black Underlined
redU Red Underlined
greenU Black Underlined
yellowU Yellow Underlined
blueU Blue Underlined
purpleU Purple Underlined
cyanU Cyan Underlined
whiteU White Underlined

####License MIT

About

Extremely simple library for writing to the console in color

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages