private function DarkenColor($color, $amount)
    {
        $newColor = $color * (1 - $amount);
        return min(max(round($newColor), 0x00), 0xff);
    }
private function DarkenColor($color, $amount)
    {
        $newColor = $color * (1 - $amount);
        return min(max(round($newColor), 0x00), 0xff);
    }
private function DarkenColor ( $ color , $ amount ) { $ newColor = $ color * ( 1 - $ amount ) ; return min ( max ( round ( $ newColor ) , 0x00 ) , 0xff ) ; }
Darkens a single color part
@param int $color The color part (range 0-255)
@param float $amount The amount of darkening (range 0-1)
@return int Returns the darkened color
Darkens a single color part