Method: Less::Node::Color#operate

Defined in:
lib/less/engine/nodes/literal.rb

#operate(op, other) ⇒ Object



33
34
35
36
37
38
39
40
# File 'lib/less/engine/nodes/literal.rb', line 33

def operate op, other
  color = if other.is_a? Numeric
    rgb.map {|c| c.send(op, other) }
  else
    rgb.zip(other.rgb).map {|a, b| a.send(op, b) }
  end
  self.class.new *[color, @a].flatten # Ruby 1.8 hack
end