Download the PHP package troublete/crayon without Composer
On this page you can find all versions of the php package troublete/crayon. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download troublete/crayon
More information about troublete/crayon
Files in troublete/crayon
Package crayon
Short Description A simple functional PHP library for formatting string output
License GPL-2.0
Informations about the package crayon
Crayon
A simple functional PHP library for formatting string output π
Preview
Install
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 > italic > bold > 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
API
Crayon\Font
->bold()
β sets text bold
->italic()
β sets text italic
->underline()
β sets text underlined
->red()
β sets text color to red
->green()
β sets text color to green
->yellow()
β sets text color to yellow
->blue()
β sets text color to blue
->magenta()
β sets text color to magenta
->cyan()
β sets text color to cyan
->background()
β turns coloring from fore to background coloring
License
GPL-2.0 Β© Willi EΓer