I made a library

From: ANT_THOMAS 8 Oct 2012 13:36
To: Mikee 3 of 7
What does it do?
From: Mikee 8 Oct 2012 13:44
To: ANT_THOMAS 4 of 7
It's for playing with colours.

You can convert colours from one format to any of the other formats, for example:


php code:
<?php
echo Hex::create(0xCC0000)->toCMYK();
echo Hex::create(0xCC0000)->toCIELab();
echo Hex::create(0xCC0000)->toCIELCh();
echo Hex::create(0xCC0000)->toRGB();
echo Hex::fromString('black')->toHSV();
echo RGB::create(200,100,150)->toHex();
?>


Or find colour harmonies, modify colours or match colours:

php code:
<?php
echo Hex::fromString('#cc0000')->greyscale();

echo Hex::fromString('#cc0000')->websafe();

echo Hex::fromString('#cc0000')->match(array(
  new RGB(0,0,0),
  new XYZ(1,1,1),
  new Hex(0x00FF00)
));

echo Hex::create(0xFF0000)->range(Hex::create(0x0000FF), 100);

echo new RGB(100,0,100)->split(2);

echo new RGB(100,0,100)->hue(-2);
?>


I should document it properly at some point with examples.

(no syntax highlighting? :()
EDITED: 8 Oct 2012 13:47 by MIKEE
From: Mikee 8 Oct 2012 13:46
To: Mikee 5 of 7
Edit: oh, I kinda have a bit. https://github.com/mikeemoo/ColorJizz-PHP/
From: CHYRON (DSMITHHFX) 8 Oct 2012 13:54
To: Mikee 6 of 7
From: Mikee 8 Oct 2012 14:01
To: CHYRON (DSMITHHFX) 7 of 7
Uhrmm... :/