# File lib/rainbow/color.rb, line 6 def self.build(ground, values) unless [1, 3].include?(values.size) fail ArgumentError, "Wrong number of arguments for color definition, should be 1 or 3" end color = values.size == 1 ? values.first : values case color when ::Fixnum Indexed.new(ground, color) when ::Symbol Named.new(ground, color) when ::Array RGB.new(ground, *color) when ::String RGB.new(ground, *parse_hex_color(color)) end end
Generated with the Darkfish Rdoc Generator 2.