public function setColor(string $color): self
    {
        if (!preg_match("/^#([A-Fa-f0-9]{6})$/", $color)) {
            throw new \InvalidArgumentException($color. " is not a valid hexadecimal color");
        }
        $this->color = $color;
        return $this;
    }
public function setColor(string $color): self
    {
        if (!preg_match("/^#([A-Fa-f0-9]{6})$/", $color)) {
            throw new \InvalidArgumentException($color. " is not a valid hexadecimal color");
        }
        $this->color = $color;
        return $this;
    }
public function setColor ( string $ color ) : self { if ( ! preg_match ( "/^#([A-Fa-f0-9]{6})$/" , $ color ) ) { throw new \ InvalidArgumentException ( $ color . " is not a valid hexadecimal color" ) ; } $ this -> color = $ color ; return $ this ; }
Sets the groups color.
@param string $color A hexadecimal color code.
@example #5E5E5E
@return self
@throws \InvalidArgumentException When $color isn't a valid hexadecimal color.
Sets the groups color .