zeus / cli-color
PHP CLI colorize library, Spice up the terminal texts and backgrounds with PHP. It is especially used in terminal applications.
Installs: 179
Dependents: 1
Suggesters: 0
Security: 0
Stars: 3
Watchers: 1
Forks: 2
Open Issues: 0
pkg:composer/zeus/cli-color
Requires
- php: >=7.4
This package is auto-updated.
Last update: 2025-10-28 07:01:43 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 |