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 3w 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 62% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity17

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

1918d 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

[illuminate/console

The Illuminate Console package.

13046.0M6.4k](/packages/illuminate-console)[thermage/thermage

Thermage provides a fluent and incredibly powerful object-oriented interface for customizing CLI output text color, background, formatting, theming and more.

952.5k](/packages/thermage-thermage)[bvanhoekelen/terminal-style

Return your terminal message in style! Change the text style, text color and text background color form the terminal interface with ANSI color codes. The terminal style tool support Laravel and Composer.

19856.6k2](/packages/bvanhoekelen-terminal-style)[winbox/args

Windows command-line formatter

20720.9k21](/packages/winbox-args)[macopedia/magento2-categoryimporter

Category Importer for Magento 2

344.7k](/packages/macopedia-magento2-categoryimporter)

PHPackages © 2026

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