Display an Identicon image

@param   string   $string
@param   integer  $size
@param   string   $color
@return  void
482670
public function displayImage($string, $size = 64, $color = null)
	{
		header("Content-Type: image/png");
		$this->generateImage($string, $size, $color);
	}
1069534
public function warn($string)
    {
        $style = new OutputFormatterStyle('yellow');

        $this->output->getFormatter()->setStyle('warning', $style);

        $this->output->writeln("<warning>$string</warning>");
    }
405338
public void setSecondaryButtonTextColor(String color) throws HelloSignException {
        if (white_labeling_options == null) {
            white_labeling_options = new WhiteLabelingOptions();
        }
        white_labeling_options.setSecondaryButtonTextColor(color);
    }
269032
public void setCustomTickLabelFontSize(final double SIZE) {
        if (null == customTickLabelFontSize) {
            _customTickLabelFontSize = Helper.clamp(0.0, 72.0, SIZE);
            fireUpdateEvent(REDRAW_EVENT);
        } else {
            customTickLabelFontSize.set(SIZE);
        }
    }
1269296
public function iconAction($fileId, $size = 16)
    {
        $volumeManager = $this->get('phlexible_media_manager.volume_manager');
        $mediaTypeManager = $this->get('phlexible_media_type.media_type_manager');
        $kernel = $this->get('kernel');

        try {
            $volume = $volumeManager->getByFileId($fileId);
        } catch (\Exception $e) {
            throw $this->createNotFoundException($e->getMessage(), $e);
        }

        // TODO get lates file version
        $file = $volume->findFile($fileId);
        $mimeType = $file->getMimeType();
        $mediaType = $mediaTypeManager->findByMimetype($mimeType);
        $icons = $mediaType->getIcons();

        $fileLocator = new FileLocator($kernel);
        $iconPath = $fileLocator->locate($icons[$size]);

        $response = new BinaryFileResponse($iconPath, 200, array('Content-Type' => 'image/gif'));

        return $response;
    }
923109
public function addIcon($row, $label, \DataContainer $dc=null, $imageAttribute='', $blnReturnImage=false)
  {
    $arrMimeInfo = \DmsUtils::getMimeInfo($row['data_file_type']);

    $imgName = $arrMimeInfo['icon'];
    if (!$row['published'])
    {
      $imgName .= '_';
    }

    return $this->generateImage('system/modules/DocumentManagementSystem/assets/mime/' . $imgName . '.png', $arrMimeInfo['type']) . $label;
  }
10457
private function widthForStringUsingFontSize($string, $font, $fontSize = 8)
    {
        @$drawingString = \iconv('', 'UTF-16BE', $string);
        $characters = array();
        for ($i = 0; $i < strlen($drawingString); $i++) {
            $characters[] = (ord($drawingString[$i++]) << 8) | ord($drawingString[$i]);
        }
        $glyphs = $font->glyphNumbersForCharacters($characters);
        $widths = $font->widthsForGlyphs($glyphs);
        $stringWidth = (array_sum($widths) / $font->getUnitsPerEm()) * $fontSize;

        return $stringWidth;
    }
223093
public function iconPath($image, $size = 16)
    {
        if (!$image) {
            return '';
        }

        $parts = explode(';', $image);
        $fileId = $parts[0];

        $src = $this->router->generate('frontendmedia_icon', ['fileId' => $fileId, 'size' => $size], UrlGeneratorInterface::ABSOLUTE_PATH);

        return $src;
    }
336357
public static function write(string $string, string $color = null, $appendTime = true)
    {
        parseColor:
        $prefix = $suffix = '';
        if ($color) {
            $color = strtolower(trim($color));
            switch ($color) {
                case 'blue' :
                    $prefix = "\033[44;37;1m";
                    break;
                case 'green' :
                    $prefix = "\033[42;37;1m";
                    break;
                case 'red' :
                    $prefix = "\033[41;37;1m";
                    break;
                case 'yellow' :
                    $prefix = "\033[43;37;1m";
                    break;
                default:
                    $color = 'blue';
                    goto parseColor;
                    break;
            }

            if ($prefix) {
                $suffix = "\033[0m";
            }

            if (strpos($string, '^^') === false) {
                $hasEof = mb_substr($string, -1, 1) === "\n";
                $string = rtrim($string, "\n");
                $string = '^^' . $string . '$$';
                if ($hasEof) {
                    $string .= "\n";
                }
            }

            $string = str_replace(['^^', '$$'], [$prefix, $suffix], $string);
        }

        if (mb_substr($string, -1, 1) !== "\n") {
            $string .= "\n";
        }

        if ($appendTime) {
            $string = '[' . date('m-d H:i:s') . '] ' . $string;
        }

        echo $string;
    }
20254
public function getImgResource($string, $size = '', $color = '', $bg = '')
    {
        return $this->setHashString($string)->setSize($size)->setColor($color)->setBgColor($bg)->genImage();
    }
591783
public static function sexImage($sex, $size = 'small'): string
    {
        $image = view('icons/sex-' . $sex);

        if ($size === 'small') {
            $image = '<small>' . $image . '</small>';
        }

        return $image;
    }
1373275
static void tag(StringBuilder sb, String color, String text) {
        sb.append("<span class='label label");
        if (color != null) {
            sb.append("-").append(color);
        }
        String classText = text.replace(' ', '_');
        sb.append(" l-").append(classText).append("'>").append(text).append("</span>");
    }
1077355
public static String addColor(String orgString, String replaceString, int color) {
        return orgString.replace(replaceString, "<font color=\"" + colorToHexString(color) + "\">" + replaceString + "</font>");
    }
514384
public function getImageResource($string, $size = 64, $color = null, $backgroundColor = null)
    {
        return $this->generator->getImageResource($string, $size, $color, $backgroundColor);
    }
946739
@Override
    public String getImageOf(String size) {
        if (owner == null) {
            return BallColor.GREY.getImageOf(size);
        }

        return calculateBallColor().getImageOf(size);
    }
657417
public function displayImage($string, $size = 64, $hexaColor = null)
	{
		header("Content-Type: image/png");
		$this->generateImage($string, $size, $hexaColor);
	}
1320911
public function save($string, $size, $color, $bg, $target)
    {
        return (!file_exists($target)) ? file_put_contents("$target", $this->getImgData($string, $size, $color, $bg)) : false;
    }