phpcolor/primer-colors

Primer 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:52 UTC


README

This package provides access to the color palettes used in Primer CSS.

Primer Colors

Installation

composer require phpcolor/primer-colors

Usage

Color themes

use PhpColor\Colors\Primer\PrimerColors as Primer;

$colors = Primer::colors();
$colors = Primer::colors('light');

$colors = Primer::colors('dark');

Color names

use PhpColor\Colors\Primer\PrimerColors as Primer;

$colors = Primer::colors();

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

Color shades

use PhpColor\Colors\Primer\PrimerColors as Primer;

$colors = Primer::colors();

$shades = $colors->getShades(); 
// 0, 1, 2, 3, 4, 5, 6, 7, 8, 9

Color values

use PhpColor\Colors\Primer\PrimerColors as Primer;

$colors = Primer::colors();

echo $colors->coral;           // #C4432B       
echo $colors->coral();         // #C4432B
echo $colors->coral(5)         // #C4432B

echo $colors->get('coral');    // #C4432B
echo $colors->get('coral', 5); // #C4432B

Primer Colors

Credits

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

License

This PHPColor package is released under the MIT license.