PHP code example of ksubileau / color-thief-php

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

    

ksubileau / color-thief-php example snippets



use ColorThief\ColorThief;
$dominantColor = ColorThief::getColor($sourceImage);

ColorThief::getColor($sourceImage[, $quality=10, $area=null, $outputFormat='array', $adapter = null])


use ColorThief\ColorThief;
$palette = ColorThief::getPalette($sourceImage, 8);

ColorThief::getPalette($sourceImage[, $colorCount=10, $quality=10, $area=null, $outputFormat='array', $adapter = null])
bash
composer