定制 alistairshaw/name-the-color 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

alistairshaw/name-the-color

Composer 安装命令:

composer require alistairshaw/name-the-color

包简介

Provide color names from hex values and hex values for color names

README 文档

README

Via Composer

$ composer require alistairshaw/name-the-color:0.1.*

Usage

require 'vendor/autoload.php';

use AlistairShaw\NameTheColor\ColorMaker;

// You can get a Color object from a hex code. It will find the closest named color to your hex.
$color = ColorMaker::fromHex('#FF0000');

// or from the name of the color
$color = ColorMaker::fromString('Red');

// once you have the color object you can get the resulting color like so:
echo $color->getName() . ' - ' . $color->getHex() . ' (' . $color->getOriginalHex() . ')';

Contributing

Contributions are very welcome and will be fully credited, just please make sure to add tests.

Credits

Lots of credit to Chirag Mehta who came up with this in Javascript back in 2007. (http://chir.ag/projects/ntc/). The list of colors comes from his website as well as the method for converting hex codes.

License

The MIT License (MIT).

统计信息

  • 总下载量: 1.91k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-04-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固