Gets a foreground color code by its name

@return void
195534
public function getForeground($name)
    {
        if (array_key_exists($name, $this->foreground)) {
            return $this->foreground[$name];
        }

        return false;
    }
787673
public static function getBackgroundCode($backgroundColour)
    {
        if (!isset(self::$background_colours[$backgroundColour])) {
            throw new \Exception('Invalid background colour.');
        }
        return "\033[" . self::$background_colours[$backgroundColour] . 'm';
    }
1007792
private function _getCode(){
        $code = null;
        //try{
            $text = $this->text;
            $textColor = new CINColor($this->foregroundColor);
            $backgroudColor = new CINColor($this->backgroundColor);
            $fontPath = isset($this->font) ? $this->font : $this->_getDefaultFont();

            $font = new CINFontFile($fontPath, (is_int($this->fontSize)) ? $this->fontSize : 18);

            $codeClass = "\\CodeItNow\\BarcodeBundle\\Generator\\".$this->barcodeType;
            $code = new $codeClass();
            if($this->scale){
                $code->setScale($this->scale); // Resolution
            }
            if($this->thickness){
                $code->setThickness($this->thickness); // Thickness
            }
            if($this->label !== FALSE){
                $code->setLabel($this->label);
            }
            if($this->noLengthLimit){
                $code->setNoLengthLimit($this->noLengthLimit);
            }
            if($this->allowsUnknownIdentifier){
                $code->setAllowsUnknownIdentifier($this->allowsUnknownIdentifier);
            }
            $code->setForegroundColor($textColor); // Color of bars
            $code->setBackgroundColor($backgroudColor); // Color of spaces
            $code->setFont($font); // Font (or 0)
            $code->parse($text); // Text
        //} catch (\Exception $ex) {
            
        //}
        return $code;
    }
9751
public Color getForeground( int code )
  {
    Style s = _tokenStyles.get( new Integer( code ) );
    if( s == null )
    {
      s = getStyle( DEFAULT_STYLE );
    }
    return getForeground( s );
  }
1033061
public function getCode() {
        $result = '';

        if ($this->options->getRenderContextDirective()) {
            $result .= $this->renderedCode->getContextDirective();
        }
        if ($this->options->getRenderDirectives()) {
            $result .= $this->renderedCode->getDirectives();
        }
        if ($this->options->getRenderGlobalCode()) {
            $result .= $this->renderedCode->getGlobalCode();
        }
        if ($this->options->getRenderMainFunction()) {
            $result .= $this->renderedCode->getMainFunction();
        }

        if ($this->options->getCompress()) {
            $result = $this->compress($result);
        }
        if ($this->options->getIncludeScriptTag()) {
            $result = $this->addScriptTag($result);
        }

        return $result;
    }
1126948
private function findColor()
    {
        $code = $this->verifyCode;
        $this->verifyCode = '';

        $color = array_values($this->fontColor);
        $rand = rand(0, count($color) - 1);
        foreach ($this->fontColor as $k => $v) {
            if ($v == $this->fontColor[$rand]) {
                $this->verifyCode .= $code[$k];
            }
        }
        $this->tips = $this->baseColor[$color[$rand]]['tips'];
    }
498511
def foreground_color_attribute(styles={})
      return nil if styles.nil?
      value = styles[:foreground_color]
      value ||= styles[:color]
      return nil unless value && value.is_a?(UIColor)
      value
    end
739747
protected function getColoredString($string, $foreground_color = null,
                                        $background_color = null)
    {
        $colored_string = "";

        // Check if given foreground color found
        if (isset($this->foreground_colors[$foreground_color])) {
            $colored_string .= "\033[" . $this->foreground_colors[$foreground_color] . "m";
        }
        // Check if given background color found
        if (isset($this->background_colors[$background_color])) {
            $colored_string .= "\033[" . $this->background_colors[$background_color] . "m";
        }

        // Add string and end coloring
        $colored_string .= $string . "\033[0m";

        return $colored_string;
    }
661711
public function get_rgba_css() {

		$colors = array();

		foreach ( $this->colors as $name => $args ) {

			if ( ! empty( $name ) && ! empty( $args['rgba_css'] ) && is_array( $args['rgba_css'] ) ) {

				$colors[ $name ] = $args['rgba_css'];

			}

		}

		return $colors;

	}
1278629
public function str($string, $foreground_color = null, $background_color = null) {
		$colored_string = "";
		if (isset($_SERVER['TERM']) && $_SERVER['TERM'] == 'xterm-256color') {
			// Check if given foreground color found
			if (isset($this->foreground_colors[ $foreground_color ])) {
				$colored_string .= "\033[" . $this->foreground_colors[ $foreground_color ] . "m";
			}
			// Check if given background color found
			if (isset($this->background_colors[ $background_color ])) {
				$colored_string .= "\033[" . $this->background_colors[ $background_color ] . "m";
			}

			// Add string and end coloring
			$colored_string .= $string . "\033[0m";
		} else {
			$colored_string = $string;
		}

		return $colored_string;
	}
409950
protected function getDefaultColors()
    {
        $colors = [
            [
                'name' => 'Pale pink',
                'color' => '#f78da7'
            ],
            [
                'name' => 'Vivid red',
                'color' => '#cf2e2e'
            ],
            [
                'name' => 'Luminous vivid orange',
                'color' => '#ff6900'
            ],
            [
                'name' => 'Luminous vivid amber',
                'color' => '#fcb900'
            ],
            [
                'name' => 'Light green cyan',
                'color' => '#7bdcb5'
            ],
            [
                'name' => 'Vivid green cyan',
                'color' => '#00d084'
            ],
            [
                'name' => 'Pale cyan blue',
                'color' => '#8ed1fc'
            ],
            [
                'name' => 'Vivid cyan blue',
                'color' => '#0693e3'
            ],
            [
                'name' => 'Very light gray',
                'color' => '#eeeeee'
            ],
            [
                'name' => 'Cyan bluish gray',
                'color' => '#abb8c3'
            ],
            [
                'name' => 'Very dark gray',
                'color' => '#313131'
            ]
        ];

        return array_map(function (array $color) {
            return [
                'name' => function_exists('__') ? __($color['name'], Application::TEXTDOMAIN) : $color['name'],
                'color' => $color['color']
            ];
        }, $colors);
    }
323413
public static function printColored ($string, $foreground_color = null, $background_color = null) {
		$colored_string = "";

		// Check if given foreground color found
		if (isset(Bartender::$foreground_colors[$foreground_color])) {
			$colored_string .= "\033[" . Bartender::$foreground_colors[$foreground_color] . "m";
		}
		// Check if given background color found
		if (isset(Bartender::$background_colors[$background_color])) {
			$colored_string .= "\033[" . Bartender::$background_colors[$background_color] . "m";
		}

		// Add string and end coloring
		$colored_string .=  $string;

		echo $colored_string;
	}
603381
public static function getFgColorString($colorCode)
    {
        list($color, $options) = self::extractColorAndOptions($colorCode);
        $codes = array_filter(array_merge($options, array("3{$color}")));
        return sprintf("\033[%sm", implode(';', $codes));
    }
1048667
public static function __callstatic($name, $params)
    {

        $matches = static::isBackgroundCall($name);

        if (null === $matches) {
            throw new Exception("Unknown background color function name $name");
        }

        $colorName   = $matches[2];
        $knownColors = static::getKnownColors();
        $colorID     = $knownColors[$colorName];

        if (!$colorID) {
            throw new Exception("Unknown background color name $name");
        }

        $color = static::color($colorID);

        // target string is expected to be:
        $targetString = $params[0][0];

        $element = new TextElement($targetString);
        $element->setBackgroundColor($color);

        return $element->render();
    }
634669
function get_border_top_color()
    {
        if ($this->_props["border_top_color"] === "") {
            //see __set and __get, on all assignments clear cache!
            $this->_prop_cache["border_top_color"] = null;
            $this->_props["border_top_color"] = $this->__get("color");
        }

        return $this->munge_color($this->_props["border_top_color"]);
    }
29341
public function setForegroundColor($foregroundColor)
    {
        if ( is_null($this->frontColor) ) {
            $this->frontColor = new Color;
        }

        $this->frontColor->setFromArray($foregroundColor);

        return $this;
    }
90104
public static function getColorCode($color, $options = array())
    {
        $code = (int) $color;
        if (is_string($color)) {
            $options = array_merge(explode('+', strtolower($color)), $options);
            $color = array_shift($options);
            if (!isset(self::$colors[$color])) {
                throw new ConsoleException("Unknown color '$color'");
            }
            $code = self::$colors[$color];
        }
        foreach ($options as $opt) {
            $opt = strtolower($opt);
            if (!isset(self::$options[$opt])) {
                throw new ConsoleException("Unknown option '$color'");
            }
            $code = $code | self::$options[$opt];
        }
        return $code;
    }