Return a Font Awesome icon

@param   string|bool     $name       A FontAwesome icon name, or a boolean for colored tick/cross
@param   string          $color      An optional colour
@return  string
323458
public static function icon($name, $color = '')
		{
			if (is_bool($name))
			{
				$color = $name ? 'success' : 'danger';
				$name = $name ? 'check' : 'times';
			}
			$class = "icon fa fa-$name";
			$style = '';
			if (preg_match('/(info|success|warning|danger)/', $color))
			{
				$class .= ' text-' . $color;
			}
			else if ($color !== '')
			{
				$style = ' style="color:' .$color. '"';
			}
			return '<i class="' .$class. '" ' .$style. '></i>';
		}
903968
public static function getCharsetFromFontName($name)
    {
        switch ($name) {
            // Add more cases. Check FONT records in real Excel files.
            case 'EucrosiaUPC':
                return self::CHARSET_ANSI_THAI;
            case 'Wingdings':
                return self::CHARSET_SYMBOL;
            case 'Wingdings 2':
                return self::CHARSET_SYMBOL;
            case 'Wingdings 3':
                return self::CHARSET_SYMBOL;
            default:
                return self::CHARSET_ANSI_LATIN;
        }
    }
47348
public static function css($pro = false)
    {
        if($pro)
        {
            $url = 'pro.fontawesome.com';
            $integrity = 'sha384-Bx4pytHkyTDy3aJKjGkGoHPt3tvv6zlwwjc3iqN7ktaiEMLDPqLSZYts2OjKcBx1';
        }
        else
        {
            $url = 'use.fontawesome.com';
            $integrity = 'sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf';
        }

        return '<link rel="stylesheet" href="https://' . $url . '/releases/v' .
        self::FA_VERSION . '/css/all.css" integrity="' . $integrity . '" crossorigin="anonymous">';
    }
1249492
public static function element($name) {
        if (isset(static::$html5[$name])) {
            return static::$html5[$name];
        }
        if (isset(static::$svg[$name])) {
            return static::$svg[$name];
        }
        if (isset(static::$mathml[$name])) {
            return static::$mathml[$name];
        }

        return false;
    }
499659
public function addInputColor(string $name) : Element\Input\Color
    {
        $input = new Element\Input\Color($this, $name);
        $this->addComponent($name, $input);

        return $input;
    }
807975
public static function htmlToRgbaValue($htmlColor)
    {
        if (true === self::isValidHtmlName($htmlColor)) {
            $htmlColor = \array_search(
                $htmlColor,
                self::$htmlHexStringToNameMap
            );
        }

        self::throwExceptionIfNotHtmlValue($htmlColor);

        return \hexdec(\substr($htmlColor, 1));
    }
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;
	}
877854
public static function icon($name, $options = [])
    {
        static::addCssClass($options, static::iconName($name));
        $size = ArrayHelper::remove($options, 'size');
        if (!empty($size)) {
            static::addCssClass($options, $size);
        }
        $rotate = ArrayHelper::remove($options, 'rotate');
        if (!empty($rotate)) {
            static::addCssClass($options, $rotate);
        }
        $flip = ArrayHelper::remove($options, 'flip');
        if (!empty($flip)) {
            static::addCssClass($options, $flip);
        }
        $inverse = ArrayHelper::remove($options, 'inverse');
        if (!empty($inverse)) {
            static::addCssClass($options, 'fa-inverse');
        }
        $spin = ArrayHelper::remove($options, 'spin');
        if (!empty($spin)) {
            static::addCssClass($options, 'fa-spin');
        }
        $fw = ArrayHelper::remove($options, 'fw');
        if (!empty($fw)) {
            static::addCssClass($options, 'fa-fw');
        }
        $ul = ArrayHelper::remove($options, 'ul');
        if (!empty($ul)) {
            static::addCssClass($options, 'fa-ul');
        }
        $li = ArrayHelper::remove($options, 'li');
        if (!empty($li)) {
            static::addCssClass($options, 'fa-li');
        }
        $border = ArrayHelper::remove($options, 'border');
        if (!empty($border)) {
            static::addCssClass($options, 'fa-border');
        }
        return Html::tag(ArrayHelper::remove($options, 'tag', 'i'), ArrayHelper::remove($options, 'body'), $options);
    }
908150
public static function buildLabel($name, $label = '', $required = false)
        {
            $out = '';

            if (!empty($label)) {
                $class = 'control-label';
                $requiredLabel = '.req';
                $requiredSuffix = '<span class="required"><i class="icon-asterisk"></i></span>';
                $requiredPrefix = '';
                $requiredClass = 'labelrequired';

                if (false !== $required) {
                    $label = $requiredPrefix . $label . $requiredSuffix;
                    $class .= ' ' . $requiredClass;
                }

                $out .= static::label($name, $label, array('class' => $class));
            }

            return $out;
        }
459764
function style( $name )
    {
        if ( $this->UseStyles )
        {
            if ( $this->isWebOutput() )
                return $this->webStyle( $name );
            else
                return $this->terminalStyle( $name );
        }
        return false;
    }
325979
protected function loadFont($name, $type)
    {
        if (file_exists($name)) {
            return $name;
        }

        $path = sprintf('%s/%s/%s', $this->resourcePath, $type, $name);
        if (file_exists($path)) {
            return $path;
        }

        throw new Exception(
            sprintf('The requested resource %s (%s) has not been found!', $name, $type)
        );
    }
86230
public static function icon($icon, $htmlOptions = array(), $tagName = 'span')
    {
        if (is_string($icon)) {
            if (strpos($icon, 'glyphicon-') === false) {
                $icon = 'glyphicon-' . implode(' glyphicon-', explode(' ', $icon));
            }
            self::addCssClass(array('glyphicon', $icon), $htmlOptions);
            $color = TbArray::popValue('color', $htmlOptions);
            if (!empty($color) && $color === self::ICON_COLOR_WHITE) {
                self::addCssClass("glyphicon-white", $htmlOptions);
            }
            return self::openTag($tagName, $htmlOptions) . parent::closeTag($tagName); // tag won't work in this case
        }
        return '';
    }
344120
public function getColorBool($name, $stdoutIsTty = null)
    {
        $this->arguments[] = '--get-colorbool';
        $this->arguments[] = $name;
        if (\is_bool($stdoutIsTty)) {
            $this->arguments[] = $stdoutIsTty ? 'true' : 'false';
        }
        return $this;
    }
978523
public static function glyphIcon($name, $attributesHelper = null)
    {
        $attributesHelper = AttributesHelper::f($attributesHelper);

        return HtmlHelper::span('', $attributesHelper
            ->addClass('glyphicon')
            ->addClass('glyphicon-' . $name));
    }
810391
public function complimentaryTheme($color)
    {
        $parsedColor = $this->parseColor($color);
        $yiq = $this->calculateYIQValue($parsedColor->toRGB());
        if ($yiq > 128) {
            return self::DARK;
        } else {
            return self::LIGHT;
        }
    }
401768
public static function getScoreboardIconUrl( string $name ): string
	{
		self::checkInit();
		return self::getSetting(self::SET_ENDPOINT) . self::getSetting(self::SET_VERSION) . "/img/ui/{$name}.png";
	}
326356
public function getColor($name, $default = null)
    {
        $this->arguments[] = '--get-color';
        $this->arguments[] = $name;
        if ($default !== null) {
            $this->arguments[] = $default;
        }
        return $this;
    }