You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: placeholdit.rb
    path of file: ./repos/faker/lib/faker/default
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module Faker
  class Placeholdit < Base
    class << self
      SUPPORTED_FORMATS = %w[png jpg gif jpeg].freeze

      ##
      # Produces a random placeholder image from https://via.placeholder.com.
      #
      # @param size [String] Specifies the image's size, dimensions separated by 'x'.
      # @param format [String] Specifies the image's extension.
      # @param background_color [String, Symbol] Specifies the background color, either in hexadecimal format (without #) or as :random.
      # @param text_color [String, Symbol] Specifies the text color, either in hexadecimal format (without #) or as :random.
      # @param text [String] Specifies a custom text to be used.
      # @return [String]
      #
      # @example
      #     # Keyword argu
    
      def image(size: '300x300', format: 'png', background_color: nil, text_color: nil, text: nil)
        background_color = generate_color if background_color == :random
        text_color = generate_color if text_color == :random

        raise ArgumentError, 'Size should be specified in format 300x300' unless size =~ /^[0-9]+x[0-9]+$/
        raise ArgumentError, "Supported formats are #{SUPPORTED_FORMATS.join(', ')}" unless SUPPORTED_FORMATS.include?(format)
        raise ArgumentError, "background_color must be a hex value without '#'" unless background_color.nil? || background_color =~ /((?:^\h{3}$)|(?:^\h{6}$)){1}(?!.*\H)/
        raise ArgumentError, "text_color must be a hex value without '#'" unless text_color.nil? || text_color =~ /((?:^\h{3}$)|(?:^\h{6}$)){1}(?!.*\H)/

        image_url = "https://via.placeholder.com/#{size}.#{format}"
        image_url += "/#{background_color}" if background_color
        image_url += "/#{text_color}" if text_color
        image_url += "?text=#{text}" if text
        image_url
      end