hhpack/color
最新稳定版本:1.3.0
Composer 安装命令:
composer require hhpack/color
包简介
Color package for Hack
README 文档
README
Basic usage
The user can output to stdout by specifying the color.
Color::fromColor(ForegroundColor::White) ->background(BackgroundColor::Green) ->println('%s succeeded.', 'Color package example');
or
$color = Color::fromColor(ForegroundColor::White) ->background(BackgroundColor::Green); $color('%s succeeded.', 'Color package example');
Applying styles
The user can use the applyTo method in order to apply a style to text.
$text = Color::fromColor(ForegroundColor::White) ->background(BackgroundColor::Green) ->applyTo('target text'); echo $text;
Custom style for text
The user can pull the bold and underline.
Color::fromColor(ForegroundColor::White) ->addStyle(StyleType::Bold) ->addStyle(StyleType::Underlined) ->println('%s + %s', 'bold', 'underlined');
Run the test
You can run the test with the following command.
composer install
composer test
统计信息
- 总下载量: 471
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-11-02
