Class: HexaPDF::Content::Operator::SetDeviceGrayStrokingColor

Inherits:
SingleNumericArgumentOperator show all
Defined in:
lib/hexapdf/content/operator.rb

Overview

Implementation of the ā€˜Gā€™ operator.

See: PDF2.0 s8.6.8

Instance Attribute Summary

Attributes inherited from BaseOperator

#name

Instance Method Summary collapse

Methods inherited from SingleNumericArgumentOperator

#serialize

Methods inherited from BaseOperator

#serialize

Constructor Details

#initializeSetDeviceGrayStrokingColor

:nodoc:



420
421
422
# File 'lib/hexapdf/content/operator.rb', line 420

def initialize #:nodoc:
  super('G')
end

Instance Method Details

#invoke(processor, gray) ⇒ Object

:nodoc:



424
425
426
427
# File 'lib/hexapdf/content/operator.rb', line 424

def invoke(processor, gray) #:nodoc:
  processor.graphics_state.stroke_color =
    processor.resources.color_space(:DeviceGray).prenormalized_color(gray)
end