# File lib/cairo/color.rb, line 168 def initialize(c, m, y, k, a=1.0) super(a) assert_in_range(c, "cyan") assert_in_range(m, "magenta") assert_in_range(y, "yellow") assert_in_range(k, "key plate") @cyan = c @magenta = m @yellow = y @key_plate = k end
# File lib/cairo/color.rb, line 180 def to_a [@cyan, @magenta, @yellow, @key_plate, @alpha] end
# File lib/cairo/color.rb, line 196 def to_cmyk clone end
# File lib/cairo/color.rb, line 200 def to_hsv to_rgb.to_hsv end
# File lib/cairo/color.rb, line 185 def to_rgb one_k = 1.0 - @key_plate rgba = [ (1.0 - @cyan) * one_k, (1.0 - @magenta) * one_k, (1.0 - @yellow) * one_k, @alpha, ] RGB.new(*rgba) end