承接 kennwilson/colormap 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

kennwilson/colormap

Composer 安装命令:

composer require kennwilson/colormap

包简介

Colormap from KennWilson (composer added by hidabe)

README 文档

README

Author: Kenn Wilson

Author URL: http://www.corvidworks.com/

Project URL: http://www.corvidworks.com/projects/colormap/

Description

Colormap provides helper methods to convert colors between different formats used on the web. Supported formats are:

  • Six-character hexadecimal (eg, #000000)
  • Three-character hexadecimal (eg, #000)
  • RGB (eg, rgb(0,0,0))
  • HTML named color, including non-W3C colors (eg, black)

Three character hex codes are normalized to six characters and all input is normalized to lowercase. Colors can be converted from any one of these formats to any other.

This library was extracted from Hextractor.

Usage

Include class and instantiate a ColorMap object:

include_once "colormap.php";
$map = new ColorMap();

Call various methods, as needed:

$hex  = $map->rgb_to_hex('119 125 66');        // Returns '#777d42'
$rgb  = $map->hex_to_rgb('#777d42', 'string'); // Returns '119 125 66'
$name = $map->hex_to_name('#ffffff');          // Returns 'white'

Documentation

Additional information can be found at:

http://www.corvidworks.com/projects/colormap/

License

This code is released under the terms of the MIT License and is free to use and redistribute for any purpose. If you find this code helpful, a link back to my site would be cool, but it’s not required.

统计信息

  • 总下载量: 968
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-06-23