PHPackages                             phpexperts/console-painter - 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. phpexperts/console-painter

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

phpexperts/console-painter
==========================

A quick and easy library for colorizing and stylizing ANSI consoles.

v1.1.0(5y ago)101201[1 issues](https://github.com/phpexpertsinc/ConsolePainter/issues)2MITPHPPHP &gt;=7.4CI failing

Since Jun 16Pushed 5y ago2 watchersCompare

[ Source](https://github.com/phpexpertsinc/ConsolePainter)[ Packagist](https://packagist.org/packages/phpexperts/console-painter)[ Docs](https://www.phpexperts.pro/)[ RSS](/packages/phpexperts-console-painter/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (8)Versions (4)Used By (2)

ConsolePainter
==============

[](#consolepainter)

[![TravisCI](https://camo.githubusercontent.com/0f20197be8edc5ec3c505b2d74f50aaef338aa8c6ba1540c755ddf10c4ca5a01/68747470733a2f2f7472617669732d63692e6f72672f70687065787065727473696e632f436f6e736f6c655061696e7465722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/phpexpertsinc/ConsolePainter)[![Test Coverage](https://camo.githubusercontent.com/f2a1b956fef756b6b9a18f77e2daf7c59aecda49105aba0fbecf12dbe8557459/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f31656566386336343335343832323665666136392f746573745f636f766572616765)](https://codeclimate.com/github/phpexpertsinc/ConsolePainter/test_coverage)

ConsolePainter is a PHP Experts, Inc., Project that enables easy color and stylization of ANSI terminals.

It strives to conform to the standard ANSI terminal colors as documented at [https://misc.flogisoft.com/bash/tip\_colors\_and\_formatting](https://misc.flogisoft.com/bash/tip_colors_and_formatting)

[![image](https://user-images.githubusercontent.com/1125541/59557043-0a774b00-8f95-11e9-87cb-223afd9130ca.png)](https://user-images.githubusercontent.com/1125541/59557043-0a774b00-8f95-11e9-87cb-223afd9130ca.png)

Installation
------------

[](#installation)

Via Composer

```
composer require phpexperts/console-painter
```

Usage
-----

[](#usage)

```
use PHPExperts\ConsolePainter\ConsolePainter;

$p = new ConsolePainter();

// This is *REALLY* emphasized!
echo "\t" . $p->italics('This is ') .
    $p->bold('*') . $p->bold()->underlined()->yellow('*REALLY*') .
    $p->bold()->onLightBlue(' emphasized*') . '!' . "\n";

echo $p->yellow('Press ')->bolder()->red('ENTER')->yellow(' to continue...') . "\n";

echo "\n";

// Draw the Red, White and Blue:
echo $p->bolder()->red('Red')->dim(', ')->italics()->white('White ')->dim('and ')->blue('Blue') . "\n";
```

This will output:

[![image](https://user-images.githubusercontent.com/1125541/59557118-15cb7600-8f97-11e9-9a0f-dc0b50898f79.png)](https://user-images.githubusercontent.com/1125541/59557118-15cb7600-8f97-11e9-9a0f-dc0b50898f79.png)

You can even make really complex ASCII art with it. Here is a derivation of the European Union logo:

[![image](https://user-images.githubusercontent.com/1125541/59557060-7659b380-8f95-11e9-98df-2a82bbdaae72.png)](https://user-images.githubusercontent.com/1125541/59557060-7659b380-8f95-11e9-98df-2a82bbdaae72.png)

Demos
-----

[](#demos)

### Basic styles:

[](#basic-styles)

[![image](https://user-images.githubusercontent.com/1125541/59557043-0a774b00-8f95-11e9-87cb-223afd9130ca.png)](https://user-images.githubusercontent.com/1125541/59557043-0a774b00-8f95-11e9-87cb-223afd9130ca.png)

### Complex text styling

[](#complex-text-styling)

[![image](https://user-images.githubusercontent.com/1125541/59557055-50ccaa00-8f95-11e9-8fa5-d435efc5d688.png)](https://user-images.githubusercontent.com/1125541/59557055-50ccaa00-8f95-11e9-8fa5-d435efc5d688.png)

### ASCII Art

[](#ascii-art)

[![image](https://user-images.githubusercontent.com/1125541/59557060-7659b380-8f95-11e9-98df-2a82bbdaae72.png)](https://user-images.githubusercontent.com/1125541/59557060-7659b380-8f95-11e9-98df-2a82bbdaae72.png)

Use cases
---------

[](#use-cases)

ConsolePainter: Stylization
✔ Can bold text
✔ Can italicize text
✔ Can underline text
✔ Can dim text
✔ Can blink text
✔ Can hide text
✔ Can invert the text style
✔ All combinations of stylizations work

ConsolePainter: Foreground Colors
✔ Can make the text the default color
✔ Can make the text black
✔ Can make the text dark grey
✔ Can make the text blue
✔ Can make the text light blue
✔ Can make the text green
✔ Can make the text light green
✔ Can make the text cyan
✔ Can make the text light cyan
✔ Can make the text red
✔ Can make the text light red
✔ Can make the text purple
✔ Can make the text light purple
✔ Can make the text brown
✔ Can make the text yellow
✔ Can make the text light gray
✔ Can make the text white
✔ Can chain two or more colored words together
✔ Can chain two or more colored words together with a background
✔ Can make the european union logo

Testing
-------

[](#testing)

```
phpunit --testdox
```

Contributors
------------

[](#contributors)

[Theodore R. Smith](https://www.phpexperts.pro/%5D)
GPG Fingerprint: 4BF8 2613 1C34 87AC D28F 2AD8 EB24 A91D D612 5690
CEO: PHP Experts, Inc.

License
-------

[](#license)

MIT license. Please see the [license file](LICENSE) for more information.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity61

Established project with proven stability

 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.

###  Release Activity

Cadence

Every ~327 days

Total

3

Last Release

1870d ago

PHP version history (2 changes)v1.0.0PHP ^7.1

v1.1.0PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/3f3a2dd16766f6b03c330e65aaca9dfb97f1bbbb41c5e2af5681f58f670b7917?d=identicon)[hopeseekr](/maintainers/hopeseekr)

---

Top Contributors

[![hopeseekr](https://avatars.githubusercontent.com/u/1125541?v=4)](https://github.com/hopeseekr "hopeseekr (19 commits)")

---

Tags

terminal colorsconsole-colorsbash colorsbash formatting

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/phpexperts-console-painter/health.svg)

```
[![Health](https://phpackages.com/badges/phpexperts-console-painter/health.svg)](https://phpackages.com/packages/phpexperts-console-painter)
```

###  Alternatives

[wp-cli/wp-cli

WP-CLI framework

5.0k17.2M320](/packages/wp-cli-wp-cli)[consolidation/annotated-command

Initialize Symfony Console commands from annotated command class methods.

22569.8M19](/packages/consolidation-annotated-command)[chi-teck/drupal-code-generator

Drupal code generator

26947.8M5](/packages/chi-teck-drupal-code-generator)[seld/cli-prompt

Allows you to prompt for user input on the command line, and optionally hide the characters they type

24725.8M17](/packages/seld-cli-prompt)[illuminate/console

The Illuminate Console package.

12944.1M5.1k](/packages/illuminate-console)[php-tui/php-tui

Comprehensive TUI library heavily influenced by Ratatui

589747.0k6](/packages/php-tui-php-tui)

PHPackages © 2026

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