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.
168 169 170 171 172 173 174 175 176 177 178 |
# 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 |
Instance Attribute Details
#cyan ⇒ Object Also known as: c
Returns the value of attribute cyan.
157 158 159 |
# File 'lib/cairo/color.rb', line 157 def cyan @cyan end |
#key_plate ⇒ Object Also known as: k
Returns the value of attribute key_plate.
157 158 159 |
# File 'lib/cairo/color.rb', line 157 def key_plate @key_plate end |
#magenta ⇒ Object Also known as: m
Returns the value of attribute magenta.
157 158 159 |
# File 'lib/cairo/color.rb', line 157 def magenta @magenta end |
#yellow ⇒ Object Also known as: y
Returns the value of attribute yellow.
157 158 159 |
# File 'lib/cairo/color.rb', line 157 def yellow @yellow end |
Instance Method Details
#to_a ⇒ Object Also known as: to_ary
180 181 182 |
# File 'lib/cairo/color.rb', line 180 def to_a [@cyan, @magenta, @yellow, @key_plate, @alpha] end |
#to_cmyk ⇒ Object
196 197 198 |
# File 'lib/cairo/color.rb', line 196 def to_cmyk clone end |
#to_hsv ⇒ Object
200 201 202 |
# File 'lib/cairo/color.rb', line 200 def to_hsv to_rgb.to_hsv end |