Skip to content

Commit 51b221b

Browse files
authored
Merge pull request #1 from wujunze/dev
update README
2 parents b7703dc + 2e59274 commit 51b221b

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,27 @@
11
# php-cli-color
22
Simple and easy to use the PHP command-line output of color
3+
4+
5+
## Installation
6+
7+
composer require lijinma/php-cli-color '~1.0'
8+
9+
## How to use
10+
```php
11+
<?php
12+
13+
require_once __DIR__ . './../vendor/autoload.php';
14+
15+
$colors = new Wujunze\Colors();
16+
// Test some basic printing with Colors class
17+
echo $colors->getColoredString("Testing Colors class, this is purple string on yellow background.", "purple", "yellow") . PHP_EOL;
18+
echo $colors->getColoredString("Testing Colors class, this is blue string on light gray background.", "blue", "light_gray") . PHP_EOL;
19+
echo $colors->getColoredString("Testing Colors class, this is red string on black background.", "red", "black") . PHP_EOL;
20+
echo $colors->getColoredString("Testing Colors class, this is cyan string on green background.", "cyan", "green") . PHP_EOL;
21+
echo $colors->getColoredString("Testing Colors class, this is cyan string on default background.", "cyan") . PHP_EOL;
22+
echo $colors->getColoredString("Testing Colors class, this is default string on cyan background.", null, "cyan") . PHP_EOL;
23+
```
24+
25+
## run result
26+
27+
![code run result](https://camo.githubusercontent.com/5509dd50a0f9fb194a6bc2a36153934e3d74e1d9/687474703a2f2f7777342e73696e61696d672e636e2f6c617267652f303036306c6d3754677931666470747672373062646a33306e6c3037327a6c642e6a7067)

0 commit comments

Comments
 (0)