class OoxmlParser::ThemeColors
Class for hold ThemeColors
list
Attributes
list[RW]
@return [Hash] list of colors
Public Instance Methods
parse_color_theme(theme, tint)
click to toggle source
Parse color theme @param theme [String] name of theme @param tint [Integer] tint of theme @return [Color] color of theme
# File lib/ooxml_parser/common_parser/common_data/colors/theme_colors.rb, line 13 def parse_color_theme(theme, tint) themes_array = root_object.theme.color_scheme.values # TODO: if no swap performed - incorrect color parsing. But don't know why it needed themes_array[0], themes_array[1] = themes_array[1], themes_array[0] themes_array[2], themes_array[3] = themes_array[3], themes_array[2] hls = themes_array[theme].color.to_hsl tint = 0 if tint.nil? hls.calculate_rgb_with_tint(tint) end