phpcolor / dracula-colors
Dracula Colors - PHP Color Palette
v1.0.0
2026-08-22 08:02 UTC
Requires
- php: >=8.3
Suggests
- phpcolor/phpcolor: Provides ColorPaletteInterface objects through palette().
README
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.