Class: HexaPDF::Content::ColorSpace::DeviceCMYK
- Inherits:
-
Object
- Object
- HexaPDF::Content::ColorSpace::DeviceCMYK
- Defined in:
- lib/hexapdf/content/color_space.rb
Overview
The DeviceCMYK color space.
Defined Under Namespace
Classes: Color
Constant Summary collapse
- DEFAULT =
The one (and only) DeviceCMYK color space.
new
Class Method Summary collapse
-
.new(_definition = nil) ⇒ Object
Returns the DeviceCMYK color space object.
Instance Method Summary collapse
-
#color(c, m, y, k) ⇒ Object
Returns the color object for the given cyan, magenta, yellow and black components.
-
#default_color ⇒ Object
Returns the default color for the DeviceCMYK color space.
-
#family ⇒ Object
(also: #definition)
Returns
:DeviceCMYK
. -
#prenormalized_color(c, m, y, k) ⇒ Object
Returns the color object for the cyan, magenta, yellow and black components without applying value normalization.
Class Method Details
Instance Method Details
#color(c, m, y, k) ⇒ Object
Returns the color object for the given cyan, magenta, yellow and black components.
Color values can either be integers in the range from 0 to 100 or floating point numbers between 0.0 and 1.0. The integer color values are automatically normalized to the DeviceCMYK color value range of 0.0 to 1.0.
569 570 571 572 |
# File 'lib/hexapdf/content/color_space.rb', line 569 def color(c, m, y, k) Color.new(ColorUtils.normalize_value(c, 100), ColorUtils.normalize_value(m, 100), ColorUtils.normalize_value(y, 100), ColorUtils.normalize_value(k, 100)) end |
#default_color ⇒ Object
Returns the default color for the DeviceCMYK color space.
560 561 562 |
# File 'lib/hexapdf/content/color_space.rb', line 560 def default_color Color.new(0.0, 0.0, 0.0, 1.0) end |
#family ⇒ Object Also known as: definition
Returns :DeviceCMYK
.
583 584 585 |
# File 'lib/hexapdf/content/color_space.rb', line 583 def family :DeviceCMYK end |