cjrasmussen/color 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-09-15