olive-cms/colorconsole is available on Packagist (olive-cms/colorconsole) and as such installable via Composer.
composer require olive-cms/colorconsoleIf you do not use Composer, you can grab the code from GitHub, and use any PSR-0 compatible autoloader (e.g. the Symfony2 ClassLoader component) to load Monolog classes.
require_once 'vendor/autoload.php';
use Olive\Tools\ColorConsole;
echo ColorConsole::render(
'Your Message',
[
'color' => 'magenta',
'background' => 'white',
'style' => ['bold', 'reverse'],
'align' => 'center'
]
);Notice: italic and blink may not work depending of your terminal
available styles:
- reset
- bold
- dark
- italic
- underline
- blink
- reverse
- concealed
available text Colors:
- default
- black
- red
- green
- yellow
- blue
- magenta
- cyan
- light_gray
- dark_gray
- light_red
- light_green
- light_yellow
- light_blue
- light_magenta
- light_cyan
- white
available text backgrounds:
- default
- black
- red
- green
- yellow
- blue
- magenta
- cyan
- light_gray
- dark_gray
- light_red
- light_green
- light_yellow
- light_blue
- light_magenta
- light_cyan
- white
available Align:
- center