PHPackages                             antibiotics11/ansi-styler - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. antibiotics11/ansi-styler

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

antibiotics11/ansi-styler
=========================

Utility for applying ANSI colors and text styles to console output.

v1.0(2y ago)0101MITPHP

Since Apr 15Pushed 2y ago1 watchersCompare

[ Source](https://github.com/antibiotics11/ansi-styler)[ Packagist](https://packagist.org/packages/antibiotics11/ansi-styler)[ RSS](/packages/antibiotics11-ansi-styler/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

ansi-styler
===========

[](#ansi-styler)

A PHP utility for applying ANSI colors and text styles to console output.

```
use antibiotics11\AnsiStyler\{AnsiColorCode, AnsiFormatter};

// create a new AnsiFormatter instance
$styler = new AnsiFormatter();

// apply yellow background color, red foreground color and bold style
$formattedText = $styler->withBackgroundColor(AnsiColorCode::BACKGROUND_YELLOW)
                        ->withForegroundColor(AnsiColorCode::FOREGROUND_RED)
                        ->withBold()
                        ->format("Hello, World!");

printf("%s\r\n", $formattedText);

// reinitialize the AnsiFormatter
$styler->initialize();
```

[![screenshot](https://private-user-images.githubusercontent.com/75349747/322397766-763e052e-978f-49f9-abc7-398502a26a7b.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzM5OTc2MzEsIm5iZiI6MTc3Mzk5NzMzMSwicGF0aCI6Ii83NTM0OTc0Ny8zMjIzOTc3NjYtNzYzZTA1MmUtOTc4Zi00OWY5LWFiYzctMzk4NTAyYTI2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bXotU2lnbmVkSGVhZGVycz1ob3N0In0.M-GjlRNsSGNDXeUsIbNsMqpfrPkSXQWoIN8oeTbMKmc)

Requirements
------------

[](#requirements)

- PHP &gt;= 8.1

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

[](#installation)

```
composer require antibiotics11/ansi-styler
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community8

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

757d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/71744f1798505964b70af43a9ad703a51e99e4069a051731e03378290613f57d?d=identicon)[antibiotics11](/maintainers/antibiotics11)

---

Top Contributors

[![antibiotics11](https://avatars.githubusercontent.com/u/75349747?v=4)](https://github.com/antibiotics11 "antibiotics11 (8 commits)")

### Embed Badge

![Health badge](/badges/antibiotics11-ansi-styler/health.svg)

```
[![Health](https://phpackages.com/badges/antibiotics11-ansi-styler/health.svg)](https://phpackages.com/packages/antibiotics11-ansi-styler)
```

###  Alternatives

[log1x/acf-composer

Create fields, blocks, option pages, and widgets using ACF Builder and Sage 10

493760.2k13](/packages/log1x-acf-composer)[markrogoyski/ipv4-subnet-calculator

Network calculator for subnet mask and other classless (CIDR) network information.

177813.7k6](/packages/markrogoyski-ipv4-subnet-calculator)[b13/menus

Easy and fast menus for TYPO3 Frontends

58534.7k1](/packages/b13-menus)[hfig/mapi

Pure PHP library for reading and manipulating Microsoft Outlook .msg messages (MAPI documents)

40420.9k2](/packages/hfig-mapi)

PHPackages © 2026

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