rgb(255, 0, 0) #
# File lib/less/engine/nodes/literal.rb, line 44
44: def * other; operate :*, other end
# File lib/less/engine/nodes/literal.rb, line 42
42: def + other; operate :+, other end
# File lib/less/engine/nodes/literal.rb, line 43
43: def - other; operate :-, other end
# File lib/less/engine/nodes/literal.rb, line 45
45: def / other; operate :/, other end
# File lib/less/engine/nodes/literal.rb, line 25
25: def alpha v
26: self.class.new r, g, b, v
27: end
# File lib/less/engine/nodes/literal.rb, line 47
47: def coerce other
48: return self, other
49: end
# File lib/less/engine/nodes/literal.rb, line 59
59: def inspect
60: if a < 1.0
61: "rgba(#{r}, #{g}, #{b}, #{a})"
62: else
63: "rgb(#{r}, #{g}, #{b})"
64: end
65: end
# File lib/less/engine/nodes/literal.rb, line 33
33: def operate op, other
34: color = if other.is_a? Numeric
35: rgb.map {|c| c.send(op, other) }
36: else
37: rgb.zip(other.rgb).map {|a, b| a.send(op, b) }
38: end
39: self.class.new *[color, @a].flatten # Ruby 1.8 hack
40: end
# File lib/less/engine/nodes/literal.rb, line 29
29: def rgb
30: [r, g, b]
31: end
# File lib/less/engine/nodes/literal.rb, line 67
67: def to_css
68: to_s
69: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.