PHP code example of watson / colortime

1. Go to this page and download the library: Download watson/colortime library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

watson / colortime example snippets


// 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();

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

class ColourTime extends \Watson\ColorTime\ColorTime {}