Method: Sass::Script::Color#initialize

Defined in:
lib/sass/script/color.rb

#initialize(rgb) ⇒ Color

Returns a new instance of Color.

Raises:



27
28
29
30
31
# File 'lib/sass/script/color.rb', line 27

def initialize(rgb)
  rgb = rgb.map {|c| c.to_i}
  raise Sass::SyntaxError.new("Color values must be between 0 and 255") if rgb.any? {|c| c < 0 || c > 255}
  super(rgb)
end