PHPackages                             chrismervyn/colorizer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. chrismervyn/colorizer

ActiveProject[CLI &amp; Console](/categories/cli)

chrismervyn/colorizer
=====================

A php class to manage background color, font color and font style on a CLI. It is compatible with all terminal screens.

17171[1 PRs](https://github.com/chrismervyn/colorizer/pulls)PHP

Since Sep 10Pushed 8y ago2 watchersCompare

[ Source](https://github.com/chrismervyn/colorizer)[ Packagist](https://packagist.org/packages/chrismervyn/colorizer)[ RSS](/packages/chrismervyn-colorizer/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

\#Colorizer [![Awesome Colorizer](Colorizer.png)](Colorizer.png)

### The nifty PHP class to add some color to your boring terminal output

[](#the-nifty-php-class-to-add-some-color-to-your-boring-terminal-output)

> This is an example of a dialogue screen generated on BASH terminal screen using `Colorizer`

[![Example Colorizer Dialogue](screenshots/screen-1.png)](screenshots/screen-1.png)

> This is another example of the `Colorizer`

[![Example Colorizer Dialogue](screenshots/screen-2.png)](screenshots/screen-2.png)

The primary features of this class are in its **fluidity** and *simplicity*.

#### Example Code

[](#example-code)

```
$colorizer = new Colorizer(`tput cols`,"green", "white");
$colorizer->clear();
$colorizer->addMessage("Welcome to the [u]Colorizer Example[/u]")->newLn();
$colorizer->spit();

```

Simple. While this code is pretty self-explanatory, yet I would go ahead make it more sensible.

- \#####Initialization of the constructor##### The paramters are

    1. Screen Width (or any width in terms of number of columns that you want)
    2. The background color (from the list of background colors in the source file)
    3. The foreground color (from the list of background colors in the source file) *`tput cols` is a handy command to count the number of columns*
- \#####Clear##### Clearing the screen
- \#####Add Message##### Add a line of text or two. Since, this is a fluid interface, you can chain together multiple methods or the same method multiple times
- \#####Spit (output)##### Output the final rendition of your masterpiece

---

### Some convinience thrown in

[](#some-convinience-thrown-in)

- \#####Colorizer::end()#####

    This is a static method that terminates the dialogue with a message on screen
- \#####Colorizer::alert()#####

    Another static method that acts as a pop-up, well sort of. It displays your message for 2 seconds and then relinquishes control back to your script
- \#####newLn()#####

    This is a public function that simply adds a new line to the end of your message

There is an `Example.php` file with this project. Do be sure to run it on your terminal and see almost all the features being used in that file.

Alright then, happy CLI-*fying* everything!

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/aa19cb15b4be0d3b14bc28b0065d662a97955cd7e0ef012dedf0e20c77b8a858?d=identicon)[chrismervyn](/maintainers/chrismervyn)

---

Top Contributors

[![chrisroy87](https://avatars.githubusercontent.com/u/1960154?v=4)](https://github.com/chrisroy87 "chrisroy87 (6 commits)")

### Embed Badge

![Health badge](/badges/chrismervyn-colorizer/health.svg)

```
[![Health](https://phpackages.com/badges/chrismervyn-colorizer/health.svg)](https://phpackages.com/packages/chrismervyn-colorizer)
```

###  Alternatives

[illuminate/console

The Illuminate Console package.

13045.3M6.3k](/packages/illuminate-console)[styleci/cli

The CLI tool for StyleCI

71464.1k9](/packages/styleci-cli)[winbox/args

Windows command-line formatter

20718.9k21](/packages/winbox-args)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
