Generates a color based on a given string.

1.2.0 2020-12-23 15:02 UTC

This package is auto-updated.

Last update: 2021-10-23 16:53:37 UTC


PHP from Packagist Codacy BadgeLatest Stable Version Total Downloads License

PHP Color Hash

Generates a color based on a given string.

This library is based on shahonseven/php-color-hash which is a PHP port of ColorHash Javascript Library, but adds a lot more functions.


This library makes use of Composer. Add it to your project by running $ composer require bitandblack/color-hash.



use BitAndBlack\ColorHash\ColorHash;

$colorHash = new ColorHash('Hello World');

You can access the color values then in an array by calling $colorHash->getValues() or echo the whole object.

This library used bitandblack/colors, so you can get the color information in many different color spaces. To get it for example in CMYK write $colorHash->getCMYK(). There are HEX, RGB, CIALab and many more available.


If you have any questions feel free to contact us under