Skip to content
This repository has been archived by the owner on Apr 16, 2020. It is now read-only.
/ color Public archive

Calculate the difference between two colors

License

Notifications You must be signed in to change notification settings

niclashedam/color

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Color

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