phpexperts/console-painter
Composer 安装命令:
composer require phpexperts/console-painter
包简介
A quick and easy library for colorizing and stylizing ANSI consoles.
README 文档
README
ConsolePainter is a PHP Experts, Inc., Project that enables easy color and stylization of ANSI terminals.
It strives to conform to the standard ANSI terminal colors as documented at https://misc.flogisoft.com/bash/tip_colors_and_formatting
Installation
Via Composer
composer require phpexperts/console-painter
Usage
use PHPExperts\ConsolePainter\ConsolePainter; $p = new ConsolePainter(); // This is *REALLY* emphasized! echo "\t" . $p->italics('This is ') . $p->bold('*') . $p->bold()->underlined()->yellow('*REALLY*') . $p->bold()->onLightBlue(' emphasized*') . '!' . "\n"; echo $p->yellow('Press ')->bolder()->red('ENTER')->yellow(' to continue...') . "\n"; echo "\n"; // Draw the Red, White and Blue: echo $p->bolder()->red('Red')->dim(', ')->italics()->white('White ')->dim('and ')->blue('Blue') . "\n";
This will output:
You can even make really complex ASCII art with it. Here is a derivation of the European Union logo:
Demos
Basic styles:
Complex text styling
ASCII Art
Use cases
ConsolePainter: Stylization
✔ Can bold text
✔ Can italicize text
✔ Can underline text
✔ Can dim text
✔ Can blink text
✔ Can hide text
✔ Can invert the text style
✔ All combinations of stylizations work
ConsolePainter: Foreground Colors
✔ Can make the text the default color
✔ Can make the text black
✔ Can make the text dark grey
✔ Can make the text blue
✔ Can make the text light blue
✔ Can make the text green
✔ Can make the text light green
✔ Can make the text cyan
✔ Can make the text light cyan
✔ Can make the text red
✔ Can make the text light red
✔ Can make the text purple
✔ Can make the text light purple
✔ Can make the text brown
✔ Can make the text yellow
✔ Can make the text light gray
✔ Can make the text white
✔ Can chain two or more colored words together
✔ Can chain two or more colored words together with a background
✔ Can make the european union logo
Testing
phpunit --testdox
Contributors
Theodore R. Smith theodore@phpexperts.pro
GPG Fingerprint: 4BF8 2613 1C34 87AC D28F 2AD8 EB24 A91D D612 5690
CEO: PHP Experts, Inc.
License
MIT license. Please see the license file for more information.
统计信息
- 总下载量: 120
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 11
- 点击次数: 6
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-06-15



