Method: Less::Node::Color#initialize
- Defined in:
- lib/less/engine/nodes/literal.rb
#initialize(r, g, b, a = 1.0) ⇒ Color
Returns a new instance of Color.
18 19 20 21 22 23 |
# File 'lib/less/engine/nodes/literal.rb', line 18 def initialize r, g, b, a = 1.0 @r, @g, @b = [r, g, b].map do |c| normalize(c.is_a?(::String) ? c.to_i(16) : c) end @a = normalize(a, 1.0) end |