Validate and assign the text colour, need to be one of the following, primary, secondary, success, danger,
warning, info, light or dark, if an incorrect style is passed in we don't apply the class.

@param string $color
433048
protected function assignTextStyle(string $color)
    {
        if (in_array($color, $this->supported_text_styles) === true) {
            $this->classes['card'][] = 'text-' . $color;
        }
    }
561974
public function setColor($color)
	{
		if (is_array($color))
		{
			$this->color[0] = $color[0];
			$this->color[1] = $color[1];
			$this->color[2] = $color[2];
		}
		else
		{
			if (false !== strpos($color, '#'))
			{
				$color = substr($color, 1);
			}
			$this->color[0] = hexdec(substr($color, 0, 2));
			$this->color[1] = hexdec(substr($color, 2, 2));
			$this->color[2] = hexdec(substr($color, 4, 2));
		}

		return $this;
	}
718896
public function colorCheckCommand(): void
    {
        // $char= '❤';
        // $ret = ProcessUtil::run('echo ❤');
        // var_dump($ret, trim($ret[1]), $char === trim($ret[1]));
        //
        // die;

        $this->output->aList([
            'basic color output?' => Cli::isSupportColor() ? '<info>Y</info>' : 'N',
            'ansi char output?'   => Cli::isAnsiSupport() ? 'Y' : 'N',
            '256 color output?'   => Cli::isSupport256Color() ? 'Y' : 'N',
            'font symbol output?' => Cli::isSupport256Color() ? 'Y' : 'N',
        ], 'color support check');
    }
1092014
public function colored($text, $color)
    {
        $colors = [
            'black'  => '0;30',
            'red'    => '0;31',
            'green'  => '0;32',
            'blue'   => '1;34',
            'yellow' => '1;33'
        ];

        $c = (
            array_key_exists($color, $colors)
            ? $colors[$color]
            : $colors['black']
        );

        if ($this->arguments->{'no-colors'}) {
            return $text;
        } else {
            return "\033[". $c . 'm' . $text . "\033[0m";
        }
    }
942388
protected function _set_fill_colour($colour) {
    $colour[0] = round(255 * $colour[0]);
    $colour[1] = round(255 * $colour[1]);
    $colour[2] = round(255 * $colour[2]);

    if ( is_null($this->_last_fill_color) || $color != $this->_last_fill_color ) {
      $this->_pdf->SetDrawColor($color[0],$color[1],$color[2]);
      $this->_last_fill_color = $color;
    }

  }
508697
public function setLabelColor($value)
    {
        if (!LabelColor::getIsValid($value)) {
            throw new InvalidConfigException('Unknown "labelColor" value');
        }
        $this->options['labelColor'] = new JsExpression($value);
    }
325952
public void setColor(final Color COLOR) {
        if (null == color) {
            _color = COLOR;
        } else {
            color.set(COLOR);
        }
        fireMarkerEvent(COLOR_CHANGED_EVENT);
    }
1373997
public final void setHelperTextColor(@ColorInt final int color) {
        this.helperTextColor = color;

        if (!(Boolean) leftMessage.getTag()) {
            leftMessage.setTextColor(color);
        }

        if (!(Boolean) rightMessage.getTag()) {
            rightMessage.setTextColor(color);
        }
    }
311038
public function setForegroundColor($foregroundColor) {
        $this->foregroundColor = $foregroundColor;
        $this->font->setForegroundColor($this->foregroundColor);
    }
860755
public void setTextColor(final Color COLOR) {
        if (null == textColor) {
            _textColor = COLOR;
            redraw();
        } else {
            textColor.set(COLOR);
        }
    }
727470
public static function isValidHex(string $color) : bool
    {
        $color = ltrim($color, '#');

        return ctype_xdigit($color) && (strlen($color) === 6 || strlen($color) === 3);
    }
