定制 watson/colortime 二次开发

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

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

watson/colortime

最新稳定版本:1.0.0

Composer 安装命令:

composer require watson/colortime

包简介

See time as color.

README 文档

README

Build Status Dependency Status Total Downloads Latest Stable Version Latest Unstable Version License

Get time as a hexadecimal color, like the color clock.

For example, 10:10:10 AM will have a hex value of #101010.

Installation

Easy, use Composer! If you're yet to be enlightened by dependency management or like a challenge, copy the code in manually.

composer require "watson/colortime"

Usage

Create a new instance and pass in the DateTime instance you want to use, or use the factory to get an instance for right now.

// Using a specific time.
$datTime = DateTime::createFromFormat('H:i:s', '10:10:10');

$colorTime = new \Watson\ColorTime\ColorTime($dateTime);

// Using the current time (you could also pass a DateTime instance to the factory if you so desired).
$colorTime = \Watson\ColorTime\ColorTime::make();

To get the time as a hex value, simply call the hex() method.

$hex = $colorTime->hex(); // '#101010'

Spellcheck

If you'd rather spell colour correctly, simply subclass the ColorTime instance into your own application and use that instead.

This is just a joke, don't do this. Unless you want to, in which case feel free.

class ColourTime extends \Watson\ColorTime\ColorTime {}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-09-25