Skip to content

chonla/Colr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Colr

Command line colorizer

API

$colr = new Colr;  // or
$colr = new Colr(array(
    "ok" => array("fg" => Colr::BLACK, "bg" => Colr::GREEN)
));

Use fg() to set foreground color:

$colr->fg(Colr::GREEN);

Use bg() to set background color:

$colr->bg(Colr::GREEN);

Use set() to select predefined preset:

$colr = new Colr(array(
    "ok" => array("fg" => Colr::BLACK, "bg" => Colr::GREEN)
));
$colr->set("ok");

Use write() to echo some text:

$colr->write("hello");

Use writeln() to echo some text with new line:

$colr->writeln("hello");

Method chaining:

$colr->fg(Color::GREEN)->write("hello");

license

MIT: http://chonla.mit-license.org/

About

Command line colorizer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages