Login   Register  
PHP Classes
elePHPant
Icontem

seams the hsl method has a bug, here is the source code from ...

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      Color  >  All threads  >  seams the hsl method has a bug, here is the source code from ...  >  (Un) Subscribe thread alerts  
Subject:seams the hsl method has a bug, here is the source code from ...
Summary:Package rating comment
Messages:1
Author:VD
Date:2010-01-21 18:04:34
 

VD rated this package as follows:

Utility: Insufficient
Consistency: Sufficient
Examples: Sufficient

  1. seams the hsl method has a bug, here is the source code from ...   Reply  
Picture of VD
VD
2010-01-21 18:04:34
seams the hsl method has a bug, here is the source code from my test:

<?php
function map( $value, $iStart, $iStop, $oStart, $oStop )
{
return ( $oStart + ($oStop - $ostart) * (($value - $iStart) / ($iStop - $iStart)) );
}
require_once "class_color.inc.php";
$c = new color();
$c->set_from_rgbhex("606040");
$hsl = $c->get_hsl();
?>
<pre>
<b>class Color returns</b>
<?php print_r( $hsl ); ?>
<b>should return:</b>
hue => 60 or <?=map(60,0,359,0,1)?>
saturation => 33 or <?=map(33,0,100,0,1)?>
brigthness => 38 or <?=map(38,0,100,0,1)?>
<pre>