This package provides access to the color palettes used in Pico CSS.
composer require phpcolor/pico-colors:^1.0The package works standalone. Install phpcolor/phpcolor only when using palette():
composer require phpcolor/phpcoloruse 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', 'grey', 'zinc', 'slate'use PhpColor\Colors\Pico\PicoColors as Pico;
$colors = Pico::colors();
$shades = $colors->getShades();
// 50, 100, 150, ... ,850, 900, 950use 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); // #017FC0use PhpColor\Color\Palette\ColorPaletteInterface;
use PhpColor\Colors\Pico\PicoColors as Pico;
$palette = Pico::colors()->palette('azure');
assert($palette instanceof ColorPaletteInterface);
echo $palette->get(500)->toHex(); // #017fc0Calling palette() without phpcolor/phpcolor installed throws a LogicException with the installation command.
The colors listed in this project are based on the colors used by Pico.
This PHPColor package is released under the MIT license.