def parse(source)
      return source if source.is_a?(Integer)
      case source.to_s
        when /^\d+$/ then source.to_s.to_i
        when HEX3_COLOR_REGEXP, HEX6_COLOR_REGEXP then from_hex(source.to_s)
        when HTML_COLOR_REGEXP then html_color(source.to_s)
        else raise ArgumentError, "Don't know how to create a color from #{source.inspect}!"
      end
    end
def parse(source)
      return source if source.is_a?(Integer)
      case source.to_s
        when /^\d+$/ then source.to_s.to_i
        when HEX3_COLOR_REGEXP, HEX6_COLOR_REGEXP then from_hex(source.to_s)
        when HTML_COLOR_REGEXP then html_color(source.to_s)
        else raise ArgumentError, "Don't know how to create a color from #{source.inspect}!"
      end
    end
CONSTRUCTING COLOR VALUES

 Parses a color value given a numeric or string argument.

 It supports color numbers, colors in hex notation and named HTML colors.

 @param [Integer, String] source The color value.
 @return [Integer] The color value, with the opacity applied if one was
   given.