class HexaPDF::Content::ColorSpace::DeviceCMYK
The DeviceCMYK
color space.
Constants
- DEFAULT
The one (and only)
DeviceCMYK
color space.
Public Class Methods
new(_definition = nil)
click to toggle source
Returns the DeviceCMYK
color space object.
# File lib/hexapdf/content/color_space.rb, line 306 def self.new(_definition = nil) DEFAULT end
Public Instance Methods
color(c, m, y, k)
click to toggle source
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.
# File lib/hexapdf/content/color_space.rb, line 320 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()
click to toggle source
Returns the default color for the DeviceCMYK
color space.
# File lib/hexapdf/content/color_space.rb, line 311 def default_color Color.new(0.0, 0.0, 0.0, 1.0) end
family()
click to toggle source
Returns :DeviceCMYK
.
# File lib/hexapdf/content/color_space.rb, line 334 def family :DeviceCMYK end
Also aliased as: definition
prenormalized_color(c, m, y, k)
click to toggle source
Returns the color object for the cyan, magenta, yellow and black components without applying value normalization.
See: color
# File lib/hexapdf/content/color_space.rb, line 329 def prenormalized_color(c, m, y, k) Color.new(c, m, y, k) end