public static function imageUrl($size, $format = 'gif', array $colors = [], $text = null)
    {
        // $colors should be 100 or 100x100
        // but can be ['height' => 100, 'width' => 100]
        // or ['w' => 100, 'h' => 100]
        if (is_array($size)) {
            ksort($size);
            $size = implode('x', $size);
        }

        $base = 'http://placehold.it/'.$size.'.'.trim($format, '.');

        // $colors should be ['background', 'text']
        // but can be ['text' => '000', 'background' => 'fff']
        // or ['txt' => '000', 'bg' => 'fff']
        // or ['foreground' => '000', 'background' => 'fff']
        // or ['fg' => '000', 'bg' => 'fff']
        ksort($colors);

        if (2 === count($colors)) {
            $base .= '/'.implode('/', $colors);
        }

        if ($text) {
            $base .= '?'.http_build_query([
                'text' => $text,
            ]);
        }

        return $base;
    }