Sha256: 3e49368b311c649dc3861b95a129fffd4410ec46ef0e4f6eb79be8821a5f53ca

Contents?: true

Size: 624 Bytes

Versions: 2

Compression:

Stored size: 624 Bytes

Contents

# Docx Pattern Fill Data
module OoxmlParser
  class DocxPatternFill < OOXMLDocumentObject
    attr_accessor :foreground_color, :background_color, :preset

    def self.parse(fill_node)
      pattern = DocxPatternFill.new
      pattern.preset = fill_node.attribute('prst').value.to_sym
      fill_node.xpath('*').each do |fill_node_child|
        case fill_node_child.name
        when 'fgClr'
          pattern.foreground_color = Color.parse_color_model(fill_node_child)
        when 'bgClr'
          pattern.background_color = Color.parse_color_model(fill_node_child)
        end
      end
      pattern
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ooxml_parser-0.1.2 lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/color/docx_pattern_fill.rb
ooxml_parser-0.1.1 lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/color/docx_pattern_fill.rb