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 1mo ago

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 14% 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

[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)
