Get an Identicon PNG image resource.

@param string $string
@param int    $size
@param string $color
@param string $backgroundColor

@return string
514384
public function getImageResource($string, $size = 64, $color = null, $backgroundColor = null)
    {
        return $this->generator->getImageResource($string, $size, $color, $backgroundColor);
    }
1365883
public static function flag(string $country, string $size = 'medium') : string
    {
        $sizes = [
            'small' => 100,
            'medium' => 250,
            'big' => 1000,
        ];

        $code = $country;

        if (strlen($country) > 2) {
            $code = static::countryAlpha2($country);
        }

        $code = strtolower($code);

        if ($code === 'unknown') {
            $flag = __DIR__ . "/../Assets/country-flags/Unknown.png";
        } else {
            $flag = __DIR__ . "/../Assets/country-flags/png{$sizes[$size]}px/{$code}.png";
        }

        $cache_key = "support__flag:{$code}_{$size}";

        if (!Cache::has($cache_key)) {
            $image = Image::make($flag)
                ->resize($sizes[$size], bcmul($sizes[$size], 0.6, 2))
                ->encode('data-url');
            Cache::put($cache_key, $image);
            return $image;
        }

        return Cache::get($cache_key);
    }
874181
public function getImageDataUri($string, $size = 64, $color = null)
	{
		return sprintf('data:image/png;base64,%s', base64_encode($this->getImageData($string, $size, $color)));
	}
1236835
public function getImgDataBase64($string, $size = 128, $color = '', $bg = '')
    {
        return sprintf('data:%s;base64,%s', $this->_instance->mineType, base64_encode($this->getImgData($string, $size, $color, $bg)));
    }
891607
public static function image($mixSize = '400x350', $background = '000', $foregroundColor = 'fff', $text = null, $format = 'jpg')
    {
        return "//dummyimage.com/$mixSize/$background/$foregroundColor" . (!$text ? : '&text=' . urlencode($text));
    }
207530
protected function getIcon( $file, $size = 'large' ) {
		$file_class = $this->getCssClass( $file );
		$html = "<div class='export-file-icon {$size} {$file_class}' title='" . esc_attr( $file ) . "'></div>";
		return $html;
	}
404568
public function stringId($column = 'id', $size = 32, $primary = true)
    {
        $column = $this->string($column, $size);

        // gestion de la clé primaire
        if ($primary) {
            $column->primary();
        }

        return $column;
    }
1320911
public function save($string, $size, $color, $bg, $target)
    {
        return (!file_exists($target)) ? file_put_contents("$target", $this->getImgData($string, $size, $color, $bg)) : false;
    }
873793
public function getColoredString($string, $foregroundColor = null, $backgroundColor = null) {

        $colored_string = "";

        // Check if given foreground color found
        if (isset($this->foregroundColors[$foregroundColor])) {
            $colored_string .= "\033[" . $this->foregroundColors[$foregroundColor] . "m";
        }
        // Check if given background color found
        if (isset($this->backgroundColors[$backgroundColor])) {
            $colored_string .= "\033[" . $this->backgroundColors[$backgroundColor] . "m";
        }

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

        return $colored_string;
    }
331809
public function getImage($size = null)
    {
        assert('$this->image');
        if ($size === null) {
            $size = $this->maxSize;
        }
        $icon = imagecreatetruecolor($size, $size);
        $srcSize = $this->tileSize * $this->tiles;
        imagecopyresampled($icon, $this->image, 0, 0, 0, 0, $size, $size, $srcSize, $srcSize);
        return $icon;
    }
785982
public String getIconUrl(String size) {
        if (iconUrl == null) {
            return Jenkins.RESOURCE_PATH + "/images/" + size + "/" + HEALTH_UNKNOWN_IMG;
        }
        if (iconUrl.startsWith("/")) {
            return iconUrl.replace("/32x32/", "/" + size + "/");
        }
        return Jenkins.RESOURCE_PATH + "/images/" + size + "/" + iconUrl;
    }
575631
public static function createSquare($p_destFile, $p_size, $p_background = null)
    {
        try {
            $im = ImageCreate($p_size, $p_size);
            $cf = ImageColorAllocate($im, 255, 255, 255);
            
            return @imagejpeg($im, $p_destFile, 90);
        } catch (\Exception $ex) {
            // ...
        }
        
        return false;
    }
301259
public static int getColor(GraphicFactory graphicFactory, String colorString) {
        return getColor(graphicFactory, colorString, null, null);
    }
743556
public function thumbnail($size = null, $attr = null)
    {
        return get_the_post_thumbnail($this->id(), $size, $attr);
    }
180394
public function paintString($string, $foregroundColor = null, $backgroundCcolor = null, $option=null)
    {
        $coloredString = "";

        if (isset($this->foregroundColors[$foregroundColor])) {
            $coloredString .= "\033[".$this->foregroundColors[$foregroundColor]."m";
        }

        if (isset($this->backgroundColors[$backgroundCcolor])) {
            $coloredString .= "\033[".$this->backgroundColors[$backgroundCcolor]."m";
        }

        if (isset($this->options[$option])) {
            $coloredString .= "\033[".$this->options[$option]."m";
        }

        return $coloredString.$string."\033[0m";
    }
1339036
@NonNull
    public IconicsDrawable backgroundColorRes(@ColorRes int colorResId) {
        return backgroundColor(ContextCompat.getColor(mContext, colorResId));
    }
1127109
public static int getColor(GraphicFactory graphicFactory, String colorString, ThemeCallback themeCallback, RenderInstruction origin) {
        if (colorString.isEmpty() || colorString.charAt(0) != '#') {
            throw new IllegalArgumentException(UNSUPPORTED_COLOR_FORMAT + colorString);
        } else if (colorString.length() == 7) {
            return getColor(graphicFactory, colorString, 255, 1, themeCallback, origin);
        } else if (colorString.length() == 9) {
            return getColor(graphicFactory, colorString, Integer.parseInt(colorString.substring(1, 3), 16), 3, themeCallback, origin);
        } else {
            throw new IllegalArgumentException(UNSUPPORTED_COLOR_FORMAT + colorString);
        }
    }