Class: OoxmlParser::ColorAlphaChannel
- Inherits:
-
Object
- Object
- OoxmlParser::ColorAlphaChannel
- Defined in:
- lib/ooxml_parser/common_parser/common_data/colors/color_alpha_channel.rb
Class Method Summary collapse
-
.parse(node) ⇒ Fixnum
Parse AlphaChannel value.
Class Method Details
.parse(node) ⇒ Fixnum
Parse AlphaChannel value
7 8 9 10 11 12 |
# File 'lib/ooxml_parser/common_parser/common_data/colors/color_alpha_channel.rb', line 7 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 |