Skip to content

Commit

Permalink
Merge pull request #1 from wujunze/dev
Browse files Browse the repository at this point in the history
update README
  • Loading branch information
wujunze authored Mar 17, 2017
2 parents b7703dc + 2e59274 commit 51b221b
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,27 @@
# php-cli-color
Simple and easy to use the PHP command-line output of color


## Installation

composer require lijinma/php-cli-color '~1.0'

## How to use
```php
<?php

require_once __DIR__ . './../vendor/autoload.php';

$colors = new Wujunze\Colors();
// Test some basic printing with Colors class
echo $colors->getColoredString("Testing Colors class, this is purple string on yellow background.", "purple", "yellow") . PHP_EOL;
echo $colors->getColoredString("Testing Colors class, this is blue string on light gray background.", "blue", "light_gray") . PHP_EOL;
echo $colors->getColoredString("Testing Colors class, this is red string on black background.", "red", "black") . PHP_EOL;
echo $colors->getColoredString("Testing Colors class, this is cyan string on green background.", "cyan", "green") . PHP_EOL;
echo $colors->getColoredString("Testing Colors class, this is cyan string on default background.", "cyan") . PHP_EOL;
echo $colors->getColoredString("Testing Colors class, this is default string on cyan background.", null, "cyan") . PHP_EOL;
```

## run result

![code run result](https://camo.githubusercontent.com/5509dd50a0f9fb194a6bc2a36153934e3d74e1d9/687474703a2f2f7777342e73696e61696d672e636e2f6c617267652f303036306c6d3754677931666470747672373062646a33306e6c3037327a6c642e6a7067)

0 comments on commit 51b221b

Please sign in to comment.