Skip to content

Latest commit

 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tailwind Colors

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

Tailwind Colors

Installation

composer require phpcolor/tailwind-colors:^1.0

The package works standalone. Install phpcolor/phpcolor only when using palette():

composer require phpcolor/phpcolor

Usage

Color names

use PhpColor\Colors\Tailwind\TailwindColors as Tailwind;

$colors = Tailwind::colors();

$names = $colors->getNames();
// 'slate', 'gray', 'zinc', 'neutral', 'stone', 'red', 'orange',
// 'amber', 'yellow', 'lime', 'green', 'emerald', 'teal', 'cyan',
// 'sky', 'blue', 'indigo', 'violet', 'purple', 'fuchsia', 'pink', 'rose'

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

PHPColor palette

use PhpColor\Color\Palette\ColorPaletteInterface;
use PhpColor\Colors\Tailwind\TailwindColors as Tailwind;

$palette = Tailwind::colors()->palette('teal');
assert($palette instanceof ColorPaletteInterface);

echo $palette->get(500)->toHex(); // #14b8a6

Calling palette() without phpcolor/phpcolor installed throws a LogicException with the installation command.


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.

About

Color palettes used in Tailwind interfaces

Topics

Resources

Code of conduct

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Used by

Contributors

Languages