public function setStyle($style)
    {
        if ($style == null) {
            $this->style = new IdenticonStyle();
        } elseif ($style instanceof IdenticonStyle) {
            $this->style = $style;
        } elseif (is_array($style)) {
            $this->style = new IdenticonStyle($style);
        } else {
            throw new \InvalidArgumentException(
                "Invalid indenticon style was specified. ".
                "Allowed values are IdenticonStyle instances and associative ".
                "arrays containing IdenticonStyle options.");
        }
        
        return $this;
    }