def rgb(red, green = nil, blue = nil)
      if green.nil?
        return unquoted_string("rgb(#{red})") if var?(red)
        raise ArgumentError.new("wrong number of arguments (1 for 3)")
      elsif blue.nil?
        return unquoted_string("rgb(#{red}, #{green})") if var?(red) || var?(green)
        raise ArgumentError.new("wrong number of arguments (2 for 3)")
      end

      if special_number?(red) || special_number?(green) || special_number?(blue)
        return unquoted_string("rgb(#{red}, #{green}, #{blue})")
      end
      assert_type red, :Number, :red
      assert_type green, :Number, :green
      assert_type blue, :Number, :blue

      color_attrs = [
        percentage_or_unitless(red, 255, "red"),
        percentage_or_unitless(green, 255, "green"),
        percentage_or_unitless(blue, 255, "blue")
      ]

      # Don't store the string representation for function-created colors, both
      # because it's not very useful and because some functions aren't supported
      # on older browsers.
      Sass::Script::Value::Color.new(color_attrs)
    end
def rgb(red, green = nil, blue = nil)
      if green.nil?
        return unquoted_string("rgb(#{red})") if var?(red)
        raise ArgumentError.new("wrong number of arguments (1 for 3)")
      elsif blue.nil?
        return unquoted_string("rgb(#{red}, #{green})") if var?(red) || var?(green)
        raise ArgumentError.new("wrong number of arguments (2 for 3)")
      end

      if special_number?(red) || special_number?(green) || special_number?(blue)
        return unquoted_string("rgb(#{red}, #{green}, #{blue})")
      end
      assert_type red, :Number, :red
      assert_type green, :Number, :green
      assert_type blue, :Number, :blue

      color_attrs = [
        percentage_or_unitless(red, 255, "red"),
        percentage_or_unitless(green, 255, "green"),
        percentage_or_unitless(blue, 255, "blue")
      ]

      # Don't store the string representation for function-created colors, both
      # because it's not very useful and because some functions aren't supported
      # on older browsers.
      Sass::Script::Value::Color.new(color_attrs)
    end
Creates a {Sass::Script::Value::Color Color} object from red, green, and
 blue values.

 @see #rgba
 @overload rgb($red, $green, $blue)
   @param $red [Sass::Script::Value::Number] The amount of red in the color.
     Must be between 0 and 255 inclusive, or between `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 between `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 between `0%` and `100%`
     inclusive
 @return [Sass::Script::Value::Color]
 @raise [ArgumentError] if any parameter is the wrong type or out of bounds