This package is abandoned and no longer maintained. No replacement package was suggested.

Color conversion, color likeliness and color names

1.0.2 2018-01-31 12:49 UTC

This package is auto-updated.

Last update: 2020-04-16 12:12:25 UTC


README

Build Status Coverage Status FOSSA Status

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.

Installation

Install it using composer

composer require niclashedam/color

Usage

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

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

License

Released under the MIT license

FOSSA Status