Class: DynamicPDFApi::CmykColor
- Defined in:
- lib/ruby_client/CmykColor.rb
Overview
Represents a CMYK color.
Instance Attribute Summary collapse
-
#_color_string ⇒ Object
Returns the value of attribute _color_string.
Instance Method Summary collapse
-
#black ⇒ Object
Gets the color black.
-
#initialize(cyan = 0, magenta = 0, yellow = 0, black = 0) ⇒ CmykColor
constructor
Initializes a new instance of the CmykColor class.
-
#white ⇒ Object
Gets the color white.
Constructor Details
#initialize(cyan = 0, magenta = 0, yellow = 0, black = 0) ⇒ CmykColor
Initializes a new instance of the CmykColor class.
Values must be between 0.0 and 1.0.
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/ruby_client/CmykColor.rb', line 18 def initialize(cyan = 0, magenta = 0, yellow = 0, black = 0) super() if cyan < 0.0 || cyan > 1.0 || magenta < 0.0 || magenta > 1.0 || yellow < 0.0 || yellow > 1.0 || black < 0.0 || black > 1.0 raise 'CMYK values must be from 0.0 to 1.0.' end @_color_string = "cmyk(#{cyan},#{magenta},#{yellow},#{black})" @cyan = cyan @magenta = magenta @yellow = yellow @black = black end |
Instance Attribute Details
#_color_string ⇒ Object
Returns the value of attribute _color_string.
45 46 47 |
# File 'lib/ruby_client/CmykColor.rb', line 45 def _color_string @_color_string end |