cjrasmussen/color
最新稳定版本:2.0.1
Composer 安装命令:
composer require cjrasmussen/color
包简介
Simple functions for color conversion and analysis
README 文档
README
Simple functions for color conversion and analysis.
Usage
use cjrasmussen\Color\ColorType\Hex; use cjrasmussen\Color\ColorType\Rgb; use cjrasmussen\Color\General; $rgb = new Rgb(153, 51, 51); $hex = $rgb->toHex(); echo $hex; // 993333 $is_hex = General::isHexColor('993333'); echo $is_hex; // true $hex = new Hex('993333'); $rgb = $hex->toRgb();
There are no methods for directly converting Hex/HSL/HSV to Hex/HSL/HSV (or for getting luminence of Hex/HSL/HSV) but RGB can be used as a stepping-stone.
$hsl = (new Hex('#800'))->toRgb()->toHsl();
Installation
Simply add a dependency on cjrasmussen/color to your composer.json file if you use Composer to manage the dependencies of your project:
composer require cjrasmussen/color
Although it's recommended to use Composer, you can actually include the file(s) any way you want.
License
Color is MIT licensed.
统计信息
- 总下载量: 173
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-09-15