Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wujunze/php-cli-color
Simple and easy to use the PHP command-line output of color
https://github.com/wujunze/php-cli-color
php php-cli php-library terminal
Last synced: 22 days ago
JSON representation
Simple and easy to use the PHP command-line output of color
- Host: GitHub
- URL: https://github.com/wujunze/php-cli-color
- Owner: wujunze
- License: mit
- Created: 2017-03-17T05:48:19.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-12-12T12:32:43.000Z (almost 6 years ago)
- Last Synced: 2024-09-20T01:48:14.449Z (about 2 months ago)
- Topics: php, php-cli, php-library, terminal
- Language: PHP
- Size: 31.3 KB
- Stars: 41
- Watchers: 4
- Forks: 17
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# php-cli-color
Simple and easy to use the PHP command-line output of color[![Build Status](https://travis-ci.org/wujunze/php-cli-color.svg?branch=master)](https://travis-ci.org/wujunze/php-cli-color)
[![codecov](https://codecov.io/gh/wujunze/php-cli-color/branch/master/graph/badge.svg)](https://codecov.io/gh/wujunze/php-cli-color)
[![Latest Stable Version](https://poser.pugx.org/wujunze/php-cli-color/v/stable)](https://packagist.org/packages/wujunze/php-cli-color) [![Total Downloads](https://poser.pugx.org/wujunze/php-cli-color/downloads)](https://packagist.org/packages/wujunze/php-cli-color) [![License](https://poser.pugx.org/wujunze/php-cli-color/license)](https://packagist.org/packages/wujunze/php-cli-color)## Installation
`composer require wujunze/php-cli-color`
## How to use
```php
getColoredString("Testing Colors class, this is purple string on yellow background.", "purple", "yellow");
echo $colors->getColoredString("Testing Colors class, this is blue string on light gray background.", "blue", "light_gray");
echo $colors->getColoredString("Testing Colors class, this is red string on black background.", "red", "black");
echo $colors->getColoredString("Testing Colors class, this is cyan string on green background.", "cyan", "green");
echo $colors->getColoredString("Testing Colors class, this is cyan string on default background.", "cyan");
echo $colors->getColoredString("Testing Colors class, this is default string on cyan background.", null, "cyan");
```## run result
![code run result](https://camo.githubusercontent.com/5509dd50a0f9fb194a6bc2a36153934e3d74e1d9/687474703a2f2f7777342e73696e61696d672e636e2f6c617267652f303036306c6d3754677931666470747672373062646a33306e6c3037327a6c642e6a7067)