Class: HexaPDF::Content::Operator::SetDeviceRGBStrokingColor
- Inherits:
-
BaseOperator
- Object
- BaseOperator
- HexaPDF::Content::Operator::SetDeviceRGBStrokingColor
- Defined in:
- lib/hexapdf/content/operator.rb
Overview
Implementation of the ‘RG’ operator.
See: PDF2.0 s8.6.8
Instance Attribute Summary
Attributes inherited from BaseOperator
Instance Method Summary collapse
-
#initialize ⇒ SetDeviceRGBStrokingColor
constructor
Creates the operator.
-
#invoke(processor, r, g, b) ⇒ Object
:nodoc:.
-
#serialize(serializer, r, g, b) ⇒ Object
:nodoc:.
Constructor Details
#initialize ⇒ SetDeviceRGBStrokingColor
Creates the operator.
454 455 456 |
# File 'lib/hexapdf/content/operator.rb', line 454 def initialize super('RG') end |
Instance Method Details
#invoke(processor, r, g, b) ⇒ Object
:nodoc:
458 459 460 461 |
# File 'lib/hexapdf/content/operator.rb', line 458 def invoke(processor, r, g, b) #:nodoc: processor.graphics_state.stroke_color = processor.resources.color_space(:DeviceRGB).prenormalized_color(r, g, b) end |
#serialize(serializer, r, g, b) ⇒ Object
:nodoc:
463 464 465 466 |
# File 'lib/hexapdf/content/operator.rb', line 463 def serialize(serializer, r, g, b) #:nodoc: "#{serializer.serialize_numeric(r)} #{serializer.serialize_numeric(g)} " \ "#{serializer.serialize_numeric(b)} RG\n" end |