PHPackages                             troublete/crayon - 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. troublete/crayon

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

troublete/crayon
================

A simple functional PHP library for formatting string output

1.2.0(8y ago)216614GPL-2.0PHPPHP &gt;=7.0

Since Sep 16Pushed 8y ago1 watchersCompare

[ Source](https://github.com/troublete/crayon)[ Packagist](https://packagist.org/packages/troublete/crayon)[ RSS](/packages/troublete-crayon/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (3)Dependencies (1)Versions (4)Used By (4)

Crayon
======

[](#crayon)

> A simple functional PHP library for formatting string output 🌈

[![Build Status](https://camo.githubusercontent.com/982302f2423adebadf1a3924769658a95a9f8214fddabc6f6385f2ffdba1e46d/68747470733a2f2f7472617669732d63692e6f72672f74726f75626c6574652f637261796f6e2e737667)](https://travis-ci.org/troublete/crayon)[![Reliability](https://camo.githubusercontent.com/79b7f847bb858001d2d5054dee9d535c75863fd004f8159c86a3d119880dfbe8/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d637261796f6e2d6c696272617279266d65747269633d72656c696162696c6974795f726174696e67)](https://sonarcloud.io/dashboard/index/crayon-library)

Preview
-------

[](#preview)

[![preview](preview.png)](preview.png)

Install
-------

[](#install)

```
$ composer require troublete/crayon
```

Introduction
------------

[](#introduction)

The purpose of the library is to simplify the usage of formatting of strings on the PHP CLI. The usage should be strictly a functional one, to write the least code with the biggest impact. Simple use the function `Crayon\text` which returns a `Crayon\Font` instance which handles the formatting and return as string. Formatting calls may be chained.

> ⚠️ Be aware that there is a formatting order: underline &gt; italic &gt; bold &gt; color. Last color set will be used and that italic weighs more than bold formatting. So if both options are set the prior one will be used.

Usage
-----

[](#usage)

```
