2017 © Pedro Peláez
 

library php-cli-colours

A small library for using colours in CLI scripts

image

danieljharvey/php-cli-colours

A small library for using colours in CLI scripts

  • Saturday, May 6, 2017
  • by danieljharvey
  • Repository
  • 0 Watchers
  • 0 Stars
  • 551 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 12 % Grown

The README.md

php-cli-colours

I like my CLI scripts to be colourful and with this library I hope to achieve said colours, (*1)

Example usage, (*2)

include 'BashColours.php';
$bashColours=new \DanielJHarvey\CLIColours\BashColours();

echo "I am writing a nice CLI script and ".$bashColours->formatString("BANG!", 'red')." I need exciting things to happen\n";

echo $bashColours->formatString("But now everything is fine and stuff",'default','green');

Or now you can change forecolor with a big heap of shortcut functions:, (*3)

include 'BashColours.php';
$colour=new \DanielJHarvey\CLIColours\BashColours();

echo $colour->red("red")." and ".$colour->yellow("yellow")." and ".$colour->lightMagenta("pink")." and ".$colour->green("green")."...\n";

The full set of foreground and background colors from this list are implemented:, (*4)

http://misc.flogisoft.com/bash/tip_colors_and_formatting, (*5)

Will consider adding bold/italic/blink etc later., (*6)

The Versions

06/05 2017

dev-master

9999999-dev

A small library for using colours in CLI scripts

  Sources   Download

MIT

by Daniel Harvey

06/05 2017

1.2.0

1.2.0.0

A small library for using colours in CLI scripts

  Sources   Download

MIT

by Daniel Harvey

10/04 2017

1.0.0

1.0.0.0

A small library for using colours in CLI scripts

  Sources   Download

MIT

by Daniel Harvey