CodingI made a library

 

Press Ctrl+Enter to quickly submit your post
Quick Reply  
 
 
  
 From:  Mikee  
 To:  ALL
37761.1 

What's this? a finished project from Mikee? Surely not.

 

I made a little library for messing with colors.

 

http://code.google.com/p/colorjizz/

 

(Badly) ported to 4 languages at the moment.

 

Struggling with my unit tests though. There will always be slight conversion differences, so I'm not sure if I should leave my unit tests to fail or specific a range of error to let them pass. But who decides the range of error? :/

 

For example, if I convert to one format then back again, it might be 0.0004 out when it converts back. Obviously makes no difference in reality, but hmm.

0/0
 Reply   Quote More 

 From:  Mikee  
 To:  ALL
37761.2 

http://mikeefranklin.co.uk:8080/job/ColorJizz-PHP/

 

Upgraded, using PHP namespaces now using PSR-2. Added to Jenkins with unit testing and code coverage, also moved it over to Github and added it to packagist.

0/0
 Reply   Quote More 

 From:  ANT_THOMAS  
 To:  Mikee     
37761.3 In reply to 37761.2 
What does it do?
0/0
 Reply   Quote More 

 From:  Mikee  
 To:  ANT_THOMAS     
37761.4 In reply to 37761.3 
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? :()
0/0
 Reply   Quote More 

 From:  Mikee  
 To:  Mikee     
37761.5 In reply to 37761.4 
Edit: oh, I kinda have a bit. https://github.com/mikeemoo/ColorJizz-PHP/
0/0
 Reply   Quote More 

 From:  CHYRON (DSMITHHFX)  
 To:  Mikee     
37761.6 In reply to 37761.2 
So did he.

----
"neural networks that run on 16,000 processors simultaneously, enough power that they could learn to recognize cats just by watching YouTube "
0/0
 Reply   Quote More 

 From:  Mikee  
 To:  CHYRON (DSMITHHFX)     
37761.7 In reply to 37761.6 
Uhrmm... :/
0/0
 Reply   Quote More 

Reply to All    
 

1–7

Rate my interest:

Adjust text size : Smaller 10 Larger

Beehive Forum 1.5.2 |  FAQ |  Docs |  Support |  Donate! ©2002 - 2024 Project Beehive Forum

Forum Stats