Class: HexaPDF::Content::Operator::SetDeviceGrayNonStrokingColor

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

#initializeSetDeviceGrayNonStrokingColor

Creates the operator.



437
438
439
# File 'lib/hexapdf/content/operator.rb', line 437

def initialize
  super('g')
end

Instance Method Details

#invoke(processor, gray) ⇒ Object

:nodoc:



441
442
443
444
# File 'lib/hexapdf/content/operator.rb', line 441

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