PHP Class Cml\Console\Format\Colour

See also: http://www.linuxselfhelp.com/howtos/Bash-Prompt/Bash-Prompt-HOWTO-6.html
ファイルを表示 Open project: linhecheng/cmlphp Class Usage Examples

Public Methods

Method Description
__callStatic ( string $method, array $args ) : string 静态方法
colour ( string $text, string | array | integer $foregroundColors = null, string | integer $backgroundColors = null ) : string 返回格式化后的字符串
setNoAnsi ( ) 不输出 ansi字符

Private Methods

Method Description
charToCode ( integer | string | array $color ) : array 返回颜色对应的数字编码

Method Details

__callStatic() public static method

静态方法
public static __callStatic ( string $method, array $args ) : string
$method string
$args array
return string

colour() public static method

返回格式化后的字符串
public static colour ( string $text, string | array | integer $foregroundColors = null, string | integer $backgroundColors = null ) : string
$text string 要着色的文本
$foregroundColors string | array | integer 前景色 eg: red、red+highlight、Colors::BLACK、[Colors::BLACK, Colors::HIGHLIGHT]
$backgroundColors string | integer 背景色
return string

setNoAnsi() public static method

不输出 ansi字符
public static setNoAnsi ( )