Sha256: 945b6ff767ec26490ef02cce91843b384d3fa7d035ad70ed6b21ac5a3f4a2875

Contents?: true

Size: 661 Bytes

Versions: 2

Compression:

Stored size: 661 Bytes

Contents

module OoxmlParser
  class PresentationPattern < OOXMLDocumentObject
    attr_accessor :preset, :foreground_color, :background_color

    def initialize(preset = nil)
      @preset = preset
    end

    def self.parse(pattern_node)
      pattern = PresentationPattern.new(pattern_node.attribute('prst').value.to_sym)
      pattern_node.xpath('*').each do |color_node|
        case color_node.name
        when 'fgClr'
          pattern.foreground_color = Color.parse_color(color_node.xpath('*').first)
        when 'bgClr'
          pattern.background_color = Color.parse_color(color_node.xpath('*').first)
        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/colors/presentation_fill/presentation_pattern.rb
ooxml_parser-0.1.1 lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/presentation_pattern.rb