watson/colortime

This package is abandoned and no longer maintained. No replacement package was suggested.

See time as color.

Maintainers

👁 dwightwatson

Package info

github.com/dwightwatson/colortime

pkg:composer/watson/colortime

Statistics

Installs: 12

Dependents: 0

Suggesters: 0

Stars: 3

Open Issues: 0

1.0.0 2015-09-25 01:50 UTC

Requires

  • php: >=5.3.0

Requires (Dev)

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT 669b8cfdf61fc2b00d9eabdfa4563ec384f14746

  • Dwight Watson <dwight.woop@studiousapp.com>

colordatetimeclock

This package is auto-updated.

Last update: 2020-12-17 10:04:15 UTC


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 {}