Sets a specific type of color on this Style.

@param   string  $type   The type of the color to set.
@param   string  $color  The color to set.
@return  $this
508270
protected function setColor(string $type, ?string $color) : interfaces\Style
    {
        if (isset($color) && !isset(static::${$type.'s'}[$color])) {
            throw new \InvalidArgumentException("The $type color [$color] is not recognized.");
        }

        $this->$type = $color;

        return $this;
    }
78908
public function setType($type)
    {
        if ($type instanceof PagSeguroPaymentMethodType) {
            $this->type = $type;
        } else {
            $this->type = new PagSeguroPaymentMethodType($type);
        }
    }
50903
public function setRedirectType($type) {
        if (!is_int($type)) throw new IllegalTypeException('Illegal type of parameter $type: '.gettype($type));

        $this->redirectType = $type;
        return $this;
    }
962481
protected function _set_stroke_color($color) {
    if($this->_last_stroke_color == $color)
      return;

    $this->_last_stroke_color = $color;

    if (isset($color[3])) {
      $type = "cmyk";
      list($c1, $c2, $c3, $c4) = array($color[0], $color[1], $color[2], $color[3]);
    }
    elseif (isset($color[2])) {
      $type = "rgb";
      list($c1, $c2, $c3, $c4) = array($color[0], $color[1], $color[2], null);
    }
    else {
      $type = "gray";
      list($c1, $c2, $c3, $c4) = array($color[0], $color[1], null, null);
    }
    
    $this->_pdf->setcolor("stroke", $type, $c1, $c2, $c3, $c4);
  }
873273
public function setColor($color): DeliveryOptions
    {
        if (!in_array($color, static::getOptionsForColor())) {
            throw new InvalidArgumentException(sprintf('Property %s is not supported for %s', $color, __FUNCTION__));
        }

        $this->data['color'] = $color;

        return $this;
    }
273268
function set_color($colour) {
    $col = $this->munge_colour($colour);

    if ( is_null($col) )
      $col = self::$_defaults["color"];

    //see __set and __get, on all assignments clear cache, not needed on direct set through __set
    $this->_prop_cache["color"] = null;
    if (is_array($col))
      $this->_props["color"] = $col["hex"];
  }
1374452
public function setType($type)
    {
        $const = sprintf('%s::TYPE_%s', __CLASS__, strtoupper($type));
        
        if(defined($const))
        {
            $type = constant($const);
        }
        
        $this->setAttributeDirectly('type', $type);
        
        $this->enumerationStrategy = null;
    }
990986
public function makeType(StyleType $type): ?Style
    {
        if (!$type->isType()) {
            return null;
        }

        return Style::make()
            ->setFgColor(Color::CYAN())
            ->bold();
    }
279143
public function setPostType($type)
    {
        if (!in_array($type, [0, 1, 2, 3, 4, 5])) {
            $this->postType = self::POST_FORM_DATA;
        } else {
            $this->postType = $type;
        }
        return $this;
    }
193603
public function set_bg_color($color) {
        if (!isset($this->format['fill']['type'])) {
            $this->format['fill']['type'] = PHPExcel_Style_Fill::FILL_SOLID;
        }
        $this->format['fill']['color']['rgb'] = $this->parse_color($color);
    }
831387
public function setColor($color)
	{
		if ( ! $this->isValidColor($color))
		{
			throw new \InvalidArgumentException('Invalid color format.');
		}
		
		$this->color = (string) $color;
		
		return $this;
	}
325613
public function setType(Type $type)
    {
        if ($this->type !== $type) {
            $this->type = $type;
            $type->setItem($this);
        }

        return $this;
    }
486788
public function setType(string $type): ButtonInterface
    {
        if ($this->isVisibility()) {
            $this->type = $type;
        }

        return $this;
    }
579088
public function setType($type)
    {
        if ($type === null) {
            $this->$type = $type;
        } else {
            $iconSetType = new IconSetTypeEnum($type);
            $this->type = $iconSetType->getValue();
        }

        return $this;
    }
461417
public function setBGColor($level, ForegroundColors $color)
    {
        if (static::$foregroundColorMap === null) {
            $this->resetBGColor();
        }
        $this->checkLevel($level);
        static::$foregroundColorMap[$level] = $color;
        return $this;
    }
1121440
public function addColor(Color $color)
    {
        if (!$this->colors->contains($color)) {
            $this->colors->add($color);
            $color->setInteractionSelection($this);
        }
    }
689244
public function color($type = 'bg', $color = Style::COLOR_WHITE)
    {
        if ($type === 'bg') {
            $this->backgroundColor = $color;
        } else {
            $this->foregroundColor = $color;
        }

        return $this;
    }