Skip to content

Latest commit

 

History

History
70 lines (44 loc) · 1.52 KB

README.md

File metadata and controls

70 lines (44 loc) · 1.52 KB

Dracula Colors

This package provides access to the Dracula color palette, a dark theme for code editors and terminal applications.

Installation

composer require phpcolor/dracula-colors:^1.0

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

composer require phpcolor/phpcolor

Usage

Create Colors Instance

use PhpColor\Colors\Dracula\DraculaColors as Dracula;

$colors = Dracula::colors();

Color Names

use PhpColor\Colors\Dracula\DraculaColors as Dracula;

$colors = Dracula::colors();

$names = $colors->getNames();
// 'background', 'currentLine', 'foreground', 'comment',
// 'cyan', 'green', 'orange', 'pink', 'purple', 'red', 'yellow'

Color Values

use PhpColor\Colors\Dracula\DraculaColors as Dracula;

$colors = Dracula::colors();

echo $colors->purple;             // #BD93F9
echo $colors->get('cyan');        // #8BE9FD

PHPColor Palette

use PhpColor\Color\Palette\ColorPaletteInterface;
use PhpColor\Colors\Dracula\DraculaColors as Dracula;

$palette = Dracula::colors()->palette();
assert($palette instanceof ColorPaletteInterface);

echo $palette->get('purple')->toHex(); // #bd93f9

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

Credits

The colors listed in this project are based on the Dracula Theme.

License

This PHPColor package is released under the MIT license.