PHP code example of phpcolor / pico-colors

1. Go to this page and download the library: Download phpcolor/pico-colors 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/ */

    

phpcolor / pico-colors example snippets


use PhpColor\Colors\Pico\PicoColors as Pico;

$colors = Pico::colors();

$names = $colors->getNames(); 
// 'red', 'pink', 'fuchsia', 'purple', 'violet', 'indigo'
// 'blue', 'azure', 'cyan', 'jade', 'green', 'lime', 'yellow',
// 'amber', 'pumpkin', 'orange', 'sand', 'gray', 'zinc' 

use PhpColor\Colors\Pico\PicoColors as Pico;

$colors = Pico::colors();

$shades = $colors->getShades(); 
// 50, 100, 150, ... ,850, 900, 950

use PhpColor\Colors\Pico\PicoColors as Pico;

$colors = Pico::colors();

echo $colors->azure;             // #017fc0       
echo $colors->azure();           // #017fc0
echo $colors->azure(500)         // #017fc0

echo $colors->get('azure');      // #017fc0
echo $colors->get('azure', 500); // #017fc0