PHPackages                             chonla/colr - 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. chonla/colr

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

chonla/colr
===========

Command line colorizer

09PHP

Since Sep 14Pushed 10y ago1 watchersCompare

[ Source](https://github.com/chonla/Colr)[ Packagist](https://packagist.org/packages/chonla/colr)[ RSS](/packages/chonla-colr/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

Colr
====

[](#colr)

Command line colorizer

API
---

[](#api)

```
$colr = new Colr;  // or
$colr = new Colr(array(
    "ok" => array("fg" => Colr::BLACK, "bg" => Colr::GREEN)
));
```

Use `fg()` to set foreground color:

```
$colr->fg(Colr::GREEN);
```

Use `bg()` to set background color:

```
$colr->bg(Colr::GREEN);
```

Use `set()` to select predefined preset:

```
$colr = new Colr(array(
    "ok" => array("fg" => Colr::BLACK, "bg" => Colr::GREEN)
));
$colr->set("ok");
```

Use `write()` to echo some text:

```
$colr->write("hello");
```

Use `writeln()` to echo some text with new line:

```
$colr->writeln("hello");
```

Method chaining:

```
$colr->fg(Color::GREEN)->write("hello");
```

license
-------

[](#license)

MIT:

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

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/75bc2a7e074d8de6c62a4ab4ebb97c4aa1bec260d3cf39018b5c4de00215f401?d=identicon)[chonla](/maintainers/chonla)

---

Top Contributors

[![chonla](https://avatars.githubusercontent.com/u/1852635?v=4)](https://github.com/chonla "chonla (3 commits)")

### Embed Badge

![Health badge](/badges/chonla-colr/health.svg)

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

###  Alternatives

[illuminate/console

The Illuminate Console package.

13046.0M6.5k](/packages/illuminate-console)[styleci/cli

The CLI tool for StyleCI

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

Windows command-line formatter

20720.9k21](/packages/winbox-args)[tomatophp/filament-artisan

Simple but yet powerful library for running some artisan commands for FilamentPHP

3275.4k1](/packages/tomatophp-filament-artisan)

PHPackages © 2026

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