Sha256: 71382725580c374274781ac7c29e98d32fd78edee16b1df7ab3b69d5456f136f
Contents?: true
Size: 693 Bytes
Versions: 40
Compression:
Stored size: 693 Bytes
Contents
# frozen_string_literal: true module OoxmlParser # Class for working with AlphaChannel class ColorAlphaChannel # Parse AlphaChannel value # @param node [Nokogiri::XML::Element] node to parse # @return [Fixnum] value of AlphaChannel def self.parse(node) alpha_channel_node = node.xpath('a:alpha', 'xmlns:a' => 'http://schemas.openxmlformats.org/drawingml/2006/main').first alpha_channel_node = node.xpath('w14:alpha', 'xmlns:w14' => 'http://schemas.microsoft.com/office/word/2010/wordml').first if alpha_channel_node.nil? return 100.0 if alpha_channel_node.nil? (alpha_channel_node.attribute('val').value.to_f / 1_000.0).round(0) end end end
Version data entries
40 entries across 40 versions & 1 rubygems