Class: Pdfrb::Color::Lab

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from CIEBasedColorSpace

#to_pdf

Methods inherited from ColorSpace

[], names, register, register_as, registry

Constructor Details

#initialize(white_point:, black_point: nil, range: nil) ⇒ Lab

Returns a new instance of Lab.



136
137
138
139
140
# File 'lib/pdfrb/color/color_space.rb', line 136

def initialize(white_point:, black_point: nil, range: nil)
  @white_point = white_point
  @black_point = black_point
  @range = range
end

Instance Attribute Details

#black_pointObject (readonly)

Returns the value of attribute black_point.



134
135
136
# File 'lib/pdfrb/color/color_space.rb', line 134

def black_point
  @black_point
end

#rangeObject (readonly)

Returns the value of attribute range.



134
135
136
# File 'lib/pdfrb/color/color_space.rb', line 134

def range
  @range
end

#white_pointObject (readonly)

Returns the value of attribute white_point.



134
135
136
# File 'lib/pdfrb/color/color_space.rb', line 134

def white_point
  @white_point
end

Class Method Details

.pdf_nameObject



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

def pdf_name; :Lab; end

Instance Method Details

#parameters_arrayObject



146
147
148
149
150
151
# File 'lib/pdfrb/color/color_space.rb', line 146

def parameters_array
  dict = { WhitePoint: Pdfrb::Model::PdfArray.new(@white_point) }
  dict[:BlackPoint] = Pdfrb::Model::PdfArray.new(@black_point) if @black_point
  dict[:Range] = Pdfrb::Model::PdfArray.new(@range) if @range
  dict
end