PHP Bash 文字彩色组件:overtrue/bash-color
又没忍住造了一个轮子,与 symfony 的 Console 组件中的彩色部分类似:
use Overtrue\BashColor\BashColor;
echo BashColor::render('<fg=green>Are you sure ?</><fg=yellow> [Y/n]:</>'), "\n";
echo BashColor::render('<fg=green;opt=underlined>yes!</>'), "\n";
echo BashColor::render('<fg=red>hello world!</>'), "\n";
echo BashColor::render('<fg=cyan;opt=bold;bg=red>ugly!</>'), "\n";
结果:
欢迎各位star: https://github.com/overtrue/bash-color :kiss: :kiss: :kiss:
轮子超 +1 :+1:
超哥顶, :+1: , 最近用了好多你写的组件, 真心棒!