phpcolor/tailwind-colors

Tailwind Colors - PHP Color Palette

v0.1.2 2024-04-14 02:08 UTC

This package is auto-updated.

Last update: 2024-12-01 00:15:51 UTC


README

This package provides access to the color palettes used in Tailwind interfaces.

Tailwind Colors

Installation

composer require phpcolor/tailwind-colors

Usage

Color names

use PhpColor\Colors\Tailwind\TailwindColors as Tailwind;

$colors = Tailwind::colors();

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

Color shades

use PhpColor\Colors\Tailwind\TailwindColors as Tailwind;

$colors = Tailwind::colors();

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

Color values

use PhpColor\Colors\Tailwind\TailwindColors as Tailwind;

$colors = Tailwind::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

Tailwind Colors

Credits

The colors listed in this project are based on the colors used by TailwindCss.

License

This PHPColor package is released under the MIT license.