Class: Pdfrb::Color::DeviceN

Inherits:
ColorSpace show all
Defined in:
lib/pdfrb/color/color_space.rb

Overview

DeviceN color space — multiple named inks.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ColorSpace

[], names, register, register_as, registry

Constructor Details

#initialize(names:, alternate:, tint_transform:) ⇒ DeviceN

Returns a new instance of DeviceN.



218
219
220
221
222
# File 'lib/pdfrb/color/color_space.rb', line 218

def initialize(names:, alternate:, tint_transform:)
  @names = names
  @alternate = alternate
  @tint_transform = tint_transform
end

Instance Attribute Details

#alternateObject (readonly)

Returns the value of attribute alternate.



216
217
218
# File 'lib/pdfrb/color/color_space.rb', line 216

def alternate
  @alternate
end

#namesObject (readonly)

Returns the value of attribute names.



216
217
218
# File 'lib/pdfrb/color/color_space.rb', line 216

def names
  @names
end

#tint_transformObject (readonly)

Returns the value of attribute tint_transform.



216
217
218
# File 'lib/pdfrb/color/color_space.rb', line 216

def tint_transform
  @tint_transform
end

Class Method Details

.pdf_nameObject



225
# File 'lib/pdfrb/color/color_space.rb', line 225

def pdf_name; :DeviceN; end

Instance Method Details

#to_pdfObject



228
229
230
231
232
233
234
235
# File 'lib/pdfrb/color/color_space.rb', line 228

def to_pdf
  Pdfrb::Model::PdfArray.new([
                               :DeviceN,
                               Pdfrb::Model::PdfArray.new(@names),
                               @alternate,
                               @tint_transform,
                             ])
end