protected function fixColor($c)
    {
        foreach ([1, 2, 3] as $i) {
            if ($c[$i] < 0) {
                $c[$i] = 0;
            }

            if ($c[$i] > 255) {
                $c[$i] = 255;
            }
        }

        return $c;
    }
protected function fixColor($c)
    {
        foreach ([1, 2, 3] as $i) {
            if ($c[$i] < 0) {
                $c[$i] = 0;
            }

            if ($c[$i] > 255) {
                $c[$i] = 255;
            }
        }

        return $c;
    }
protected function fixColor ( $ c ) { foreach ( [ 1 , 2 , 3 ] as $ i ) { if ( $ c [ $ i ] < 0 ) { $ c [ $ i ] = 0 ; } if ( $ c [ $ i ] > 255 ) { $ c [ $ i ] = 255 ; } } return $ c ; }
Make sure a color's components don't go out of bounds

@param array $c

@return array
Make sure a color s components don t go out of bounds