PHP code example of reinbier / php-tailwind-colors

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

    

reinbier / php-tailwind-colors example snippets


use Reinbier\PhpTailwindColors\Color;

$colors = [
    'danger' => Color::Red,
    'gray' => Color::Zinc,
    'info' => Color::Blue,
    'primary' => Color::Indigo,
    'success' => Color::Green,
    'warning' => Color::Amber,
];

use Reinbier\PhpTailwindColors\Facades\TailwindColor;

TailwindColor::register([
    'danger' => [
        50 => '254, 242, 242',
        100 => '254, 226, 226',
        200 => '254, 202, 202',
        300 => '252, 165, 165',
        400 => '248, 113, 113',
        500 => '239, 68, 68',
        600 => '220, 38, 38',
        700 => '185, 28, 28',
        800 => '153, 27, 27',
        900 => '127, 29, 29',
        950 => '69, 10, 10',
    ],
]);

use Reinbier\PhpTailwindColors\Color;
use Reinbier\PhpTailwindColors\Facades\TailwindColor;

TailwindColor::register([
    'danger' => Color::hex('#ff0000'),
]);

use Reinbier\PhpTailwindColors\Color;
use Reinbier\PhpTailwindColors\Facades\TailwindColor;

TailwindColor::register([
    'danger' => Color::rgb('rgb(255, 0, 0)'),
]);

use Reinbier\PhpTailwindColors\Color;
use Reinbier\PhpTailwindColors\Facades\TailwindColor;

TailwindColor::register([
    'mycolor' => Color::hex('#ffff00'),
]);
bash
composer