def rgba(*args)
      case args.size
      when 1
        return unquoted_string("rgba(#{args.first})") if var?(args.first)
        raise ArgumentError.new("wrong number of arguments (1 for 4)")
      when 2
        color, alpha = args

        if var?(color)
          return unquoted_string("rgba(#{color}, #{alpha})")
        elsif var?(alpha)
          if color.is_a?(Sass::Script::Value::Color)
            return unquoted_string("rgba(#{color.red}, #{color.green}, #{color.blue}, #{alpha})")
          else
            return unquoted_string("rgba(#{color}, #{alpha})")
          end
        end

        assert_type color, :Color, :color
        if special_number?(alpha)
          unquoted_string("rgba(#{color.red}, #{color.green}, #{color.blue}, #{alpha})")
        else
          assert_type alpha, :Number, :alpha
          color.with(:alpha => percentage_or_unitless(alpha, 1, "alpha"))
        end
      when 3
        if var?(args[0]) || var?(args[1]) || var?(args[2])
          unquoted_string("rgba(#{args.join(', ')})")
        else
          raise ArgumentError.new("wrong number of arguments (3 for 4)")
        end
      when 4
        red, green, blue, alpha = args
        if special_number?(red) || special_number?(green) ||
           special_number?(blue) || special_number?(alpha)
          unquoted_string("rgba(#{red}, #{green}, #{blue}, #{alpha})")
        else
          rgba(rgb(red, green, blue), alpha)
        end
      else
        raise ArgumentError.new("wrong number of arguments (#{args.size} for 4)")
      end
    end
def rgba(*args)
      case args.size
      when 1
        return unquoted_string("rgba(#{args.first})") if var?(args.first)
        raise ArgumentError.new("wrong number of arguments (1 for 4)")
      when 2
        color, alpha = args

        if var?(color)
          return unquoted_string("rgba(#{color}, #{alpha})")
        elsif var?(alpha)
          if color.is_a?(Sass::Script::Value::Color)
            return unquoted_string("rgba(#{color.red}, #{color.green}, #{color.blue}, #{alpha})")
          else
            return unquoted_string("rgba(#{color}, #{alpha})")
          end
        end

        assert_type color, :Color, :color
        if special_number?(alpha)
          unquoted_string("rgba(#{color.red}, #{color.green}, #{color.blue}, #{alpha})")
        else
          assert_type alpha, :Number, :alpha
          color.with(:alpha => percentage_or_unitless(alpha, 1, "alpha"))
        end
      when 3
        if var?(args[0]) || var?(args[1]) || var?(args[2])
          unquoted_string("rgba(#{args.join(', ')})")
        else
          raise ArgumentError.new("wrong number of arguments (3 for 4)")
        end
      when 4
        red, green, blue, alpha = args
        if special_number?(red) || special_number?(green) ||
           special_number?(blue) || special_number?(alpha)
          unquoted_string("rgba(#{red}, #{green}, #{blue}, #{alpha})")
        else
          rgba(rgb(red, green, blue), alpha)
        end
      else
        raise ArgumentError.new("wrong number of arguments (#{args.size} for 4)")
      end
    end
Creates a {Sass::Script::Value::Color Color} from red, green, blue, and
 alpha values.
 @see #rgb

 @overload rgba($red, $green, $blue, $alpha)
   @param $red [Sass::Script::Value::Number] The amount of red in the
     color. Must be between 0 and 255 inclusive or 0% and 100% inclusive
   @param $green [Sass::Script::Value::Number] The amount of green in the
     color. Must be between 0 and 255 inclusive or 0% and 100% inclusive
   @param $blue [Sass::Script::Value::Number] The amount of blue in the
     color. Must be between 0 and 255 inclusive or 0% and 100% inclusive
   @param $alpha [Sass::Script::Value::Number] The opacity of the color.
     Must be between 0 and 1 inclusive
   @return [Sass::Script::Value::Color]
   @raise [ArgumentError] if any parameter is the wrong type or out of
     bounds

 @overload rgba($color, $alpha)
   Sets the opacity of an existing color.

   @example
     rgba(#102030, 0.5) => rgba(16, 32, 48, 0.5)
     rgba(blue, 0.2)    => rgba(0, 0, 255, 0.2)

   @param $color [Sass::Script::Value::Color] The color whose opacity will
     be changed.
   @param $alpha [Sass::Script::Value::Number] The new opacity of the
     color. Must be between 0 and 1 inclusive
   @return [Sass::Script::Value::Color]
   @raise [ArgumentError] if `$alpha` is out of bounds or either parameter
     is the wrong type