This package provides access to the Dracula color palette, a dark theme for code editors and terminal applications.
composer require phpcolor/dracula-colors:^1.0The package works standalone. Install phpcolor/phpcolor only when using palette():
composer require phpcolor/phpcoloruse PhpColor\Colors\Dracula\DraculaColors as Dracula;
$colors = Dracula::colors();use PhpColor\Colors\Dracula\DraculaColors as Dracula;
$colors = Dracula::colors();
$names = $colors->getNames();
// 'background', 'currentLine', 'foreground', 'comment',
// 'cyan', 'green', 'orange', 'pink', 'purple', 'red', 'yellow'use PhpColor\Colors\Dracula\DraculaColors as Dracula;
$colors = Dracula::colors();
echo $colors->purple; // #BD93F9
echo $colors->get('cyan'); // #8BE9FDuse PhpColor\Color\Palette\ColorPaletteInterface;
use PhpColor\Colors\Dracula\DraculaColors as Dracula;
$palette = Dracula::colors()->palette();
assert($palette instanceof ColorPaletteInterface);
echo $palette->get('purple')->toHex(); // #bd93f9Calling palette() without phpcolor/phpcolor installed throws a LogicException with the installation command.
The colors listed in this project are based on the Dracula Theme.
This PHPColor package is released under the MIT license.