The user can output to stdout by specifying the color.
Color::fromColor(ForegroundColor::White)
->background(BackgroundColor::Green)
->println('%s succeeded.', 'Color package example');
or
$color = Color::fromColor(ForegroundColor::White)
->background(BackgroundColor::Green);
$color('%s succeeded.', 'Color package example');
The user can use the applyTo method in order to apply a style to text.
$text = Color::fromColor(ForegroundColor::White)
->background(BackgroundColor::Green)
->applyTo('target text');
echo $text;
The user can pull the bold and underline.
Color::fromColor(ForegroundColor::White)
->addStyle(StyleType::Bold)
->addStyle(StyleType::Underlined)
->println('%s + %s', 'bold', 'underlined');
You can run the test with the following command.
composer install
composer test