toolstud-io/colorjizz-php8
最新稳定版本:v2.0.14
Composer 安装命令:
composer require toolstud-io/colorjizz-php8
包简介
Classes for manipulating colors, converting to different formats and finding color harmonies
README 文档
README
ColorJizz, but for PHP8.0+
Installation
composer require toolstud-io/colorjizz-php8
Converting between formats
ColorJizz can convert to and from any of the supported color formats:
<?php use MischiefCollective\ColorJizz\Formats\Hex; $red_hex = new Hex(0xFF0000); $red_cmyk = $hex->toCMYK(); echo get_class($red_cmyk); // MischiefCollective\ColorJizz\Formats\CMYK echo $red_cmyk; // 0,1,1,0 ?>
Any color manipulation or conversion will return a new instance of a color class, therefore your original color objects remains intact.
Color manipulation can be chained together:
<?php use MischiefCollective\ColorJizz\Formats\Hex; echo Hex::fromString('red')->hue(-20)->greyscale(); // 555555 ?>
Any color manipulation will always return the color in the same format unless you're specifically converting the format. For example:
<?php use MischiefCollective\ColorJizz\Formats\RGB; $red = new RGB(255, 0, 0); echo get_class($red->hue(-20)->saturation(2)); // MischiefCollective\ColorJizz\Formats\RGB ?>
###Supported formats:
<?php new RGB(r, g, b); new CMY(c, m, y); new CMYK(c, m, y, k); new Hex(0x000000); new HSV(h, s, v); new CIELab(l, a, b); new CIELCh(l, c, h); new XYZ(x, y, z); new Yxy(Y, x, y);
###Conversion functions:
<?php ->toRGB(); ->toCMY(); ->toCMYK(); ->toHex(); ->toHSV(); ->toCIELab(); ->toCIELCh(); ->toXYZ(); ->toYxy();
统计信息
- 总下载量: 803
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-03-18
