# File lib/less/engine/nodes/function.rb, line 24 def hsla h, s, l, a = 1.0 m2 = ( l <= 0.5 ) ? l * ( s + 1 ) : l + s - l * s m1 = l * 2 - m2; hue = lambda do |h| h = h < 0 ? h + 1 : (h > 1 ? h - 1 : h) if h * 6 < 1 then m1 + (m2 - m1) * h * 6 elsif h * 2 < 1 then m2 elsif h * 3 < 2 then m1 + (m2 - m1) * (2/3 - h) * 6 else m1 end end rgba hue[ h + 1/3 ], hue[ h ], hue[ h - 1/3 ], a end