baagee/colorful-echo

php cli colorful echo/print

v1.0 2018-12-12 10:39 UTC

This package is auto-updated.

Last update: 2024-12-23 16:51:52 UTC


README

php命令行下彩色输出文字/信息

include_once '../vendor/autoload.php';

$colorful = new \BaAGee\Command\ColorfulEcho();
$colorful->setBackgroundColor(\BaAGee\Command\Color::BLUE)->show('hello world!');
echo PHP_EOL;
$colorful->reset()->setStyle(\BaAGee\Command\Style::BOLD)->show('sdgsdf');
echo PHP_EOL;
$colorful->reset()->setFontColor(\BaAGee\Command\Color::GREEN)->show('sdgsd');
echo PHP_EOL;
$colorful->setBackgroundColor(\BaAGee\Command\Color::WHITE)->show('dddd');
echo PHP_EOL;
$colorful->reset()->setBackgroundColor(\BaAGee\Command\Color::GREEN)->setStyle(\BaAGee\Command\Style::BOLD)->setFontColor(\BaAGee\Command\Color::RED)->show('dddd');
echo PHP_EOL;