PHPackages                             hhpack/color - 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. hhpack/color

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

hhpack/color
============

Color package for Hack

1.3.0(7y ago)14712MITShell

Since Nov 3Pushed 7y agoCompare

[ Source](https://github.com/hhpack/color)[ Packagist](https://packagist.org/packages/hhpack/color)[ RSS](/packages/hhpack-color/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (5)Versions (28)Used By (2)

color
=====

[](#color)

[![Latest Stable Version](https://camo.githubusercontent.com/a5645002eaf433af5bc06645cfa0e4645f667c3141a25544d24233fd9a3c199b/68747470733a2f2f706f7365722e707567782e6f72672f68687061636b2f636f6c6f722f762f737461626c65)](https://packagist.org/packages/hhpack/color)[![CircleCI](https://camo.githubusercontent.com/16fc975e90d112e9490ab823e5a13bec1aaafca877e00743ced1774cf0eba6f2/68747470733a2f2f636972636c6563692e636f6d2f67682f68687061636b2f636f6c6f722f747265652f6d61737465722e7376673f7374796c653d737667)](https://circleci.com/gh/hhpack/color/tree/master)[![Dependency Status](https://camo.githubusercontent.com/505fd16287bed7a110b78750d4ace34c5e80e6dd771fb72673e6501d462fae7e/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f757365722f70726f6a656374732f3536333834386130653933353634303031373030303030312f62616467652e7376673f7374796c653d666c6174)](https://www.versioneye.com/user/projects/563848a0e935640017000001)[![License](https://camo.githubusercontent.com/771275e9769a090a14691fc62002fc9e7a770e6bab3b356d97c4b164d87ed287/68747470733a2f2f706f7365722e707567782e6f72672f68687061636b2f636f6c6f722f6c6963656e7365)](https://packagist.org/packages/hhpack/color)

[![ScreenShot](https://raw.githubusercontent.com/hhpack/color/master/screen-shot.png)](https://raw.githubusercontent.com/hhpack/color/master/screen-shot.png)

Basic usage
-----------

[](#basic-usage)

The user can output to stdout by specifying the color.

```
Color::fromColor(ForegroundColor::White)
    ->background(BackgroundColor::Green)
    ->println('%s succeeded.', 'Color package example');
```

or

```
$color = Color::fromColor(ForegroundColor::White)
    ->background(BackgroundColor::Green);
$color('%s succeeded.', 'Color package example');
```

Applying styles
---------------

[](#applying-styles)

The user can use the **applyTo** method in order to apply a style to text.

```
$text = Color::fromColor(ForegroundColor::White)
    ->background(BackgroundColor::Green)
    ->applyTo('target text');

echo $text;
```

Custom style for text
---------------------

[](#custom-style-for-text)

The user can pull the bold and underline.

```
Color::fromColor(ForegroundColor::White)
    ->addStyle(StyleType::Bold)
    ->addStyle(StyleType::Underlined)
    ->println('%s + %s', 'bold', 'underlined');
```

Run the test
------------

[](#run-the-test)

You can run the test with the following command.

```
composer install
composer test

```

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity73

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 ~59 days

Recently: every ~110 days

Total

22

Last Release

2641d ago

Major Versions

0.7.2 → 1.0.02017-01-25

### Community

Maintainers

![](https://www.gravatar.com/avatar/70c299d6d6015ee714954aa05e4d0e9c7b1d31318a5d7db5e9bb4e1f70f78afc?d=identicon)[holyshared](/maintainers/holyshared)

---

Top Contributors

[![holyshared](https://avatars.githubusercontent.com/u/167190?v=4)](https://github.com/holyshared "holyshared (85 commits)")

---

Tags

hacklanghhvmconsolecolorhack

### Embed Badge

![Health badge](/badges/hhpack-color/health.svg)

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

###  Alternatives

[symfony/console

Eases the creation of beautiful and testable command line interfaces

9.8k1.1B13.9k](/packages/symfony-console)[psy/psysh

An interactive shell for modern PHP.

9.8k582.3M821](/packages/psy-psysh)[nunomaduro/collision

Cli error handling for console/command-line PHP applications.

4.7k357.7M11.1k](/packages/nunomaduro-collision)[nunomaduro/termwind

It's like Tailwind CSS, but for the console.

2.5k271.5M386](/packages/nunomaduro-termwind)[kevinlebrun/colors.php

Colors for PHP CLI scripts

3427.0M46](/packages/kevinlebrun-colorsphp)[wp-cli/php-cli-tools

Console utilities for PHP

68227.8M374](/packages/wp-cli-php-cli-tools)

PHPackages © 2026

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