791399
public static function name($color) {

		if(false === is_string($color)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($color)), E_USER_ERROR);
		}

		if(1 !== preg_match('#^[0-9a-fA-F]{6,6}$#', $color)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be a 6 character hexadecimal string', __METHOD__), E_USER_ERROR);
		}

		$color 	= strtoupper($color);
		$rgb 	= static :: rgb($color);
		$r 		= $rgb -> r; 
		$g 		= $rgb -> g; 
		$b 		= $rgb -> b;
		$hsl 	= static :: hsl($color);
		$h 		= $hsl -> h; 
		$s 		= $hsl -> s; 
		$l 		= $hsl -> l;
		$ndf1 	= 0;
		$ndf2 	= 0; 
		$ndf 	= 0;
		$cl 	= -1;
		$df 	= -1;

		//Index all the colors
		if(null === static :: $list) {

			new ColorList();
			static :: index();
		}

		foreach(static :: $list as $hex => $color) {

			$ndf1 = pow($r - $color -> r, 2) + pow($g - $color -> g, 2) + pow($b - $color -> b, 2);
			$ndf2 = pow($h - $color -> h, 2) + pow($s - $color -> s, 2) + pow($l - $color -> l, 2);
			$ndf  = $ndf1 + $ndf2 * 2;

			if($df < 0 || $df > $ndf) {

				$df = $ndf;
				$cl = $hex;
			}
		}

		if(true === isset(static :: $list[$cl])) {
			return static :: $list[$cl];
		}

		return null;
	}
712048
public function setColor($color)
	{
		if (is_array($color))
		{
			$this->color[0] = $color[0];
			$this->color[1] = $color[1];
			$this->color[2] = $color[2];
		}
		else
		{
			$color = ltrim($color, '#');

			$this->color[0] = hexdec(substr($color, 0, 2));
			$this->color[1] = hexdec(substr($color, 2, 2));
			$this->color[2] = hexdec(substr($color, 4, 2));
		}

		return $this;
	}
535062
protected function _set_stroke_color($color)
    {
        $this->_pdf->setStrokeColor($color);
        $alpha = isset($color["alpha"]) ? $color["alpha"] : 1;
        if ($this->_current_opacity != 1) {
            $alpha *= $this->_current_opacity;
        }
        $this->_set_line_transparency("Normal", $alpha);
    }
292711
private function setColor($color)
    {
        if (!isset(self::$colors[$color])) {
            throw new \InvalidArgumentException(sprintf(
                'Invalid foreground color specified: "%s". Expected one of (%s)',
                $color,
                implode(', ', array_keys(self::$colors))
            ));
        }

        $this->color = self::$colors[$color];
    }
12521
public function setColor($color)
    {
        $allowed_values = array('#ffffff', '#ffff01', '#ff6600', '#fe0000', '#9a0000', '#660066', '#0000fe', '#0099ff', '#01ffff', '#00ff33', '#349800', '#006634', '#666666', '#999999', '#e6e6e6', '#ffffcd', '#99ffff', '#ccff9a');
        if (!is_null($color) && (!in_array($color, $allowed_values))) {
            throw new \InvalidArgumentException("Invalid value for 'color', must be one of '#ffffff', '#ffff01', '#ff6600', '#fe0000', '#9a0000', '#660066', '#0000fe', '#0099ff', '#01ffff', '#00ff33', '#349800', '#006634', '#666666', '#999999', '#e6e6e6', '#ffffcd', '#99ffff', '#ccff9a'");
        }
        $this->container['color'] = $color;

        return $this;
    }
737126
function set_background_color($color)
    {
        $col = $this->munge_color($color);

        if (is_null($col)) {
            return;
            //$col = self::$_defaults["background_color"];
        }

        //see __set and __get, on all assignments clear cache, not needed on direct set through __set
        $this->_prop_cache["background_color"] = null;
        $this->_props["background_color"] = is_array($col) ? $col["hex"] : $col;
    }