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

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

Overview

Implementation of the ‘G’ operator.

See: PDF1.7 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:



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

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

Instance Method Details

#invoke(processor, gray) ⇒ Object

:nodoc:



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

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