class OoxmlParser::ColorProperties

Class for color transformations

Attributes

alpha[R]

@return [Integer] alpha value of color

luminance_modulation[R]

@return [Float] luminance modulation value

luminance_offset[R]

@return [Float] luminance offset value

tint[R]

@return [Float] tint value

Public Instance Methods

parse(node) click to toggle source

Parse ColorProperties object @param node [Nokogiri::XML:Element] node to parse @return [ColorProperties] result of parsing

# File lib/ooxml_parser/common_parser/common_data/colors/color_properties.rb, line 18
def parse(node)
  node.xpath('*').each do |node_child|
    case node_child.name
    when 'alpha'
      @alpha = (node_child.attribute('val').value.to_f / 1_000.0).round
    when 'lumMod'
      @luminance_modulation = node_child.attribute('val').value.to_f / 100_000.0
    when 'lumOff'
      @luminance_offset = node_child.attribute('val').value.to_f / 100_000.0
    when 'tint'
      @tint = node_child.attribute('val').value.to_f / 100_000.0
    end
  end
  self
end