Class: Cairo::Color::CMYK
Instance Attribute Summary collapse
-
#cyan ⇒ Object
(also: #c)
Returns the value of attribute cyan.
-
#key_plate ⇒ Object
(also: #k)
Returns the value of attribute key_plate.
-
#magenta ⇒ Object
(also: #m)
Returns the value of attribute magenta.
-
#yellow ⇒ Object
(also: #y)
Returns the value of attribute yellow.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(c, m, y, k, a = 1.0) ⇒ CMYK
constructor
A new instance of CMYK.
- #to_a ⇒ Object (also: #to_ary)
- #to_cmyk ⇒ Object
- #to_hsv ⇒ Object
- #to_rgb ⇒ Object
Constructor Details
#initialize(c, m, y, k, a = 1.0) ⇒ CMYK
Returns a new instance of CMYK.
176 177 178 179 180 181 182 183 184 185 186 |
# File 'lib/cairo/color.rb', line 176 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 |
Instance Attribute Details
#cyan ⇒ Object Also known as: c
Returns the value of attribute cyan.
165 166 167 |
# File 'lib/cairo/color.rb', line 165 def cyan @cyan end |
#key_plate ⇒ Object Also known as: k
Returns the value of attribute key_plate.
165 166 167 |
# File 'lib/cairo/color.rb', line 165 def key_plate @key_plate end |
#magenta ⇒ Object Also known as: m
Returns the value of attribute magenta.
165 166 167 |
# File 'lib/cairo/color.rb', line 165 def magenta @magenta end |
#yellow ⇒ Object Also known as: y
Returns the value of attribute yellow.
165 166 167 |
# File 'lib/cairo/color.rb', line 165 def yellow @yellow end |
Instance Method Details
#to_a ⇒ Object Also known as: to_ary
188 189 190 |
# File 'lib/cairo/color.rb', line 188 def to_a [@cyan, @magenta, @yellow, @key_plate, @alpha] end |
#to_cmyk ⇒ Object
204 205 206 |
# File 'lib/cairo/color.rb', line 204 def to_cmyk clone end |
#to_hsv ⇒ Object
208 209 210 |
# File 'lib/cairo/color.rb', line 208 def to_hsv to_rgb.to_hsv end |