PHP code example of tgmedia / php-colouring

1. Go to this page and download the library: Download tgmedia/php-colouring 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/ */

    

tgmedia / php-colouring example snippets



use Tgmedia\PhpColouring\Colouring;

// initiate class passing through colour as hex
$colouring = new Colouring('#666666');

// darken colour by 40%
echo $colouring->darken(40);

// lighten colour by 20%
echo $colouring->lighten(20);