zeus/cli-color

PHP CLI colorize library, Spice up the terminal texts and backgrounds with PHP. It is especially used in terminal applications.

1.0.0 2020-09-03 18:31 UTC

This package is auto-updated.

Last update: 2022-06-27 23:23:32 UTC


README

Install

composer require zeus/cli-color

Using example

<?php


require_once "vendor/autoload.php";


use CliColorize\Background;
use CliColorize\Cli;

$cli = new Cli();


echo $cli->red('hello', Background::BLACK);
echo $cli->blue("world", Background::YELLOW);
echo $cli->purple("world", Background::YELLOW);

Available colors

Text (Method name) Background (Constants)
black Background::RED
dark_gray Background::BLACK
green Background::GREEN
light_green Background::YELLOW
red Background::BLUE
light_red Background::MAGENTA
blue Background::CYAN
light_blue Background::LIGHT_GRAY
cyan
light_cyan
light_purple
brown
white
purple
magenta
light_magenta

Screenshot

using

Text colors examples

Background colors example