Class: OoxmlParser::ThemeColors
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::ThemeColors
- Defined in:
- lib/ooxml_parser/common_parser/common_data/colors/theme_colors.rb
Overview
Class for hold ThemeColors list
Instance Attribute Summary collapse
-
#list ⇒ Hash
List of colors.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#parse_color_theme(theme, tint) ⇒ Color
Parse color theme.
Methods inherited from OOXMLDocumentObject
#==, #boolean_attribute_value, #initialize, #parse_xml, #with_data?
Methods included from OoxmlObjectAttributeHelper
#attribute_enabled?, #option_enabled?
Methods included from OoxmlDocumentObjectHelper
Constructor Details
This class inherits a constructor from OoxmlParser::OOXMLDocumentObject
Instance Attribute Details
#list ⇒ Hash
Returns list of colors.
7 8 9 |
# File 'lib/ooxml_parser/common_parser/common_data/colors/theme_colors.rb', line 7 def list @list end |
Instance Method Details
#parse_color_theme(theme, tint) ⇒ Color
Parse color theme
13 14 15 16 17 18 19 20 21 |
# 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 |