Warning: Invalid argument supplied for foreach() in /home/jihswbiz/public_html/t6.gwilt.org/refDox.php on line 212
Docs-colorBetween

 

ReLoad

Keys


Functions

arraybrowsercolorcookiedatetimeDBdebugdeviceDSTequiverrorflagsfontformatgeo
holidayhtmlisjsonmathparsePHPprintsearchsortstringtabletexttracetype
VOTDweatherxml

Function  colorBetween   Lines 408-431 (23 lines)Added: 2012-03-10 file  utils.php   Last mod: Fri 2021-05-14 21:45:07

function colorBetween $col1$col2$pc )
        {
#-k     color
#-      if we're 25% of the way between $tim1 & $tim2, find the color that's 25% of the
#-              way between $col1 & $col2 (000000-FFFFFF)
#-p     $col1   - req   - Hex RGB color (Must be in the form #hhhhhh)
#-p     $col2   - req   - Hex RGB color (Must be in the form #hhhhhh)
#-p     $pc     - req   - % distance, expressed 0 .. 1
#-p             - ret   - mid-point color, format #hhhhhh
#-d     03/10/12 Added

        
if ($pc 0) return 0;
        if (
$pc 1) return 0;

#eko($col1,$col2,$pc);
        
$c  sprintf('%02X',(colorShade substr($col1,1,2), substr($col2,1,2), $pc )));
#eko($c);
        
$c .= sprintf('%02X',(colorShade substr($col1,3,2), substr($col2,3,2), $pc )));
#eko($c);
        
$c .= sprintf('%02X',(colorShade substr($col1,5,2), substr($col2,5,2), $pc )));
#eko($c);
        
return '#'.$c;
        }

?>