This tool providers methods to convert from RGB and CMYK, to RGB, CMYK and HEX. Also this tool can calculate the relative difference between two given colors. This cool can also provide you with the name of the color you provided.
Install it using composer
composer require niclashedam/color
Just include it and instantiate the Color class.
use NiclasHedam/Color;
$black = Color::fromRGB(0, 0, 0);
$white = Color::fromCMYK(0, 0, 0, 0);
$black->differenceBetween($white); //100
$black->name(); // "Black"
$black->toHEX(); // "#000000"
$orange = Color::fromRGB(255, 165, 0);
$orange->differenceBetween($white); //61.2255
See exampes/example.php for more examples
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
Released under the MIT license