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.
161402
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;
    }
463735
public function setFromHex($hex, $alpha = 0)
    {
        if (!preg_match(self::$HexRegex, $hex)) {
            throw new \InvalidArgumentException(sprintf(
                    'Inavlid Hex Color "%s"', $hex
            ));
        }

        $ehex = ltrim($hex, '#');

        if (strlen($ehex) === 3) {
            $ehex = $ehex[0] . $ehex[0] .
                    $ehex[1] . $ehex[1] .
                    $ehex[2] . $ehex[2];
        }

        $color = array_map('hexdec', str_split($ehex, 2));

        return $this->setRed($color[0])
                        ->setGreen($color[1])
                        ->setBlue($color[2])
                        ->setAlpha($alpha);
    }
433048
protected function assignTextStyle(string $color)
    {
        if (in_array($color, $this->supported_text_styles) === true) {
            $this->classes['card'][] = 'text-' . $color;
        }
    }
214713
protected function assignBgStyle(string $color)
    {
        if (in_array($color, $this->supported_bg_styles) === true) {
            $this->classes['card'][] = 'bg-' . $color;
        }
    }
1346720
public function setMimeTypeGroup(string $group = null)
    {
        if (null !== $group && !\in_array($group, self::$validGroups, true)) {
            throw new \InvalidArgumentException(\sprintf(
                'Unknown MIME-type group "%s" given. Expected "%s" or null.',
                $group,
                \implode(', ', self::$validGroups)
            ));
        }

        $this->mimeTypeGroup = $group;

        return $this;
    }
394430
public function hex($hex)
    {
        list($red, $green, $blue) = $this->hexToRGB($hex);

        $this->rgb($red, $green, $blue);

        return $this;
    }
763463
protected function background($color = null)
    {
        if (!is_null($color)) {
            $this->resource->setImageBackgroundColor(sprintf('#%s', $color));
        }
        return $this;
    }
857975
public function setBgColor($color)
    {
        if (!empty($color)) {
            $this->bgColor = $this->convertColor($color);
        }

        return $this;
    }
372196
public function addColor($color)
    {
        if ( ! $color instanceof Color ) {
            $color = new Color($color);
        }

        $this->colors []= $color;
    }
696058
public static function create($color)
    {
        $template = 'Length of hexadecimal value of color \'%s\' is incorrect. It\'s %d, but it should be 3 or 6.'
            . ' Is there everything ok?';

        $message = sprintf($template, $color, strlen($color));

        return new static($message);
    }
1202856
public function setIconColor($color = null)
    {
        $color === null || Checkers::checkColor($color, null);
        $this->iconColor = $color;
        return $this;
    }
20874
public function setFromRGBColor(RGBColor $color)
    {
        return $this->setRed($color->getRed())
                        ->setGreen($color->getGreen())
                        ->setBlue($color->getBlue())
                        ->setAlpha($color->getAlpha());
    }
1264916
function set_color($color)
    {
        $col = $this->munge_color($color);

        if (is_null($col) || !isset($col["hex"])) {
            $color = "inherit";
        } else {
            $color = $col["hex"];
        }

        //see __set and __get, on all assignments clear cache, not needed on direct set through __set
        $this->_prop_cache["color"] = null;
        $this->_props["color"] = $color;
    }
347421
private static function getColorAsFullHexCode($color)
    {
        $color = ltrim($color, '#');

        if (strlen($color) == 3) {
            $color = str_repeat(substr($color, 0, 1), 2)
                   . str_repeat(substr($color, 1, 1), 2)
                   . str_repeat(substr($color, 2, 1), 2);
        }

        return strtoupper($color);
    }
1163454
function setBgColor($color)
    {
        $value = $this->_getColor($color);
        $this->_bg_color = $value;
        if ($this->_pattern == 0) { // force color to be seen
            $this->_pattern = 1;
        }
    }
1121440
public function addColor(Color $color)
    {
        if (!$this->colors->contains($color)) {
            $this->colors->add($color);
            $color->setInteractionSelection($this);
        }
    }
333226
public function color(string $color): Bootstrap3ProgressBar
    {
        if (in_array($color, $this->supported_styles) === true) {
            $this->color = $color;
        }

        return $this;
    }