protected function getColor($im, $color) {
        if ($color === self::COLOR_BG) {
            return $this->colorBg->allocate($im);
        } else {
            return $this->colorFg->allocate($im);
        }
    }
protected function getColor($im, $color) {
        if ($color === self::COLOR_BG) {
            return $this->colorBg->allocate($im);
        } else {
            return $this->colorFg->allocate($im);
        }
    }
protected function getColor ( $ im , $ color ) { if ( $ color === self :: COLOR_BG ) { return $ this -> colorBg -> allocate ( $ im ) ; } else { return $ this -> colorFg -> allocate ( $ im ) ; } }
Allocates the color based on the integer.

@param resource $im
@param int $color
@return resource
Allocates the color based on the integer .