PHP code example of phpcolor / bootstrap-colors

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


use PhpColor\Colors\Bootstrap\PicoColors as Bootstrap;

$colors = Bootstrap::colors();

$names = $colors->getNames(); 
// 'blue', 'indigo', 'purple', 'pink', 'red', 'orange'
// 'yellow', 'green', 'teal', 'cyan', 'gray'

use PhpColor\Colors\Bootstrap\PicoColors as Bootstrap;

$colors = Bootstrap::colors();

$shades = $colors->getShades(); 
// 100,  200,  300,  400,  500,  600,  700,  800,  900

use PhpColor\Colors\Bootstrap\PicoColors as Bootstrap;

$colors = Bootstrap::colors();

echo $colors->teal;             // #14b8a6       
echo $colors->teal();           // #14b8a6
echo $colors->teal(500)         // #14b8a6

echo $colors->get('teal');      // #14b8a6
echo $colors->get('teal', 500); // #14b8a6