rgb / hsl / hsb / hex 颜色转换库

dev-master 2021-03-09 04:19 UTC

This package is auto-updated.

Last update: 2024-09-09 12:08:17 UTC


README

https://github.com/carloscabo/colz-php 分叉,使用原始仓库

创建新的颜色对象。

use Colz;

# 'hex' is default color mode
$color = new Colz\Colz( '#fabada', 'hex');

# Other Available color modes
$rgb   = new Colz\Colz( [ 9, 155, 213 ],   'rgb');
$rgbF  = new Colz\Colz( [ 0.035294117647059, 0.6078431372549, 0.83529411764706 ],  'rgbF');
$rgbLI = new Colz\Colz( 629717, 'rgbLI');
$bgrLI = new Colz\Colz( 13998857, 'bgrLI');
$hsl   = new Colz\Colz( [ 197, 92, 44 ],   'hsl');
$hslF  = new Colz\Colz( [ 0.54722222222222, 0.92, 0.44 ],  'hslF');

执行测试

MacOS / Linux

composer install
./vendor/bin/phpunit

在 Windows 中

composer install
vendor\bin\phpunit.bat