# File lib/as_color.rb, line 85 def to_rgba return RGB.new(v, v, v, a) if s == 0 h, f = (self.h*6).divmod(1) p = v*(1 - s) q = v*(1 - s*f) t = v*(1 - s*(1 - f)) case h.to_i when 0: [v, t, p, a] when 1: [q, v, p, a] when 2: [p, v, t, a] when 3: [p, q, v, a] when 4: [t, p, v, a] else [v, p, q, a] end end