PHP Classes

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

Recommend this page to a friend!

      Color  >  All threads  >  seams the hsl method has a bug, here...  >  (Un) Subscribe thread alerts  
Subject:seams the hsl method has a bug, here...
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...   Reply   Report abuse  
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>